Docs

Errors

Errors are RFC 9457 problem details with Content-Type: application/problem+json. Failed requests (4xx and 5xx) never use credits.

{
  "type": "https://aistrail.com/docs/errors#window-too-large",
  "title": "Window too large",
  "status": 400,
  "detail": "At raw resolution one query may span at most 24 hours; split the range or use a coarser resolution"
}

Branch on the HTTP status and title; show detail to humans. Some errors add retry_after_s (seconds to wait; Rate limited, Too many concurrent requests, Server busy and Live data unavailable also send a Retry-After header) or upgrade_url (a link to the plans; Out of credits also adds credits_remaining, credits_reset_at and pricing_url). The type is a link to the matching entry on this page, or about:blank.

Status codes and titles

400 Bad request

A parameter is missing or invalid, for example an area box larger than your plan allows or an IMO number where an MMSI is expected. The detail says which; fix the request and retry.

400 Window too large

The time range is longer than one query allows at this resolution (raw 24 h, 1m 7 days, 1h 366 days; port calls 366 days). Split the range or use a coarser resolution.

401 Unauthorized

The API key is missing or invalid. Send it as Authorization: Bearer ap_live_…

402 Out of credits

Your account has no credits left, so the request was not run and used nothing. Monthly credits renew at credits_reset_at; to continue now, buy a credit pack or upgrade on the Plan page of your dashboard (pricing_url). Do not retry before then. /v1/usage and the WebSocket stream keep working.

403 Plan limit

Your plan does not include this feature: area queries and the port call search across ports (/v1/port-calls) on Free, or the live endpoints and stream on Free and Starter (live data is part of Pro and Business).

403 HTTPS required

The request came over plain HTTP. The API accepts HTTPS only: send it to https://api.aistrail.com (plain HTTP GET and HEAD requests are redirected there; other methods and ws:// WebSocket connections are refused). It is not billed.

403 History limit

The requested range starts earlier than your plan's history depth: the last 7 days on Free, up to the last 12 months on Starter and Pro, and up to the last 24 months on Business. On those plans the response also carries enterprise_url: older data is offered through Enterprise on request, as a one-off file delivery, and the Coverage page lists the regions and periods.

404 Not found

The vessel or endpoint does not exist in the sources available to your plan. A private vessel, or an MMSI withdrawn at its owner's request, gets the same answer as a vessel never seen (see Private vessels).

405 Method not allowed

Data endpoints accept only GET.

413 Payload too large

The request body is too large.

429 Rate limited

Too many requests per second for your key's plan, or more than 5 per second from one IP address without a valid key. Wait for Retry-After seconds and retry.

429 Too many connections

Too many open WebSocket connections for your account (the live data stream): close one before you open another.

429 Too many concurrent requests

At most 2 requests per key are processed at a time. While your account has fewer than 100,000 credits left, at most 2 metered requests per account (all keys together) are processed at a time, and no request can use credits already held by the account's other requests still running. Wait for a response before sending the next request.

500 Internal error

Something failed on our side. It has been logged; retry later or contact us at [email protected].

503 Query timeout

The query took longer than the server limit and was stopped; it is not billed. Narrow the bounding box or time range, or use a coarser resolution.

503 Server busy

The server is busy; the request is not billed. Retry after Retry-After seconds.

503 Live data unavailable

The live view is starting, for example after a restart; the request is not billed. Retry after Retry-After seconds.

503 Port calls unavailable

Port calls are temporarily unavailable, for example while they are updated; the request is not billed. Retry after Retry-After seconds.

Private vessels

Pleasure craft, sailing vessels and Class B transponders without a valid IMO number are private vessels, and some MMSIs are withdrawn at their owner's request. The vessel and IMO lookups answer them with 404 Not found and the same detail as for a vessel never seen, so an error never reveals that a vessel is private; their tracks are empty pages. Access to private vessels is not offered on any plan at present: see Private vessels in the API reference.

Plain-text errors

Requests the HTTP server cannot parse (malformed, or with oversized headers or body) get a plain-text 400, 413 or 431 response instead of problem details.

Found a mistake, or something unclear? Suggest an edit and we will fix the page.