Observations#
The log of facts reported by feeds, from which entity state is derived.
The observation object#
Attributes#
idobservation IDrequiredobjectstringrequired- Always
observation. entityentity IDrequiredtype:key. The key is stable for the life of the entity.feedfeed IDrequiredkindenumrequired- 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_versionintegerbodyobject
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.
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_cursorfrom 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 IDrequiredobjectstringrequired- Always
observation. entityentity IDrequiredtype:key. The key is stable for the life of the entity.feedfeed IDrequiredkindenumrequired- 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_versionintegerbodyobject
next_cursorstring | nullrequiredcursor to fetch the next page. Null on the last page.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.
Path parameters#
airportICAO coderequired- The airport's ICAO code.
observationobservation IDrequired- The observation ID.
Response#
200 The observation. Returns observation object.
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"
}
}
}