Autosuggest API

Introduction

This endpoint suggests address or place candidates based on an incomplete or misspelled query, from which the user selects the best query to submit.

The Autosuggest API provides comprehensive responses to free-form user queries by returning suggestions for:

  1. unknown places from a category or chain, such as "hospitals".

  2. unknown places at known locations, such as "London museums".

  3. known places with known names, such as "Times Square" or "Paris".

  4. known and unknown places for partial queries, such as "hosp", "London muse", "Times S" or "Par"

NOTE: The response may contain experimental elements not documented here. Any undocumented element is subject to removal at any time.

Request Parameters

Loading..

Response Schema

Loading..

Examples

Let’s search for a mis-spelled query looking for “aquariums” in the Boston city region.

Sample API Request

curl --location 'https://api.nextbillion.io/autosuggest?at=42.350133,-71.068900&key=<your_api_key>&limit=5&q=aqauriums'

Sample API Response

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
{
   "items": [
       {
           "title": "Aquarium Station",
           "id": "47_E4Ni11pElGqRAU6PTcQ",
           "address": {
               "label": "Aquarium Station, 183 State Street, Boston, MA 02109, United States",
               "countryCode": "USA",
               "countryName": "United States",
               "stateCode": "MA",
               "state": "Massachusetts",
               "county": "Suffolk",
               "city": "Boston",
               "street": "State Street",
               "postalCode": "02109-2600",
               "houseNumber": "183"
           },
           "scoring": {
               "queryScore": 0.98
           },
           "position": {
               "lat": 42.359258,
               "lng": -71.053041
           },
           "access": [
               {
                   "lat": 42.35941,
                   "lng": -71.05317
               },
               {
                   "lat": 42.35944,
                   "lng": -71.05299
               }
           ],
           "distance": 1651,
           "mapView": {
               "west": -71.05426,
               "south": 42.35836,
               "east": -71.05182,
               "north": 42.36016
           },
           "categories": [
               {
                   "id": "7380005",
                   "name": "railway station, metro",
                   "primary": true
               }
           ],
           "contacts": [
               {
                   "www": [
                       {
                           "value": "www.mbta.com"
                       }
                   ]
               }
           ]
       },
       {
           "title": "New England Aquarium",
           "id": "Ts9B7UN1-hbVIWrSOwpr9Q",
           "address": {
               "label": "New England Aquarium, 1 Central Wharf, Boston, MA 02110, United States",
               "countryCode": "USA",
               "countryName": "United States",
               "stateCode": "MA",
               "state": "Massachusetts",
               "county": "Suffolk",
               "city": "Boston",
               "street": "Central Wharf",
               "postalCode": "02110-3309",
               "houseNumber": "1"
           },
           "scoring": {
               "queryScore": 0.95
           },
           "position": {
               "lat": 42.359171,
               "lng": -71.049536
           },
           "access": [
               {
                   "lat": 42.35899,
                   "lng": -71.05067
               }
           ],
           "distance": 1881,
           "mapView": {
               "west": -71.05075,
               "south": 42.35827,
               "east": -71.04832,
               "north": 42.36007
           },
           "categories": [
               {
                   "id": "7317",
                   "name": "museum",
                   "primary": true
               }
           ],
           "contacts": [
               {
                   "phone": [
                       {
                           "value": "+1 617-973-5200"
                       }
                   ]
               }
           ]
       },
       {
           "title": "New England Aquarium Corporation",
           "id": "TUkbCLOpM0rMScHtwM8LdA",
           "address": {
               "label": "New England Aquarium Corporation, Central Wharf, Boston, MA 02110, United States",
               "countryCode": "USA",
               "countryName": "United States",
               "stateCode": "MA",
               "state": "Massachusetts",
               "county": "Suffolk",
               "city": "Boston",
               "street": "Central Wharf",
               "postalCode": "02110"
           },
           "scoring": {
               "queryScore": 0.91
           },
           "position": {
               "lat": 42.359059,
               "lng": -71.050393
           },
           "access": [
               {
                   "lat": 42.35897,
                   "lng": -71.05037
               }
           ],
           "distance": 1816,
           "mapView": {
               "west": -71.05161,
               "south": 42.35816,
               "east": -71.04918,
               "north": 42.35996
           },
           "categories": [
               {
                   "id": "9927004",
                   "name": "zoos, arboreta botanical garden, aquatic zoo marine park",
                   "primary": true
               }
           ],
           "contacts": [
               {
                   "phone": [
                       {
                           "value": "+1 617-573-9352"
                       }
                   ],
                   "www": [
                       {
                           "value": "www.neaq.org"
                       }
                   ]
               }
           ]
       },
       {
           "title": "Aquarium",
           "id": "3q7eeRuiA2diuKGM4A8HPg",
           "address": {
               "label": "Aquarium, State Street, Boston, MA 02110, United States",
               "countryCode": "USA",
               "countryName": "United States",
               "stateCode": "MA",
               "state": "Massachusetts",
               "county": "Suffolk",
               "city": "Boston",
               "street": "State Street",
               "postalCode": "02110"
           },
           "scoring": {
               "queryScore": 0.89
           },
           "position": {
               "lat": 42.359784,
               "lng": -71.051652
           },
           "access": [
               {
                   "lat": 42.35965,
                   "lng": -71.05163
               }
           ],
           "distance": 1777,
           "mapView": {
               "west": -71.05287,
               "south": 42.35888,
               "east": -71.05043,
               "north": 42.36068
           },
           "categories": [
               {
                   "id": "9942002",
                   "name": "public transport stop, bus stop",
                   "primary": true
               }
           ]
       },
       {
           "title": "Aquarium World",
           "id": "VibMZDqzu3wol7_ymL3o8g",
           "address": {
               "label": "Aquarium World, 281 Mount Auburn Street, Watertown, MA 02472, United States",
               "countryCode": "USA",
               "countryName": "United States",
               "stateCode": "MA",
               "state": "Massachusetts",
               "county": "Middlesex",
               "city": "Watertown",
               "street": "Mount Auburn Street",
               "postalCode": "02472-1955",
               "houseNumber": "281"
           },
           "scoring": {
               "queryScore": 0.69
           },
           "position": {
               "lat": 42.369498,
               "lng": -71.172359
           },
           "access": [
               {
                   "lat": 42.36967,
                   "lng": -71.17248
               }
           ],
           "distance": 8769,
           "mapView": {
               "west": -71.17358,
               "south": 42.3686,
               "east": -71.17114,
               "north": 42.3704
           },
           "categories": [
               {
                   "id": "9927004",
                   "name": "zoos, arboreta botanical garden, aquatic zoo marine park",
                   "primary": true
               }
           ],
           "contacts": [
               {
                   "phone": [
                       {
                           "value": "+1 617-600-3434"
                       }
                   ]
               }
           ]
       }
   ]
}

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
200Normal success case.

Normal success case

400Input validation failed.

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

401APIKEY not supplied or invalid.

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

403APIKEY 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.

404Requested host/path not found.

This error occurs when a malformed hostname is used.

422Could not process the request.

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

429Too many requests.

QPM or API request count quota reached

500Internal Service error.

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