Stream search results
Some sources answer faster than others. The streaming search opens a server-sent events connection and pushes offers as each source responds, so you can render the cheapest results in a second instead of waiting for the slowest provider.
Start a stream
POST/v3/HAPI/flights/searches/stream
Requires the flights:read scope. The body is identical to the blocking search. The response is text/event-stream.
curl -N -X POST https://api.hermeseus.com/v3/HAPI/flights/searches/stream \
-H "Authorization: Bearer $ACCESS_TOKEN" \
-H "Content-Type: application/json" \
-d '{
"slices": [
{ "origin": "IST", "destination": "DXB", "departure_date": "2026-11-14" }
],
"passengers": { "adults": 1 }
}'Events
| Event | Payload |
|---|---|
offers | A flight_offer_batch: the full current basket of offers. |
done | A flight_search summary with the final offer_count. |
error | The stream failed; carries a standard error object. |
event: offers
data: {"object":"flight_offer_batch","replace":true,"offer_count":42,"offers":[ /* … */ ]}
event: offers
data: {"object":"flight_offer_batch","replace":true,"offer_count":88,"offers":[ /* … */ ]}
event: done
data: {"object":"flight_search","id":"srch_583","status":"completed","offer_count":88}
Replace, do not append.
Each
offers event carries "replace": true and contains the whole current basket, refined as more sources arrive, not just the new offers. Replace your list on every event. Appending would multiply it.
When to use it
Use streaming for an interactive search screen where perceived speed matters. Use the plain blocking search for back-end jobs where you just want the final list in one response. The offers themselves are identical, and either way you continue with revalidate the offer.
Was this page helpful?