Skip to content

Observations#

The log of facts reported by feeds, from which entity state is derived.

The observation object#

Attributes#

idobservation IDrequired
objectstringrequired
Always observation.
entityentity IDrequired
type:key. The key is stable for the life of the entity.
feedfeed IDrequired
kindenumrequired
One of position, status, schedule, allocation, weather, detection.
observed_attimestamprequired
When the source says the fact was true.
received_attimestamprequired
When SurfaceLens admitted it.
revisionintegerrequired
The airport revision that admitted it.
source_idstringrequired
The record ID assigned by the source.
dataobjectrequired
The mapped facts
recordobject
The raw record and mapping version. Returned only when retrieving a single observation.
Child attributes
mapping_versioninteger
bodyobject

Observation object

{
  "id": "obs_2Rn8Wd4yF6pe",
  "object": "observation",
  "entity": "aircraft:8851a4",
  "feed": "feed_51d0a9e6f2",
  "kind": "allocation",
  "observed_at": "2026-11-23T01:36:12Z",
  "received_at": "2026-11-23T01:36:12.284Z",
  "revision": 47960115,
  "source_id": "RMS-20261123-C2-0412",
  "data": {
    "stand": "stand:C2",
    "on_block_at": "2026-11-23T01:36:12Z"
  },
  "record": {
    "mapping_version": 4,
    "body": {
      "AllocId": "RMS-20261123-C2-0412",
      "Stand": "C2",
      "Reg": "HS-THB",
      "Event": "ONBLK",
      "Time": "2026-11-23T08:36:12+07:00"
    }
  }
}

List observations#

GET/v1/airports/{airport}/observations

Returns observations whose observed_at falls in [from, to), oldest first. The window may span at most 24 hours. Filter by entity, feed or kind.

Requires observations:read.Preview 1

Path parameters#

airportICAO coderequired
The airport's ICAO code.

Query parameters#

fromtimestamprequired
Inclusive start of the window, RFC 3339 in UTC.
totimestamprequired
Exclusive end of the window, at most 24 hours after from.
entityentity ID
Only observations about this entity.
feedfeed ID
Only observations from this feed.
kindcomma-separated enums
Comma-separated observation kinds. Values: position, status, schedule, allocation, weather, detection.
known_attimestamp
Read only what had been received by this instant. Omit to use everything received so far, including late and corrected observations.
limitinteger
Page size, from 1 to 500. Default 100.
cursorstring
The next_cursor from the previous page. Other parameters must not change between pages. Cursors expire after one hour.

Response#

200 A page of observations. data holds observation objects.

objectstringrequired
Always list.
airportICAO coderequired
An ICAO airport code.
dataarray of objectsrequired
Child attributes
idobservation IDrequired
objectstringrequired
Always observation.
entityentity IDrequired
type:key. The key is stable for the life of the entity.
feedfeed IDrequired
kindenumrequired
One of position, status, schedule, allocation, weather, detection.
observed_attimestamprequired
When the source says the fact was true.
received_attimestamprequired
When SurfaceLens admitted it.
revisionintegerrequired
The airport revision that admitted it.
source_idstringrequired
The record ID assigned by the source.
dataobjectrequired
The mapped facts
recordobject
The raw record and mapping version. Returned only when retrieving a single observation.
Child attributes
mapping_versioninteger
bodyobject

next_cursorstring | nullrequired
Pass as cursor to fetch the next page. Null on the last page.
curl -G https://api.surfacelens.app/v1/airports/VTBS/observations \
  -H "Authorization: Bearer $SURFACELENS_KEY" \
  -d entity=aircraft:8851a4 \
  -d kind=position \
  -d from=2026-11-23T02:58:00Z \
  -d to=2026-11-23T02:59:00Z \
  -d limit=2
const res = await fetch("https://api.surfacelens.app/v1/airports/VTBS/observations?entity=aircraft:8851a4&kind=position&from=2026-11-23T02:58:00Z&to=2026-11-23T02:59:00Z&limit=2", {
  headers: { Authorization: `Bearer ${process.env.SURFACELENS_KEY}` },
});
if (!res.ok) throw new Error(`${res.status} ${await res.text()}`);
const page = await res.json();
import httpx, os

