Streaming API Request
Streaming API Response
When delivering certain types of API responses, you may want to ‘stream’ this response (similar to your favorite AI-powered chatbots). In Xano, this is possible with a simple combination of a For Each loop and a Streaming API Response function.Setting up a streaming response
-
Set the API response type to ‘streaming’ from the API settings, or choose the streaming option when creating a new API endpoint.

-
In your function stack, once you have the data you want to stream ready to go, use a For Each loop to start looping against each item in your array.

-
Inside of the loop, use a Streaming API Response function to deliver each item inside of the array as the loop iterates through it.

- You can now test your streaming API, and should see each item in the array streamed as part of the response.
Please note that your front-end must support streaming responses. If it does not, the response can still be delivered traditionally.Using Run & Debug will not display a stream, and only the entire response once the stream has completed.
Testing your Streaming Response
Testing in Postman
- Create a new request with type HTTP
- Paste your API endpoint URL in the URL input, and click Send.
- You will see your API response delivered in the result panel.

Testing in Insomnia
- Create a new request with type Event Stream
- Paste your API endpoint URL in the URL input, and click Connect
- You will see your API response delivered in the result panel.
