Structured Geocode API

Introduction

NextBillion.ai Structured Geocode API allows you to find places using a structured address look up. Users can specify the country, city, postal code, street and a house number for places they are searching for. The geocoding index will be queried for everything above the street level data and no POIs are returned in the response.

GET

https://api.nextbillion.io/geocode/structured?countryCode={countryCode}&key={your_api_key}

Request Parameters

Loading..

Response Schema

Loading..

Sample Request

1
curl --location 'https://api.nextbillion.io/geocode/structured?limit=1&countryCode=USA&state=California&city=San Francisco&street=Mullen Avenue&key=<your_api_key>'

Sample Response

1
{
2
"items": [
3
{
4
"title": "Mullen Avenue, San Francisco, CA 94110, United States",
5
"id": "2EmBgAmFpR9dg0D89EBzNA",
6
"address": {
7
"label": "Mullen Avenue, San Francisco, CA 94110, United States",
8
"countryCode": "USA",
9
"countryName": "United States",
10
"stateCode": "CA",
11
"state": "California",
12
"county": "San Francisco",
13
"city": "San Francisco",
14
"street": "Mullen Avenue",
15
"postalCode": "94110"
16
},
17
"scoring": {
18
"queryScore": 1,
19
"fieldScore": {
20
"state": 1,
21
"city": 1,
22
"streets": [
23
1
24
]
25
}
26
},
27
"position": {
28
"lat": 37.74635,
29
"lng": -122.40842
30
},
31
"access": [
32
{
33
"lat": 37.74635,
34
"lng": -122.40842
35
}
36
],
37
"mapView": {
38
"west": -122.41056,
39
"south": 37.74516,
40
"east": -122.40595,
41
"north": 37.74694
42
}
43
}
44
]
45
}

API Query Limits

NextBillion.ai allows a maximum rate limit of 2400 queries per minute or 40 queries/second for continuous requests.

API Error Codes

Response CodeDescriptionAdditional Notes
200

Normal success case.

Normal success case

400

Input validation failed.

There is a missing or an invalid parameter or a parameter with an invalid value type is added to the request.

401

APIKEY not supplied or invalid.

This error occurs when the wrong API key is passed in the request or the key is missing altogether

403

APIKEY is valid but does not have access to requested resources.

You might be querying for a geographical region which is not valid for your account, or requesting a service which is not enabled for you.

404

Requested host/path not found.

This error occurs when a malformed hostname is used.

422

Could not process the request.

Valid results could not be generated for the given parameters. Please modify the constraints/search query.

429

Too many requests.

QPM or API request count quota reached

500

Internal Service error.

There was an internal issue with NextBillion.ai services. You can reach out to [email protected] for an explanation.

© 2024 NextBillion.ai all rights reserved.