oslew docs
Console
Menu

MaritimeplatformoperationId vessels

GET/v1/vessels

Each vessel's latest AIS position in a cell around a point during a time range.

Send Authorization: Bearer sk_live_…. The key's plan must include theplatform product; which plans do.

Explained in Vessels and tracks.

Example

Vessels off San Diego in one hour.

curl
curl -G "https://api.oslew.com/v1/vessels" \
  -H "Authorization: Bearer $GEO_API_KEY" \
  --data-urlencode 'at=32.70,-117.20' \
  --data-urlencode 'level=8' \
  --data-urlencode 'from=1735603200' \
  --data-urlencode 'to=1735606800' \
  --data-urlencode 'limit=5'
Python
from oslew import Client

# The key is read from GEO_API_KEY.
client = Client(base_url="https://api.oslew.com")

answer = client.vessels(
    "32.70,-117.20",
    level=8,
    from_=1735603200,
    to=1735606800,
    limit=5,
)
TypeScript
import { Client } from "@oslew/client";

// The key is read from GEO_API_KEY.
const client = new Client({ baseUrl: "https://api.oslew.com" });

const answer = await client.vessels("32.70,-117.20", { level: 8, from: 1735603200, to: 1735606800, limit: 5 });
Response
HTTP/1.1 200 OK
content-type: application/json
ratelimit-limit: 100
ratelimit-remaining: 293
ratelimit-reset: 1

{
  "at": [
    32.7,
    -117.2
  ],
  "cell": 9286052995731030016,
  "level": 8,
  "from": 1735603200,
  "to": 1735606800,
  "results": [
    {
      "vessel": 338049016,
      "time": 1735606800,
      "lat": 32.71115,
      "lon": -117.23313,
      "sog": 0,
      "cog": 2342,
      "heading": 511,
      "status": 15
    },
    {
      "vessel": 366675760,
      "time": 1735606800,
      "lat": 32.71775,
      "lon": -117.22619,
      "sog": 0,
      "cog": 2316,
      "heading": 511,
      "status": 0
    },
    {
      "vessel": 368115570,
      "time": 1735606800,
      "lat": 32.71403,
      "lon": -117.22998,
      "sog": 0,
      "cog": 3600,
      "heading": 511,
      "status": 15
    },
    {
      "vessel": 338012437,
      "time": 1735606799,
      "lat": 32.72632,
      "lon": -117.19059,
      "sog": 0,
      "cog": 3600,
      "heading": 511,
      "status": 15
    },
    {
      "vessel": 368235810,
      "time": 1735606799,
      "lat": 32.727,
      "lon": -117.2022,
      "sog": 0,
      "cog": 419,
      "heading": 275,
      "status": 15
    }
  ],
  "provenance": {
    "name": "noaa-ais",
    "release": "2024-12-31",
    "license": "public domain (US Government work)"
  },
  "took_us": 1362
}

A real response, captured from the service at commit b8f4bde-dirty. Timing fields such as took_us differ on every call.

Query

NameTypeDescription
at
queryrequired
string
lat,lon.
level
query
integer
≥ 2, ≤ 16
default 8
Cell level around the point; 8 is ~40 km.
from
query
integer
Unix seconds; the layer's start when absent.
to
query
integer
Unix seconds; the layer's end when absent.
limit
query
integer
≤ 5000
default 100

Responses

200 — Latest first.

  • atnumber[]required
  • cellintegerrequired
  • fromintegerrequired
  • levelintegerrequired
  • provenanceSource | nullrequired
    • licensestringrequired
    • namestringrequired
    • releasestringrequired
  • resultsPosition[]required
    • cogintegerrequired
      Tenths of a degree; 65535 unknown.
    • headingintegerrequired
      Degrees; 511 or 65535 unknown.
    • latnumberrequired
    • lonnumberrequired
    • sogintegerrequired
      Tenths of a knot; 65535 unknown.
    • statusintegerrequired
      AIS navigational status 0–15; 15 unknown.
    • timeintegerrequired
      Unix seconds.
    • vesselintegerrequired
      MMSI.
  • tointegerrequired
  • took_usintegerrequired

With RateLimit-Limit, RateLimit-Remaining and RateLimit-Reset(and their X-RateLimit-* aliases); see rate limits.

Refusals

Every refusal is a JSON object with an error string, except where noted.

400Bad request.
401No key, or one that is unknown, revoked or suspended.
403The key's plan does not include this route's product, or the request is larger than the plan allows. The body names the plan that does.
429This product's bucket is empty: the key is going faster than its plan's sustained rate. Wait Retry-After seconds; nothing is used up. Carries Retry-After.
503The pod cannot reach the control plane and its entitlements are too old to trust. Retry.

A malformed query string or JSON body is refused by the framework before this route runs, in plain text rather than JSON; see errors.

Rendered from the OpenAPI document at commit b8f4bde-dirty; the same document is served at/v1/openapi.json and generates both clients.