API reference
Stream the results
Opens the event stream of a search. The connection stays open until done or failed.
GET
https://dev.predictasearch.com/api/v2/search/{search_id}Path parameters
search_idstringrequired
The
search_id returned when the search was started.Headers
x-api-keystringrequired
The key that started the search. Any other key gets a 404.
Acceptstringrecommended
text/event-streamLast-Event-IDintegeroptional
The id of the last event you received. The stream starts right after it.
Without it, the stream starts from the first event, id: 0: a search under way or finished is replayed from the start.
Response
200 with Content-Type: text/event-stream. The events are sent as they happen.
A : ping comment line is sent every 15 seconds while nothing else happens, so that proxies keep the connection open. Ignore it; SSE libraries do. Sixty seconds without a single byte means the connection is dead: reconnect.
Errors are listed in Errors.