res = httpx.get(
    "https://api.surfacelens.app/v1/airports/VTBS/observations",
    params={
        "entity": "aircraft:8851a4",
        "kind": "position",
        "from": "2026-11-23T02:58:00Z",
        "to": "2026-11-23T02:59:00Z",
        "limit": "2",
    },
    headers={"Authorization": f"Bearer {os.environ['SURFACELENS_KEY']}"},
)
res.raise_for_status()
page = res.json()

Response200

{
  "object": "list",
  "airport": "VTBS",
  "data": [
    {
      "id": "obs_3Vn6Hy1cP8ta",
      "object": "observation",
      "entity": "aircraft:8851a4",
      "feed": "feed_2c9f7d1e4a",
      "kind": "position",
      "observed_at": "2026-11-23T02:58:00.400Z",
      "received_at": "2026-11-23T02:58:00.712Z",
      "revision": 48211902,
      "source_id": "8851a4-1763866680400",
      "data": {
        "lat": 13.69212,
        "lon": 100.75391,
        "heading_deg": 312,
        "ground_speed_kt": 0,
        "on_ground": true
      }
    },
    {
      "id": "obs_6Qa9Lw3rJ2vb",
      "object": "observation",
      "entity": "aircraft:8851a4",
      "feed": "feed_2c9f7d1e4a",
      "kind": "position",
      "observed_at": "2026-11-23T02:58:05.400Z",
      "received_at": "2026-11-23T02:58:05.689Z",
      "revision": 48211957,
      "source_id": "8851a4-1763866685400",
      "data": {
        "lat": 13.69212,
        "lon": 100.75391,
        "heading_deg": 312,
        "ground_speed_kt": 0,
        "on_ground": true
      }
    }
  ],
  "next_cursor": "c_bc9f2e7a41d03b6e"
}

Retrieve an observation#

GET/v1/airports/{airport}/observations/{observation}

Returns one observation, including the raw record it was mapped from. Use it to trace an attribute back to its source through provenance.

Requires observations:read.Preview 1

Path parameters#

airportICAO coderequired
The airport's ICAO code.
observationobservation IDrequired
The observation ID.

Response#

200 The observation. Returns observation object.

curl https://api.surfacelens.app/v1/airports/VTBS/observations/obs_2Rn8Wd4yF6pe \
  -H "Authorization: Bearer $SURFACELENS_KEY"
const res = await fetch("https://api.surfacelens.app/v1/airports/VTBS/observations/obs_2Rn8Wd4yF6pe", {
  headers: { Authorization: `Bearer ${process.env.SURFACELENS_KEY}` },
});
if (!res.ok) throw new Error(`${res.status} ${await res.text()}`);
const observation = await res.json();
import httpx, os

res = httpx.get(
    "https://api.surfacelens.app/v1/airports/VTBS/observations/obs_2Rn8Wd4yF6pe",
    headers={"Authorization": f"Bearer {os.environ['SURFACELENS_KEY']}"},
)
res.raise_for_status()
observation = res.json()

Response200

{
  "id": "obs_2Rn8Wd4yF6pe",
  "object": "observation",
  "entity": "aircraft:8851a4",
  "feed": "feed_51d0a9e6f2",
  "kind": "allocation",
  "observed_at": "2026-11-23T01:36:12Z",
  "received_at": "2026-11-23T01:36:12.284Z",
  "revision": 47960115,
  "source_id": "RMS-20261123-C2-0412",
  "data": {
    "stand": "stand:C2",
    "on_block_at": "2026-11-23T01:36:12Z"
  },
  "record": {
    "mapping_version": 4,
    "body": {
      "AllocId": "RMS-20261123-C2-0412",
      "Stand": "C2",
      "Reg": "HS-THB",
      "Event": "ONBLK",
      "Time": "2026-11-23T08:36:12+07:00"
    }
  }
}