Partner observations#
Submit and read inspection reports and aircraft positions, and find aircraft near a point, under the draft observation gateway contract.
The partner observation object#
One report from a producer. kind decides which other fields it carries.
Attributes#
Suspected FOD
sourceObservationIdstringrequired- Your ID for the report. Keep it stable across retries and unique per producer and airport.
airportIcaoICAO coderequired- An ICAO airport code.
observedAttimestamprequired- When the reported observation happened. The gateway records when it admitted the report separately.
kindstringrequired- Always
suspected_fod. areaRefstringrequired- An agreed area reference. It carries no object coordinates.
evidenceOriginenumrequired- Source policy restricts which origins a producer may send. One of
Synthetic,PhysicalCapture.
Inspection clear
sourceObservationIdstringrequired- Your ID for the report. Keep it stable across retries and unique per producer and airport.
airportIcaoICAO coderequired- An ICAO airport code.
observedAttimestamprequired- When the reported observation happened. The gateway records when it admitted the report separately.
kindstringrequired- Always
inspection_clear. areaRefstringrequired- An agreed area reference. It carries no object coordinates.
evidenceOriginenumrequired- Source policy restricts which origins a producer may send. One of
Synthetic,PhysicalCapture.
Aircraft position
sourceObservationIdstringrequired- Your ID for the report. Keep it stable across retries and unique per producer and airport.
airportIcaoICAO coderequired- An ICAO airport code.
observedAttimestamprequired- When the reported observation happened. The gateway records when it admitted the report separately.
kindstringrequired- Always
aircraft_position. aircraftRefstringrequired- Your stable reference for the aircraft track, in your own namespace.
positionobjectrequired- The reported position, as WGS84
longitudeandlatitudein decimal degrees.Child attributes
longitudenumberrequiredlatitudenumberrequired
evidenceOriginenumrequired- Source policy restricts which origins a producer may send. One of
Synthetic,Telemetry.
Query observations#
GET/v1/observations
Returns the observations admitted for one airport whose reported observedAt
falls in [from, to). The window may span at most 24 hours. Rows are ordered by
observedAt, then recordId. Each row pairs the submitted report, with its time
normalized to milliseconds, with the recordId and admittedAt that the gateway
assigned when it first stored it. A window with no matches returns an empty
observations array.
Every page of one read uses the admission cutoff named by snapshotRef, so
reports admitted after it appear only in a new read. Pass nextCursor back as
cursor with the other parameters unchanged; it is null on the last page. The
gateway checks the key's authorization again on every page.
Query parameters#
airportIcaoICAO coderequired- The airport to read, within the key's authorized airports.
fromtimestamprequired- Inclusive lower bound on
observedAt. totimestamprequired- Exclusive upper bound on
observedAt, later thanfromand at most 24 hours after it. limitinteger- Page size, from 1 to 500. Default
100. cursorstring- The
nextCursorfrom the previous page. It is bound to the same query, key and admission cutoff.
Response#
200 A page of admitted observations.
worldClassenumrequired- One of
operational,simulation. snapshotRefstringrequired- The admission cutoff that every page of this read uses. It grants no access.
observationsarray of objectsrequired- Ordered by
observedAt, thenrecordId. Reports admitted after the cutoff are excluded.Child attributes
recordIdstringrequiredadmittedAttimestamprequired- When the gateway first admitted the record.
observationSuspected FOD | Inspection clear | Aircraft positionrequired- One report from a producer.
kinddecides which other fields it carries.Variants
Suspected FOD
sourceObservationIdstringrequired- Your ID for the report. Keep it stable across retries and unique per producer and airport.
airportIcaoICAO coderequired- An ICAO airport code.
observedAttimestamprequired- When the reported observation happened. The gateway records when it admitted the report separately.
kindstringrequired- Always
suspected_fod. areaRefstringrequired- An agreed area reference. It carries no object coordinates.
evidenceOriginenumrequired- Source policy restricts which origins a producer may send. One of
Synthetic,PhysicalCapture.
Inspection clear
sourceObservationIdstringrequired- Your ID for the report. Keep it stable across retries and unique per producer and airport.
airportIcaoICAO coderequired- An ICAO airport code.
observedAttimestamprequired- When the reported observation happened. The gateway records when it admitted the report separately.
kindstringrequired- Always
inspection_clear. areaRefstringrequired- An agreed area reference. It carries no object coordinates.
evidenceOriginenumrequired- Source policy restricts which origins a producer may send. One of
Synthetic,PhysicalCapture.
Aircraft position
sourceObservationIdstringrequired- Your ID for the report. Keep it stable across retries and unique per producer and airport.
airportIcaoICAO coderequired- An ICAO airport code.
observedAttimestamprequired- When the reported observation happened. The gateway records when it admitted the report separately.
kindstringrequired- Always
aircraft_position. aircraftRefstringrequired- Your stable reference for the aircraft track, in your own namespace.
positionobjectrequired- The reported position, as WGS84
longitudeandlatitudein decimal degrees. evidenceOriginenumrequired- Source policy restricts which origins a producer may send. One of
Synthetic,Telemetry.
nextCursorstring | nullrequired- Pass as
cursorfor the next page.nullon the last page.
const res = await fetch("https://api.surfacelens.app/v1/observations?airportIcao=VTBS&from=2026-11-23T02:50:00Z&to=2026-11-23T03:00:00Z&limit=2", {
headers: { Authorization: `Bearer ${process.env.SURFACELENS_KEY}` },
});
if (!res.ok) throw new Error(`${res.status} ${await res.text()}`);
const body = await res.json();
import httpx, os
res = httpx.get(
"https://api.surfacelens.app/v1/observations",
params={
"airportIcao": "VTBS",
"from": "2026-11-23T02:50:00Z",
"to": "2026-11-23T03:00:00Z",
"limit": "2",
},
headers={"Authorization": f"Bearer {os.environ['SURFACELENS_KEY']}"},
)
res.raise_for_status()
body = res.json()
Response200
{
"worldClass": "simulation",
"snapshotRef": "snap_2Fh9Vc6pL3wa",
"observations": [
{
"recordId": "rec_4Kp7Tz2wN9qd",
"admittedAt": "2026-11-23T02:58:40.218Z",
"observation": {
"sourceObservationId": "vtbs-insp-20261123-0412",
"airportIcao": "VTBS",
"observedAt": "2026-11-23T02:51:00.000Z",
"kind": "suspected_fod",
"areaRef": "apron-c-stand-c2",
"evidenceOrigin": "Synthetic"
}
},
{
"recordId": "rec_7Hd2Lx5vB8mf",
"admittedAt": "2026-11-23T02:58:40.218Z",
"observation": {
"sourceObservationId": "vtbs-insp-20261123-0413",
"airportIcao": "VTBS",
"observedAt": "2026-11-23T02:55:00.000Z",
"kind": "inspection_clear",
"areaRef": "apron-c-stand-c2",
"evidenceOrigin": "Synthetic"
}
}
],
"nextCursor": "gwc_5Tq8Rm1zK4ne"
}
Ingest observations#
POST/v1/observations
Submits 1 to 100 observations from one airport in at most 256 KiB of JSON. The key's authenticated context supplies the producer and the airports it may write to; neither goes in the body.
The batch is admitted atomically. results follows the request order: stored
is a newly admitted report and existing an identical resubmission, and both
carry the gateway's recordId for that report. The key of a report is its
producer, airport and sourceObservationId. Different content under the same key
returns 409 with the code observation_conflict, and a conflicting or invalid
batch admits nothing, so keep both the key and the content when you retry.
The partner observation operations follow the draft observation gateway
contract: field names are camelCase, and an error is a JSON object whose error
member holds a code and a message.
Request body#
observationsarray of Suspected FOD | Inspection clear | Aircraft positionrequired- Observations from one airport. Do not send a producer or world; the key supplies them.
Response#
200 The whole batch was admitted. One result per observation, in request order.
resultsarray of objectsrequired- One result per submitted observation, in request order.
Child attributes
sourceObservationIdstringrequiredrecordIdstringrequired- The gateway's ID for the admitted record. An exact retry returns the original ID.
dispositionenumrequiredstoredfor a newly admitted report,existingfor an identical resubmission. One ofstored,existing.
curl https://api.surfacelens.app/v1/observations \
-H "Authorization: Bearer $SURFACELENS_KEY" \
-H "Content-Type: application/json" \
-d '{
"observations": [
{
"sourceObservationId": "vtbs-insp-20261123-0412",
"airportIcao": "VTBS",
"observedAt": "2026-11-23T02:51:00Z",
"kind": "suspected_fod",
"areaRef": "apron-c-stand-c2",
"evidenceOrigin": "Synthetic"
},
{
"sourceObservationId": "vtbs-insp-20261123-0413",
"airportIcao": "VTBS",
"observedAt": "2026-11-23T02:55:00Z",
"kind": "inspection_clear",
"areaRef": "apron-c-stand-c2",
"evidenceOrigin": "Synthetic"
},
{
"sourceObservationId": "vtbs-adsb-8851a4-0258",
"airportIcao": "VTBS",
"observedAt": "2026-11-23T02:58:00.400Z",
"kind": "aircraft_position",
"aircraftRef": "8851a4",
"position": {
"longitude": 100.75391,
"latitude": 13.69212
},
"evidenceOrigin": "Synthetic"
}
]
}'
const res = await fetch("https://api.surfacelens.app/v1/observations", {
method: "POST",
headers: {
Authorization: `Bearer ${process.env.SURFACELENS_KEY}`,
"Content-Type": "application/json",
},
body: JSON.stringify({
observations: [
{
sourceObservationId: "vtbs-insp-20261123-0412",
airportIcao: "VTBS",
observedAt: "2026-11-23T02:51:00Z",
kind: "suspected_fod",
areaRef: "apron-c-stand-c2",
evidenceOrigin: "Synthetic",
},
{
sourceObservationId: "vtbs-insp-20261123-0413",
airportIcao: "VTBS",
observedAt: "2026-11-23T02:55:00Z",
kind: "inspection_clear",
areaRef: "apron-c-stand-c2",
evidenceOrigin: "Synthetic",
},
{
sourceObservationId: "vtbs-adsb-8851a4-0258",
airportIcao: "VTBS",
observedAt: "2026-11-23T02:58:00.400Z",
kind: "aircraft_position",
aircraftRef: "8851a4",
position: {
longitude: 100.75391,
latitude: 13.69212,
},
evidenceOrigin: "Synthetic",
},
],
}),
});
if (!res.ok) throw new Error(`${res.status} ${await res.text()}`);
const body = await res.json();
import httpx, os
res = httpx.post(
"https://api.surfacelens.app/v1/observations",
headers={"Authorization": f"Bearer {os.environ['SURFACELENS_KEY']}"},
json={
"observations": [
{
"sourceObservationId": "vtbs-insp-20261123-0412",
"airportIcao": "VTBS",
"observedAt": "2026-11-23T02:51:00Z",
"kind": "suspected_fod",
"areaRef": "apron-c-stand-c2",
"evidenceOrigin": "Synthetic",
},
{
"sourceObservationId": "vtbs-insp-20261123-0413",
"airportIcao": "VTBS",
"observedAt": "2026-11-23T02:55:00Z",
"kind": "inspection_clear",
"areaRef": "apron-c-stand-c2",
"evidenceOrigin": "Synthetic",
},
{
"sourceObservationId": "vtbs-adsb-8851a4-0258",
"airportIcao": "VTBS",
"observedAt": "2026-11-23T02:58:00.400Z",
"kind": "aircraft_position",
"aircraftRef": "8851a4",
"position": {
"longitude": 100.75391,
"latitude": 13.69212,
},
"evidenceOrigin": "Synthetic",
},
],
},
)
res.raise_for_status()
body = res.json()
Response200
{
"results": [
{
"sourceObservationId": "vtbs-insp-20261123-0412",
"recordId": "rec_4Kp7Tz2wN9qd",
"disposition": "stored"
},
{
"sourceObservationId": "vtbs-insp-20261123-0413",
"recordId": "rec_7Hd2Lx5vB8mf",
"disposition": "stored"
},
{
"sourceObservationId": "vtbs-adsb-8851a4-0258",
"recordId": "rec_9Wc3Qn6yF1ta",
"disposition": "existing"
}
]
}
Find aircraft within a radius#
POST/v1/queries/aircraft-within
Returns the aircraft tracks whose latest position at asOf lies within radiusM
of centre. For each permitted source track, the gateway first takes the latest
position observed at or before asOf and no more than maxAgeMs earlier, then
applies the inclusive great-circle radius. A track that has since moved outside
the radius no longer counts. Separate sources can report the same aircraft as
separate tracks.
Pass the snapshotRef of an earlier read at the same airport to answer from the
same admitted data, or omit it to use the current cutoff. tracks is ordered by
distance. Use each recordId to match a track to an admitted observation. The
body may be at most 256 KiB.
Request body#
airportIcaoICAO coderequired- An ICAO airport code.
asOftimestamprequired- Inclusive cutoff on reported observation time, independent of the admission cutoff.
maxAgeMsintegerrequired- Only positions observed at most this many milliseconds before
asOfcount. centreobjectrequired- WGS84
longitudeandlatitudein decimal degrees.Child attributes
longitudenumberrequiredlatitudenumberrequired
radiusMnumberrequired- Inclusive great-circle radius, in metres.
snapshotRefstring- The admission cutoff of an earlier read at this airport. Omit to use the current cutoff.
Response#
200 The tracks within the radius.
worldClassenumrequired- One of
operational,simulation. snapshotRefstringrequiredasOftimestamprequired- UTC from 1970 onward, with up to millisecond precision.
countintegerrequired- The number of tracks returned. It depends on feed coverage and freshness at the cutoff.
tracksarray of objectsrequired- The latest qualifying position of each source track, nearest first.
Child attributes
recordIdstringrequiredaircraftRefstringrequiredobservedAttimestamprequired- UTC from 1970 onward, with up to millisecond precision.
positionobjectrequired-
Child attributes
longitudenumberrequiredlatitudenumberrequired
distanceMnumberrequired- Distance from
centre
curl https://api.surfacelens.app/v1/queries/aircraft-within \
-H "Authorization: Bearer $SURFACELENS_KEY" \
-H "Content-Type: application/json" \
-d '{
"airportIcao": "VTBS",
"asOf": "2026-11-23T02:58:41Z",
"maxAgeMs": 120000,
"centre": {
"longitude": 100.7539,
"latitude": 13.6921
},
"radiusM": 100,
"snapshotRef": "snap_2Fh9Vc6pL3wa"
}'
const res = await fetch("https://api.surfacelens.app/v1/queries/aircraft-within", {
method: "POST",
headers: {
Authorization: `Bearer ${process.env.SURFACELENS_KEY}`,
"Content-Type": "application/json",
},
body: JSON.stringify({
airportIcao: "VTBS",
asOf: "2026-11-23T02:58:41Z",
maxAgeMs: 120000,
centre: {
longitude: 100.7539,
latitude: 13.6921,
},
radiusM: 100,
snapshotRef: "snap_2Fh9Vc6pL3wa",
}),
});
if (!res.ok) throw new Error(`${res.status} ${await res.text()}`);
const body = await res.json();
import httpx, os
res = httpx.post(
"https://api.surfacelens.app/v1/queries/aircraft-within",
headers={"Authorization": f"Bearer {os.environ['SURFACELENS_KEY']}"},
json={
"airportIcao": "VTBS",
"asOf": "2026-11-23T02:58:41Z",
"maxAgeMs": 120000,
"centre": {
"longitude": 100.7539,
"latitude": 13.6921,
},
"radiusM": 100,
"snapshotRef": "snap_2Fh9Vc6pL3wa",
},
)
res.raise_for_status()
body = res.json()
Response200
{
"worldClass": "simulation",
"snapshotRef": "snap_2Fh9Vc6pL3wa",
"asOf": "2026-11-23T02:58:41.000Z",
"count": 1,
"tracks": [
{
"recordId": "rec_9Wc3Qn6yF1ta",
"aircraftRef": "8851a4",
"observedAt": "2026-11-23T02:58:00.400Z",
"position": {
"longitude": 100.75391,
"latitude": 13.69212
},
"distanceM": 2.47
}
]
}