Custom locations

Search locations with a JSON body

POST
/custom/layers/{layer}/locations/search

The same search as GET /custom/layers/{layer}/locations, for filters too long for a URL. meta is an object ({"region": "central"}) instead of meta[key] parameters. Body limit 128 KB.

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}$

Request Body

application/json
  1. body

Same parameters as GET .../locations, as a JSON body. lat and lon need radius or nearest.

lookup_key?string
bbox?array<number>
Items4 <= items <= 4
meta?

Up to 10 members; each must be contained in the item's metadata.

lat?number
lon?number
radius?number

Meters.

Range1 <= value <= 500000
nearest?integer
Range1 <= value <= 1000
max_distance?number

Meters; with nearest.

Range1 <= value <= 500000
limit?integer
Range1 <= value <= 1000
Default100
cursor?string

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 POST 'https://api.data.graphitelab.ai/v1/custom/layers/dead_zones/locations/search' \  -H 'Content-Type: application/json' \  -d '{}'
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        ]      }    }  ],  "next_cursor": null}