Skip to main content

Authentication

Our APIs use Bearer tokens to authenticate requests. Attempting to make requests to the API without a valid API Key will result in the return of an error message. See error details on Errors page.

In addition, to ensure transport layer security, all access or communication with the APIs must be made over HTTPS.

API endpoint#

The Spire Maritime 2.0 API can be accessed through this API endpoint:

https://api.spire.com/graphql

Then, you must describe the data you wish to access through a GraphQL query against the API. Sample queries can be found in the Getting Started Guide.

Authentication header#

All queries addressed to our API are using Bearer Authentication. All request should contain following header:

Authorization: Bearer <token>

Test Authentication#

curl \
--request POST \
--url https://api.spire.com/graphql \
--header "Content-Type: application/json" \
--header "Authorization: Bearer <insert-token>" \
--data '{ "query": "{ vessels(first: 1) { nodes { id staticData { name mmsi imo } lastPositionUpdate { timestamp latitude longitude collectionType } } } } " }'