API overview
Safecube exposes its maritime container tracking data through five REST APIs. Each API has its own base URL and its own version number, and every one of them is authenticated with the same Safecube API key, sent in the API_KEY header.
Available APIs
| API | What it does | Base URL | Version |
|---|---|---|---|
| Container Tracking | Track any container with a container, bill of lading or booking number, across more than 170 shipping lines, through a single endpoint. | https://api.sinay.ai/container-tracking/api/v2 | 2.8.0 |
| Webhooks | Receive webhook events on your own endpoints whenever new tracking data is available for your shipments, instead of polling the Container Tracking API. | https://api.sinay.ai/webhook/api/v1 | 1.2.1 |
| Shipment Management | Create, delete and search the shipments of your Safecube web application workspace. | https://api.sinay.ai/safecube/api/v1 | 1.0.0 |
| Ports Intelligence | Retrieve port details, berth occupation and the vessels currently in port. | https://api.sinay.ai/ports-intelligence/api/v1 | 1.0.0-beta |
| Congestion | Retrieve the congestion of a port, and follow your credit consumption. | https://api.sinay.ai/congestion/api/v1 | 1.1.1 |
Every Safecube API is served from the host api.sinay.ai, over HTTPS. An endpoint path documented in the reference is appended to the base URL of its API: the Container Tracking endpoint GET /shipment is called at https://api.sinay.ai/container-tracking/api/v2/shipment.
Versioning
Each Safecube API is versioned with a single major number, which is part of its base URL: v2 in /container-tracking/api/v2, v1 in /webhook/api/v1. New features can be added within the same major version as long as they introduce no breaking change, so an integration built against v2 keeps working when the Container Tracking API moves from 2.8.0 to a later 2.x release.
The full version number in the table — 2.8.0, 1.2.1 — identifies the release currently published. It is informative only: it never appears in the URL and a request cannot select it.
Authentication and limits
The same API key authenticates every Safecube API. It is sent in a header named API_KEY on every request, and it is available in the Safecube web application under Developers > API Credentials. The Ports Intelligence API additionally requires the key to be granted access to it.
Every API key is limited to 10 requests per 10 seconds. A request above that rate is answered with 429 Too Many Requests.
Sample request
The request below retrieves from the Container Tracking API the tracking data of ZZZZ0000000, a test shipment that costs nothing to query and returns a complete Le Havre to Rotterdam voyage. Replace $SAFECUBE_API_KEY with your API key.
curl "https://api.sinay.ai/container-tracking/api/v2/shipment?shipmentNumber=ZZZZ0000000&shipmentType=CT" \
-H "API_KEY: $SAFECUBE_API_KEY"