Custom locations

List or search locations

GET
/custom/layers/{layer}/locations

Lists the points of a location layer in id order, or finds the ones near a point. Filters combine with AND:

  • lookup_key: exact match. bbox: inside west,south,east,north. meta[key]=value: metadata contains the member (repeatable, at most 10).
  • lat + lon with radius (meters, 1 to 500,000): points within the radius, nearest first, paged with next_cursor.
  • lat + lon with nearest (1 to 1,000): the N closest points, exactly ranked, in one page (next_cursor is null). max_distance (meters) bounds it.
  • lat + lon need radius or nearest; radius and nearest cannot be combined.

Radius and nearest results carry distance_m on each feature. A zone layer or cell layer is 404 (Unknown location layer).

This is our own API, not Geoapify-compatible. Every request costs 1 rivet.

Authorization

queryapiKey<token>

Your API key from the dashboard, sent as ?apiKey=<key>.

Path Parameters

layer*string

Layer slug: lowercase letters, digits and underscores, 2 to 40 characters (^[a-z0-9_]{2,40}$).

Match^[a-z0-9_]{2,40}$

Query Parameters

lookup_key?string

Exact Lookup Key.

bbox?string

west,south,east,north.

meta[key]?string

Metadata filter, written meta[region]=central. Repeatable, at most 10.

lat?number

Latitude of the query point. Needs lon and radius or nearest.

Range-90 <= value <= 90
lon?number

Longitude of the query point.

Range-180 <= value <= 180
radius?number

Search radius in meters.

Range1 <= value <= 500000
nearest?integer

Return the N closest points (one page).

Range1 <= value <= 1000
max_distance?number

With nearest, ignore points farther than this many meters.

Range1 <= value <= 500000
limit?integer

Page size.

Range1 <= value <= 1000
Default100
cursor?string

Opaque next_cursor from the previous page. Omit for the first page.

Response Body

A page of locations.

application/json
  1. response
type*unknown
features*array<>
next_cursor*|

Null on the last page, and always null for nearest (it returns one page).

Example Request
curl -X GET 'https://api.data.graphitelab.ai/v1/custom/layers/dead_zones/locations'
Example Response
{  "type": "FeatureCollection",  "features": [    {      "type": "Feature",      "properties": {        "place_id": "gp:layer:zz_docs_places:ab0baad7-d2c5-44bc-b1b1-e6ad71425299",        "boundary_type": "custom:zz_docs_places",        "name": "Demo store",        "lookup_key": "store-1",        "metadata": {          "region": "central"        },        "distance_m": 240.958,        "lon": -86.1581,        "lat": 39.7684,        "datasource": {          "sourcename": "The Graphite Lab",          "attribution": "© The Graphite Lab",          "raw": {            "layer": "zz_docs_places",            "revision": 4          }        }      },      "geometry": {        "type": "Point",        "coordinates": [          -86.1581,          39.7684        ]      }    },    {      "type": "Feature",      "properties": {        "place_id": "gp:layer:zz_docs_places:534fa417-6bfd-47f5-82c0-6b3fbac6890d",        "boundary_type": "custom:zz_docs_places",        "name": "Second store (moved)",        "lookup_key": "store-2",        "metadata": {          "region": "north"        },        "distance_m": 3745.681,        "lon": -86.14,        "lat": 39.8,        "datasource": {          "sourcename": "The Graphite Lab",          "attribution": "© The Graphite Lab",          "raw": {            "layer": "zz_docs_places",            "revision": 4          }        }      },      "geometry": {        "type": "Point",        "coordinates": [          -86.14,          39.8        ]      }    }  ],  "next_cursor": null}