Geocoding

Autocomplete an address

Signed in? Open this endpoint in the dashboard playground, which uses your organization automatically. Signed out, use Try in Playground below with your API key.

GET
/geocode/autocomplete

Returns address and place suggestions for partial text, served by Photon. Address Points are injected into Photon, so house-level results (result_type: building) come with gp:addr:canonical:<id> Place IDs and Address Point datasource entries; everything else is OSM-derived (gp:osm:...). Results are limited to the US and Canada.

  • text is required and may contain a partial address or place name.
  • filter restricts results; bias influences ranking without excluding matches.
  • Use limit to control the number of returned suggestions (default 5).

Example: GET /geocode/autocomplete?text=350 5th ave new y&apiKey=YOUR_API_KEY

Deviation (approximated): rank.confidence* is the share of the typed text covered by the result; rank.importance/rank.popularity are not returned.

Deviation (extra): filter=place:gp:osm:<n|w|r><id> takes a gateway Place ID (ADR 0006), not a Geoapify place id; it filters to that OSM object's bounding box.

Not supported: type=locality is rejected with 400 (the gateway accepts country, state, city, postcode, street, amenity). Result fields beyond those in the response schema (timezone, plus codes, categories, etc.) are not returned.

Authorization

queryapiKey<token>

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

Query Parameters

text*string

Partial address or place name to autocomplete.

Length1 <= length <= 1024
type?string

Requested location type. Values country, state, city and street also constrain the Photon layer; postcode and amenity filter results after the search.

Not supported: locality (accepted by Geoapify) is rejected with 400.

Value in"country""state""city""postcode""street""amenity"
lang?string

Result language (ISO 639-1; case-insensitive). Default en.

Deviation (approximated): only en, de, fr and it change the result language (Photon); every other accepted value is treated as the default.

Default"en"
Value in"ab""aa""af""ak""sq""am""ar""an""hy""as""av""ae""ay""az""bm""ba""eu""be""bn""bh""bi""bs""br""bg""my""ca""ch""ce""ny""zh""cv""kw""co""cr""hr""cs""da""dv""nl""en""eo""et""ee""fo""fj""fi""fr""ff""gl""ka""de""el""gn""gu""ht""ha""he""hz""hi""ho""hu""ia""id""ie""ga""ig""ik""io""is""it""iu""ja""jv""kl""kn""kr""ks""kk""km""ki""rw""ky""kv""kg""ko""ku""kj""la""lb""lg""li""ln""lo""lt""lu""lv""gv""mk""mg""ms""ml""mt""mi""mr""mh""mn""na""nv""nb""nd""ne""ng""nn""no""ii""nr""oc""oj""cu""om""or""os""pa""pi""fa""pl""ps""pt""qu""rm""rn""ro""ru""sa""sc""sd""se""sm""sg""sr""gd""sn""si""sk""sl""so""st""es""su""sw""ss""sv""ta""te""tg""th""ti""bo""tk""tl""tn""to""tr""ts""tt""tw""ty""ug""uk""ur""uz""ve""vi""vo""wa""cy""wo""fy""xh""yi""yo""za"
limit?integer

Maximum number of results (1 to 100). Default 5.

Range1 <= value <= 100
Default5
countrycodes?array<>

ISO 3166-1 alpha-2 country filter (lower-case, up to 10; repeat the parameter or comma-separate).

Deviation (approximated): the service holds only US and Canada data, so other codes return no results. Default is us,ca.

Items0 <= items <= 10
filter?array<>

Hard result filters, kind:value joined with | or repeated. Kinds: rect:lon1,lat1,lon2,lat2, circle:lon,lat,radiusMeters, countrycode:us,ca (or none/auto), place:<gp:osm Place ID>.

Deviation (extra): place: takes a gp:osm:<n|w|r><id> Place ID and uses its bounding box.

bias?array<>

Ranking bias, kind:value joined with | or repeated. Kinds: proximity:lon,lat, rect:..., circle:lon,lat,radiusMeters, countrycode:us. Proximity and circle centre are also passed to Photon.

format?string

Response serialization: geojson (application/geo+json), json (application/json) or xml (application/xml).

Default"geojson"
Value in"json""geojson""xml"

Response Body

Autocomplete suggestions, in the format requested by format. An empty list is returned when nothing matches.

  1. response
type*unknown
features*array<>
query?

Echo of the request. Autocomplete returns only text (no parsed block).

Example Request
curl -X GET 'https://api.data.graphitelab.ai/v1/geocode/autocomplete?text=350+5th+ave+new+y&type=city&lang=fr&limit=5&countrycodes=us&countrycodes=ca&filter=countrycode%3Aca&bias=proximity%3A-73.99%2C40.75&format=json'
Example Response
{  "results": [    {      "name": "string",      "country": "United States",      "country_code": "us",      "state": "New York",      "state_code": "NY",      "county": "string",      "city": "string",      "postcode": "string",      "street": "string",      "housenumber": "string",      "formatted": "string",      "address_line1": "string",      "address_line2": "string",      "lon": -180,      "lat": -90,      "result_type": "unknown",      "datasource": {        "sourcename": "openstreetmap",        "attribution": "© OpenStreetMap contributors",        "license": "Open Database License",        "url": "https://www.openstreetmap.org/copyright",        "sources": [          {            "sourcename": "string",            "attribution": "string",            "license": "string",            "url": "http://example.com"          }        ]      },      "rank": {        "confidence": 0.95,        "confidence_city_level": 0,        "confidence_street_level": 0,        "confidence_building_level": 0,        "match_type": "full_match"      },      "place_id": "gp:osm:n1234",      "bbox": {        "lon1": 0,        "lat1": 0,        "lon2": 0,        "lat2": 0      }    }  ],  "query": {    "text": "string"  }}