Autocomplete
Returns address and place suggestions for partially typed text, limited to the US and Canada.
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.
apiKey<token>Your API key from the dashboard, sent as ?apiKey=<key>.
text*stringPartial address or place name to autocomplete.
1 <= length <= 1024type?stringRequested 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.
"country""state""city""postcode""street""amenity"lang?stringResult 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.
"en""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?integerMaximum number of results (1 to 100). Default 5.
1 <= value <= 1005countrycodes?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.
0 <= items <= 10filter?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?stringResponse serialization: geojson (application/geo+json), json (application/json) or xml (application/xml).
"geojson""json""geojson""xml"Autocomplete suggestions, in the format requested by format. An empty list is returned when nothing matches.
- response
type*unknownfeatures*array<>query?Echo of the request. Autocomplete returns only text (no parsed block).
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'{ "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" }}Full schema: API reference
GET /v1/geocode/autocomplete returns ranked suggestions for a partial address or place name. Use it behind a search box while the user is still typing; use forward geocoding once you have a complete address and want the best single match.
How it works
One Engine answers: Photon, the fuzzy prefix-search engine, imported from our Nominatim database. There is no Geocoding Waterfall here.
- The gateway sends your
textto Photon, asking for up to three timeslimitcandidates (capped at 100).lang(en, de, fr, it only),type(as a Photon layer),biasproximity and thefilterbounding box are passed along. - Candidates are filtered to the requested countries (default
us,ca), then bytype,filterand duplicates. - Each result gets a
rank.confidence: the share of the typed text covered by the result's address line. If you passbias, results are re-sorted by confidence plus a bias bonus. - The list is cut to
limit, and each result gets itsdatasource(see below).
Address Points (house-level addresses from NAD, StatCan NAR and Overture) are injected into the Photon index. Those results have result_type: building and gp:addr:canonical:<id> Place IDs. Everything else comes from OpenStreetMap and has gp:osm:... Place IDs.
Quick start
curl -s "https://api.data.graphitelab.ai/v1/geocode/autocomplete?text=350+5th+ave+new+y&limit=3&apiKey=$GRAPHITE_API_KEY"Trimmed response (GeoJSON, the default):
{
"type": "FeatureCollection",
"features": [
{
"type": "Feature",
"properties": {
"name": "WSKQ-FM (New York)",
"country_code": "us",
"state_code": "NY",
"city": "New York",
"postcode": "10118",
"street": "5th Avenue",
"housenumber": "350",
"lon": -73.9856942,
"lat": 40.7484273,
"formatted": "350 5th Avenue, New York, NY 10118, United States",
"result_type": "building",
"datasource": {
"sourcename": "openstreetmap",
"attribution": "© OpenStreetMap contributors",
"license": "Open Database License"
},
"rank": { "confidence": 0.85, "match_type": "full_match" },
"place_id": "gp:osm:n357606907"
},
"geometry": { "type": "Point", "coordinates": [-73.9856942, 40.7484273] }
}
],
"query": { "text": "350 5th ave new y" }
}Parameters
| Name | Type | Required | What it does |
|---|---|---|---|
text | string (1 to 1024 chars) | yes | Partial address or place name to autocomplete. |
type | enum: country, state, city, postcode, street, amenity | no | Requested location type. country, state, city and street also constrain the Photon layer; postcode and amenity filter after the search. |
lang | ISO 639-1 code, default en | no | Result language. Only en, de, fr and it change the result; other values act as the default. |
limit | integer 1 to 100, default 5 | no | Maximum number of results. |
countrycodes | array of ISO 3166-1 alpha-2 codes (up to 10) | no | Country filter. Default us,ca; other codes return no results. |
filter | array of strings | no | Hard filters as 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>. |
bias | array of strings | no | Ranking bias without excluding matches. Kinds: proximity:lon,lat, rect:..., circle:lon,lat,radiusMeters, countrycode:us. |
format | json, geojson or xml, default geojson | no | Response serialization. |
Response
Each result is a GeoJSON Feature (or an entry in results with format=json). The fields that matter most:
| Field | Meaning |
|---|---|
place_id | Gateway Place ID. gp:osm:<n|w|r><id> for OpenStreetMap objects, gp:addr:canonical:<id> for Address Points. Stable across Data Releases while the thing exists. |
result_type | building, street, city, and so on. House-level hits are building. |
datasource | Where the result came from. OSM results carry "© OpenStreetMap contributors" and the ODbL license. Address Point results list their sources (NAD, NAR, Overture) and each license's attribution. |
rank.confidence (and the _city_level, _street_level, _building_level variants) | Share of the typed text covered by the result, 0 to 1. The building-level value is 0 for non-building results. |
rank.match_type | For example full_match (a building covering at least 80% of the text), match_by_street, match_by_city_or_disrict (spelled as in Geoapify). |
bbox | Present on streets, cities and other area results. |
query.text | Echo of your text. |
rank.importance and rank.popularity are not returned. Fields beyond the response schema (timezone, plus codes, categories) are not returned either.
Differences from Geoapify
-
approximated:
rank.confidence*is the share of the typed text covered by the result.importanceandpopularityare not returned. -
approximated:
langonly changes results foren,de,frandit; other accepted values behave as the default. -
approximated:
countrycodesonly has data forusandca; other codes return empty results. -
extra:
filter=place:<id>takes a gateway Place ID (gp:osm:<n|w|r><id>, per ADR 0006), not a Geoapify place id, and filters to that OSM object's bounding box. -
unsupported:
type=localityis rejected with 400.
US and Canada notes
-
Results are limited to the United States and Canada. The default
countrycodesisus,ca. -
Canadian results include province names and codes (
state,state_code) and full six-character postal codes where the source has them. Uselang=frfor French street and place names, for example "Rue Sainte-Catherine Est" in Montréal. -
House-level suggestions come from Address Points: NAD in the US, StatCan NAR in Canada, plus Overture. Without a matching Address Point, a house number can still come from OpenStreetMap, as in the quick start.
-
Address Point casing is echoed from the source, so you may see all-caps street names such as
PENNSYLVANIA Avenue Northwest.
More examples
French street prefix in Montréal with lang=fr.
curl -s "https://api.data.graphitelab.ai/v1/geocode/autocomplete?text=rue+sainte-catherine+montr&lang=fr&limit=3&apiKey=$GRAPHITE_API_KEY"Errors and limits
| Status | Meaning |
|---|---|
| 400 | Missing or invalid parameters (no text, text over 1024 characters, type=locality, malformed filter or bias, a place: ID that is not gp:osm:... or not found). |
| 401 | Missing or invalid API key. |
| 500 | Unexpected gateway error. |
| 503 | The Autocomplete Engine (Photon) is unavailable. |
Limits: text up to 1024 characters, limit 1 to 100 (default 5), countrycodes up to 10 values. The gateway waits up to 8 seconds for Photon.
Known issues from the Phase 18 live checks: Address Point casing is echoed from the source (for example PENNSYLVANIA Avenue Northwest), and cold Engines right after a deploy can show latency outliers of 6 to 13 seconds. The gp:addr:canonical Place ID path for autocomplete is documented from the code; it was not hit live.
Try in Playground (signed in to your Graphite Lab organization). Signed out, use the paste-your-key widget on the reference page.