Skip to main content

Usage

Connection mode#

A connection to the streaming endpoint will result in an HTTP persistent connection.

Streaming mode#

The server will keep sending messages until the connection terminates.

curl -H "Authorization: Bearer <your_token>" "https://api.airsafe.spire.com/v2/events/stream?compression=none"

Note that while a single HTTP connection in streaming mode may persist for long periods without termination, code to support automatic reconnection using the last known position token is highly recommended for customer usage in production.

Query Parameters#

The following parameters can be specified to filter the stream on the server-side or to reduce the bandwidth requirements. All query parameters are optional, if not specified then all available data is sent to the stream.

Query ParametersTypeDescription
compressionstringCompression of the data.
gzip (default) GZip compression
none to disable compression
icao_addressstringComma separated list of ICAO addresses (6 hex characters)
tail_numberstringComma separated list of tail numbers
flight_idstringInternal unique id in UUID format
event_typestringEvent type created at the creation_time