Custom zones

List or look up zones

GET
/custom/layers/{layer}/zones

Lists the zones of a zone or cell layer, ordered by creation, one page at a time. Filters combine with AND:

  • lookup_key: exact match.
  • lat + lon (together): zones that cover the point. On a cell layer, the zones that contain the point's H3 cell (exact cell only).
  • bbox: zones whose box meets west,south,east,north.
  • meta[key]=value: metadata contains the member. Repeat for more (at most 20). Values parse as JSON (2100, true), else stay a string.

Zones carry a representative point unless geometry asks for more. Page with next_cursor. A location layer is 404 (use /locations).

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.

lat?number

Latitude of a point to cover. Needs lon.

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

Longitude of a point to cover. Needs lat.

Range-180 <= value <= 180
bbox?string

west,south,east,north.

meta[key]?string

Metadata filter, written meta[tier]=gold. Repeatable, at most 20.

limit?integer

Page size.

Range1 <= value <= 1000
Default100
cursor?string

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

geometry?string

How much geometry each zone carries: point (a representative point), geometry_1000, geometry_5000, geometry_10000 (simplified to about that many meters of tolerance) or full.

Value in"point""geometry_1000""geometry_5000""geometry_10000""full"

Response Body

A page of zones.

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

Pass as cursor for the next page; null on the last page.

Example Request
curl -X GET 'https://api.data.graphitelab.ai/v1/custom/layers/dead_zones/zones?bbox=-86.2%2C39.7%2C-86.1%2C39.8'
Example Response
{  "type": "FeatureCollection",  "features": [    {      "type": "Feature",      "properties": {        "place_id": "gp:layer:zz_docs_zones:f4e920c0-89e7-4bf7-a5de-bc42e7510af2",        "boundary_type": "custom:zz_docs_zones",        "name": "Downtown demo zone",        "lookup_key": "downtown",        "metadata": {          "tier": "gold",          "population": 12000        },        "lon": -86.16,        "lat": 39.769999999999996,        "datasource": {          "sourcename": "The Graphite Lab",          "attribution": "© The Graphite Lab",          "raw": {            "layer": "zz_docs_zones",            "revision": 5          }        }      },      "geometry": {        "type": "Point",        "coordinates": [          -86.16,          39.77        ]      },      "bbox": [        -86.17,        39.76,        -86.15,        39.78      ]    }  ],  "next_cursor": null}