Skip to main content

Documentation Index

Fetch the complete documentation index at: https://docs.vangrid.io/llms.txt

Use this file to discover all available pages before exploring further.

The spatial query endpoint returns current ground truth observations from Vangrid edge nodes within your specified area of interest (AOI). Use it to retrieve verified spatial intelligence on demand for any authorized geographic region.

Endpoint

POST https://api.vangrid.io/v1/spatial/query

Request

Headers

HeaderValue
AuthorizationBearer your-api-key
Content-Typeapplication/json

Body parameters

aoi
object
required
GeoJSON geometry defining the area of interest. Supports Point, Polygon, and MultiPolygon types. Maximum polygon area is 100 km².
min_ground_truth_score
number
Minimum ground truth confidence score (0.0–1.0). Observations below this threshold are excluded. Defaults to 0.5.
observation_types
array
Filter by observation type. Possible values: obstacle, occupancy, change, structure, vehicle, vegetation. If omitted, all types are returned.
max_age_seconds
integer
Maximum age of observations in seconds. Defaults to 60. Use 0 for observations captured within the last second only.
limit
integer
Maximum number of observations to return. Defaults to 100, maximum 1000.

Example request

curl -X POST https://api.vangrid.io/v1/spatial/query \
  -H "Authorization: Bearer your-api-key" \
  -H "Content-Type: application/json" \
  -d '{
    "aoi": {
      "type": "Polygon",
      "coordinates": [[
        [-122.4194, 37.7749],
        [-122.4094, 37.7749],
        [-122.4094, 37.7849],
        [-122.4194, 37.7849],
        [-122.4194, 37.7749]
      ]]
    },
    "min_ground_truth_score": 0.75,
    "observation_types": ["obstacle", "vehicle"],
    "max_age_seconds": 30,
    "limit": 50
  }'

Response

Response fields

query_id
string
Unique identifier for this query, useful for support requests.
node_count
integer
Number of edge nodes that contributed observations to this response.
observations
array
Array of ground truth observation objects.

Example response

{
  "query_id": "qry_9e2f1a7c",
  "node_count": 47,
  "observations": [
    {
      "observation_id": "obs_3b8d2f1a",
      "geometry": {
        "type": "Point",
        "coordinates": [-122.4150, 37.7800]
      },
      "observation_type": "vehicle",
      "ground_truth_score": 0.94,
      "timestamp": "2026-05-22T10:14:33.412Z",
      "provenance_hash": "sha256:a3f8e2c1b4d7f9e0a2b5c8d1e4f7a0b3c6d9e2f5",
      "node_count": 12
    }
  ]
}

Error responses

StatusError codeDescription
400invalid_geometryAOI is not valid GeoJSON
400aoi_too_largeAOI polygon exceeds 100 km²
401unauthorizedMissing or invalid API key
403region_not_authorizedAOI outside authorized regions
429rate_limit_exceededToo many requests