Autocomplete API
Introduction
This endpoint completes the few entered keystrokes to the valid street address or administrative area to speed-up entering the address queries.
Request Parameters
Loading..Response Schema
Loading..Examples
Let’s look for places containing stat
word in their names in Oklahoma City region
Sample API Request
curl --location 'https://api.nextbillion.io/autocomplete?q=stat&at=35.476911,-97.487201&limit=5&in=countryCode:USA, MEX&key=<your_api_key>'
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
{ "items": [ { "title": "State Capitol", "id": "qN08rVNZIciFxFJeg3hgow", "address": { "label": "State Capitol, 2300 North Lincoln Boulevard, Oklahoma City, OK 73105, United States", "countryCode": "USA", "countryName": "United States", "stateCode": "OK", "state": "Oklahoma", "county": "Oklahoma", "city": "Oklahoma City", "street": "North Lincoln Boulevard", "postalCode": "73105-4805", "houseNumber": "2300" }, "scoring": { "queryScore": 1 }, "position": { "lat": 35.491815, "lng": -97.503339 }, "access": [ { "lat": 35.49114, "lng": -97.50331 }, { "lat": 35.49158, "lng": -97.50149 } ], "distance": 2209, "mapView": { "west": -97.50521, "south": 35.49029, "east": -97.50147, "north": 35.49334 }, "categories": [ { "id": "7376", "name": "important tourist attraction", "primary": true } ], "contacts": [ { "www": [ { "value": "www.okhouse.gov/Information/CapitolTours.aspx" } ] } ] }, { "title": "United States Postal Service", "id": "wFfRtLgHYeJfAoKawwoNKw", "address": { "label": "United States Postal Service, 701 North Kelley Avenue, Oklahoma City, OK 73117, United States", "countryCode": "USA", "countryName": "United States", "stateCode": "OK", "state": "Oklahoma", "county": "Oklahoma", "city": "Oklahoma City", "street": "North Kelley Avenue", "postalCode": "73117-1400", "houseNumber": "701" }, "scoring": { "queryScore": 0.99 }, "position": { "lat": 35.473932, "lng": -97.495284 }, "access": [ { "lat": 35.47393, "lng": -97.49517 } ], "distance": 803, "mapView": { "west": -97.49639, "south": 35.47303, "east": -97.49418, "north": 35.47483 }, "categories": [ { "id": "7324003", "name": "post office, local", "primary": true } ], "contacts": [ { "phone": [ { "value": "+1 405-236-0534" } ], "www": [ { "value": "www.usps.com" } ] } ] }, { "title": "Staton Drive, Oklahoma City, OK 73111, United States", "id": "hDHq2NbnFEtoP5otpkeQIA", "address": { "label": "Staton Drive, Oklahoma City, OK 73111, United States", "countryCode": "USA", "countryName": "United States", "stateCode": "OK", "state": "Oklahoma", "county": "Oklahoma", "city": "Oklahoma City", "street": "Staton Drive", "postalCode": "73111" }, "scoring": { "queryScore": 0.99 }, "position": { "lat": 35.510759, "lng": -97.489053 }, "access": [ { "lat": 35.510759, "lng": -97.489053 } ], "distance": 3767, "mapView": { "west": -97.48995, "south": 35.50959, "east": -97.48813, "north": 35.51154 } }, { "title": "Jeremy Henley - State Farm", "id": "U1yvkrTAXTeIhgXRPkagVQ", "address": { "label": "Jeremy Henley - State Farm, 114 Northwest 6th Street, Oklahoma City, OK 73102, United States", "countryCode": "USA", "countryName": "United States", "stateCode": "OK", "state": "Oklahoma", "county": "Oklahoma", "city": "Oklahoma City", "street": "Northwest 6th Street", "postalCode": "73102-6015", "houseNumber": "114" }, "scoring": { "queryScore": 0.96 }, "position": { "lat": 35.473743, "lng": -97.515228 }, "access": [ { "lat": 35.47399, "lng": -97.51512 }, { "lat": 35.47399, "lng": -97.51512 } ], "distance": 2562, "mapView": { "west": -97.51633, "south": 35.47284, "east": -97.51412, "north": 35.47464 }, "categories": [ { "id": "9352007", "name": "insurance, company", "primary": true } ], "contacts": [ { "phone": [ { "value": "+1 405-605-4466" } ], "www": [ { "value": "www.jeremyhenley.com" } ] } ] }, { "title": "Statesboro, GA, United States", "id": "a60FRgx3mffb2MWJWEcFUg", "address": { "label": "Statesboro, GA, United States", "countryCode": "USA", "countryName": "United States", "stateCode": "GA", "state": "Georgia", "county": "Bulloch", "city": "Statesboro" }, "scoring": { "queryScore": 0.95 }, "position": { "lat": 32.44877, "lng": -81.777753 }, "access": [ { "lat": 32.44877, "lng": -81.777753 } ], "distance": 1485645, "mapView": { "west": -81.97639, "south": 32.26011, "east": -81.52527, "north": 32.65335 } } ] }
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 Code | Description | Additional 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. |