Discover API

Introduction

This endpoint allows one to process a free-form text query for an address or place, and returns results in order of relevance.

Request Parameters

Loading..

Response Schema

Loading..

Examples

Lets create a basic discover request in San Francisco area

Sample API Request

https://api.nextbillion.io/discover?key=<your_api_key>&at=37.78182,-122.45291&q=gas&limit=5&in=countryCode:USA,MEX

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
{
   "items": [
       {
           "title": "Rc Gas",
           "id": "vVvq8TGB9Abonb1SYADenw",
           "address": {
               "label": "Rc Gas, 376 Castro Street, San Francisco, CA 94114, United States",
               "countryCode": "USA",
               "countryName": "United States",
               "stateCode": "CA",
               "state": "California",
               "county": "San Francisco",
               "city": "San Francisco",
               "street": "Castro Street",
               "postalCode": "94114-1524",
               "houseNumber": "376"
           },
           "scoring": {
               "queryScore": 0.9
           },
           "position": {
               "lat": 37.762951,
               "lng": -122.43554
           },
           "access": [
               {
                   "lat": 37.763,
                   "lng": -122.43521
               }
           ],
           "distance": 2594,
           "mapView": {
               "west": -122.43668,
               "south": 37.76205,
               "east": -122.4344,
               "north": 37.76385
           },
           "categories": [
               {
                   "id": "9150",
                   "name": "primary resource/utility",
                   "primary": true
               }
           ],
           "contacts": [
               {
                   "phone": [
                       {
                           "value": "+1 415-552-0103"
                       }
                   ]
               }
           ]
       },
       {
           "title": "Gas Light",
           "id": "E6Gri5mXYQ6Tgcr8o0D_nA",
           "address": {
               "label": "Gas Light, 3640 Buchanan Street, San Francisco, CA 94123, United States",
               "countryCode": "USA",
               "countryName": "United States",
               "stateCode": "CA",
               "state": "California",
               "county": "San Francisco",
               "city": "San Francisco",
               "street": "Buchanan Street",
               "postalCode": "94123-1709",
               "houseNumber": "3640"
           },
           "scoring": {
               "queryScore": 0.89
           },
           "position": {
               "lat": 37.803788,
               "lng": -122.433195
           },
           "access": [
               {
                   "lat": 37.80374,
                   "lng": -122.43346
               }
           ],
           "distance": 2994,
           "mapView": {
               "west": -122.43433,
               "south": 37.80289,
               "east": -122.43206,
               "north": 37.80469
           },
           "categories": [
               {
                   "id": "9150",
                   "name": "primary resource/utility",
                   "primary": true
               }
           ],
           "contacts": [
               {
                   "phone": [
                       {
                           "value": "+1 415-921-6138"
                       }
                   ]
               }
           ]
       },
       {
           "title": "Pacific Gas & Electric Co. Station J",
           "id": "5er0jZLp6gpXkDkesLDeeg",
           "address": {
               "label": "Pacific Gas & Electric Co. Station J, 565 Commercial Street, San Francisco, CA 94111, United States",
               "countryCode": "USA",
               "countryName": "United States",
               "stateCode": "CA",
               "state": "California",
               "county": "San Francisco",
               "city": "San Francisco",
               "street": "Commercial Street",
               "postalCode": "94111-3031",
               "houseNumber": "565"
           },
           "scoring": {
               "queryScore": 0.87
           },
           "position": {
               "lat": 37.79417,
               "lng": -122.402552
           },
           "access": [
               {
                   "lat": 37.79429,
                   "lng": -122.40257
               }
           ],
           "distance": 4633,
           "mapView": {
               "west": -122.40369,
               "south": 37.79327,
               "east": -122.40141,
               "north": 37.79507
           },
           "categories": [
               {
                   "id": "7376",
                   "name": "important tourist attraction",
                   "primary": true
               }
           ],
           "contacts": [
               {
                   "www": [
                       {
                           "value": "noehill.com/sf/landmarks/sf142.asp"
                       }
                   ]
               }
           ]
       },
       {
           "title": "Pacific Gas & Electric General Office Building",
           "id": "QCB98u8ILncy7m5w4FxzYw",
           "address": {
               "label": "Pacific Gas & Electric General Office Building, 245 East Market Street, Daly City, CA 94014, United States",
               "countryCode": "USA",
               "countryName": "United States",
               "stateCode": "CA",
               "state": "California",
               "county": "San Mateo",
               "city": "Daly City",
               "street": "East Market Street",
               "postalCode": "94014-2921",
               "houseNumber": "245"
           },
           "scoring": {
               "queryScore": 0.84
           },
           "position": {
               "lat": 37.690043,
               "lng": -122.462709
           },
           "access": [
               {
                   "lat": 37.68975,
                   "lng": -122.46274
               }
           ],
           "distance": 10241,
           "mapView": {
               "west": -122.46385,
               "south": 37.68914,
               "east": -122.46157,
               "north": 37.69094
           },
           "categories": [
               {
                   "id": "7376",
                   "name": "important tourist attraction",
                   "primary": true
               }
           ]
       },
       {
           "title": "Gas Light",
           "id": "XRGVho5J4YyexqZK7VdX1A",
           "address": {
               "label": "Gas Light, 3640 Buchanan Street, San Francisco, CA 94123, United States",
               "countryCode": "USA",
               "countryName": "United States",
               "stateCode": "CA",
               "state": "California",
               "county": "San Francisco",
               "city": "San Francisco",
               "street": "Buchanan Street",
               "postalCode": "94123-1709",
               "houseNumber": "3640"
           },
           "scoring": {
               "queryScore": 0.82
           },
           "position": {
               "lat": 37.803788,
               "lng": -122.433195
           },
           "access": [
               {
                   "lat": 37.80374,
                   "lng": -122.43346
               }
           ],
           "distance": 2994,
           "mapView": {
               "west": -122.43433,
               "south": 37.80289,
               "east": -122.43206,
               "north": 37.80469
           },
           "categories": [
               {
                   "id": "9361015",
                   "name": "shop, real estate agents",
                   "primary": true
               }
           ],
           "contacts": [
               {
                   "phone": [
                       {
                           "value": "+1 415-921-6138"
                       }
                   ]
               }
           ]
       }
   ]
}

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.