这篇文档目前尚未提供译文,将以原文展示。

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.

Parameters

Loading...

Response Schema

Loading...

Query Limits

Nextbillion.ai allows a maximum rate limit of 6000 queries per minute or 100 queries/second for continuous requests.

Note: We can increase the quota if needed on request. Contact [email protected] for more details.

Examples

Sample API Request

1https://api.nextbillion.io/h/discover?key={{api_key}}&at=37.78182,-122.45291&q=gas&limit=50&in=countryCode:USA,MEX 

Sample API Response

1{
2  "items": [
3    {
4      "title": "Shell",
5      "id": "here:pds:place:8409q8yv-33f491a72c04e948aa8f1529fae316c0",
6      "language": "en",
7      "ontologyId": "here:cm:ontology:petrol_gasoline_station",
8      "resultType": "place",
9      "address": {
10        "label": "Shell, 3035 Geary Blvd, San Francisco, CA 94118, United States",
11        "countryCode": "USA",
12        "countryName": "United States",
13        "stateCode": "CA",
14        "state": "California",
15        "county": "San Francisco",
16        "city": "San Francisco",
17        "district": "Laurel Heights",
18        "street": "Geary Blvd",
19        "postalCode": "94118",
20        "houseNumber": "3035"
21      },
22      "position": {
23        "lat": 37.78156,
24        "lng": -122.4517
25      },
26      "access": [
27        {
28          "lat": 37.78156,
29          "lng": -122.45172
30        }
31      ],
32      "distance": 110,
33      "categories": [
34        {
35          "id": "700-7600-0116",
36          "name": "Gas Station",
37          "primary": true
38        }
39      ],
40      "chains": [
41        {
42          "id": "10",
43          "name": "Shell"
44        }
45      ],
46      "references": [
47        {
48          "supplier": {
49            "id": "core"
50          },
51          "id": "38214603"
52        }
53      ],
54      "contacts": [
55        {
56          "phone": [
57            {
58              "value": "+14157524171"
59            }
60          ],
61          "www": [
62            {
63              "value": "https://find.shell.com/us/fuel/10008270-3035-geary-blvd"
64            },
65            {
66              "value": "https://www.shell.us"
67            }
68          ]
69        }
70      ],
71      "openingHours": [
72        {
73          "text": [
74            "Mon-Sun: 00:00 - 23:59"
75          ],
76          "isOpen": true,
77          "structured": [
78            {
79              "start": "T000000",
80              "duration": "PT23H59M",
81              "recurrence": "FREQ:DAILY;BYDAY:MO,TU,WE,TH,FR,SA,SU"
82            }
83          ]
84        }
85      ]
86    },
87    {
88      "title": "Chevron",
89      "id": "here:pds:place:8409q8yv-e28a9525afcde67c416ba648bfa9b5bf",
90      "language": "en",
91      "ontologyId": "here:cm:ontology:petrol_gasoline_station",
92      "resultType": "place",
93      "address": {
94        "label": "Chevron, 3675 Geary Blvd, San Francisco, CA 94118, United States",
95        "countryCode": "USA",
96        "countryName": "United States",
97        "stateCode": "CA",
98        "state": "California",
99        "county": "San Francisco",
100        "city": "San Francisco",
101        "district": "Lone Mountain",
102        "street": "Geary Blvd",
103        "postalCode": "94118",
104        "houseNumber": "3675"
105      },
106      "position": {
107        "lat": 37.78097,
108        "lng": -122.45852
109      },
110      "access": [
111        {
112          "lat": 37.78109,
113          "lng": -122.45852
114        }
115      ],
116      "distance": 502,
117      "categories": [
118        {
119          "id": "700-7600-0116",
120          "name": "Gas Station",
121          "primary": true
122        }
123      ],
124      "chains": [
125        {
126          "id": "112",
127          "name": "Chevron"
128        }
129      ],
130      "references": [
131        {
132          "supplier": {
133            "id": "core"
134          },
135          "id": "1113080656"
136        },
137        {
138          "supplier": {
139            "id": "yelp"
140          },
141          "id": "7-l8PP5v8uDM9gUxrReuEg"
142        }
143      ],
144      "contacts": [
145        {
146          "phone": [
147            {
148              "value": "+14153879961"
149            }
150          ],
151          "www": [
152            {
153              "value": "https://www.chevronwithtechron.com"
154            },
155            {
156              "value": "https://www.chevronwithtechron.com/station"
157            },
158            {
159              "value": "https://www.chevronwithtechron.com/station/id90535"
160            }
161          ]
162        }
163      ],
164      "openingHours": [
165        {
166          "text": [
167            "Mon-Sun: 00:00 - 24:00"
168          ],
169          "isOpen": true,
170          "structured": [
171            {
172              "start": "T000000",
173              "duration": "PT24H00M",
174              "recurrence": "FREQ:DAILY;BYDAY:MO,TU,WE,TH,FR,SA,SU"
175            }
176          ]
177        }
178      ]
179    }
180  ]
181}

Search Along a Route

Search within a geographic corridor. This is a hard filter. Results will be returned if they are located within the specified area.

https://api.nextbillion.io/h/discover?key={{api_key}}&at=37.78182,-122.45291&q=gas&limit=50&route=Bl8BsozmH1ysrXF 3BXEO4DCSIkCEcKoCGoBIiCauGM4CGkBEgBEYEWQ4DIkCEeEeCWCSCQAYAYBOBYA0BAaAWCUEgBEoBKkCCYCWco HQmEU4FJEHENKLODIBEHQNmBrBqDBAFEDKDGBGAICGCG7FyBvDUnCQrDW3BMVEI0CEaiBqICaEgB5FmBEUOoDG4 BEYSqEO0DSuEKoCoBoKM6CM8CQyEMwCCSMiDSmEEeGuBWyFKqCUiFEeSsESqEKwCOwDSoEOwDKuCMkDCIK8CCM CKGwBI6BoB6JEiBK0CI0BKsCMkDqBmKKuCK8CGuBEgBOyC_FmB3DY_BOpBI9CSHCXEFCFEFGFGVa_C6DTYJQxB-BJKD G_BwCVenBwBXe9BuC;w=250
ParameterDescription
keyNB.ai assigned API key
atsearch biased location - position along route to search
qsearch query
limitmaximum number of results to return
routepolyline encoded representation of the route

The response is shown below. This includes a list of returned matches with Address details

1{
2  "items": [
3    {
4      "title": "Shell",
5      "id": "here:pds:place:8409q8yv-33f491a72c04e948aa8f1529fae316c0",
6      "language": "en",
7      "ontologyId": "here:cm:ontology:petrol_gasoline_station",
8      "resultType": "place",
9      "address": {
10        "label": "Shell, 3035 Geary Blvd, San Francisco, CA 94118, United States",
11        "countryCode": "USA",
12        "countryName": "United States",
13        "stateCode": "CA",
14        "state": "California",
15        "county": "San Francisco",
16        "city": "San Francisco",
17        "district": "Laurel Heights",
18        "street": "Geary Blvd",
19        "postalCode": "94118",
20        "houseNumber": "3035"
21      },
22      "position": {
23        "lat": 37.78156,
24        "lng": -122.4517
25      },
26      "access": [
27        {
28          "lat": 37.78156,
29          "lng": -122.45172
30        }
31      ],
32      "distance": 110,
33      "excursionDistance": 64,
34      "categories": [
35        {
36          "id": "700-7600-0116",
37          "name": "Gas Station",
38          "primary": true
39        }
40      ],
41      "chains": [
42        {
43          "id": "10",
44          "name": "Shell"
45        }
46      ],
47      "references": [
48        {
49          "supplier": {
50            "id": "core"
51          },
52          "id": "38214603"
53        }
54      ],
55      "contacts": [
56        {
57          "phone": [
58            {
59              "value": "+14157524171"
60            }
61          ],
62          "www": [
63            {
64              "value": "https://find.shell.com/us/fuel/10008270-3035-geary-blvd"
65            },
66            {
67              "value": "https://www.shell.us"
68            }
69          ]
70        }
71      ],
72      "openingHours": [
73        {
74          "text": [
75            "Mon-Sun: 00:00 - 23:59"
76          ],
77          "isOpen": true,
78          "structured": [
79            {
80              "start": "T000000",
81              "duration": "PT23H59M",
82              "recurrence": "FREQ:DAILY;BYDAY:MO,TU,WE,TH,FR,SA,SU"
83            }
84          ]
85        }
86      ]
87    },
88    {
89      "title": "Shell",
90      "id": "here:pds:place:8409q8yy-ef2c568f4ec64fccb263d2a2a64cd0b7",
91      "language": "en",
92      "ontologyId": "here:cm:ontology:petrol_gasoline_station",
93      "resultType": "place",
94      "address": {
95        "label": "Shell, 800 Turk St, San Francisco, CA 94102, United States",
96        "countryCode": "USA",
97        "countryName": "United States",
98        "stateCode": "CA",
99        "state": "California",
100        "county": "San Francisco",
101        "city": "San Francisco",
102        "district": "Western Addition",
103        "street": "Turk St",
104        "postalCode": "94102",
105        "houseNumber": "800"
106      },
107      "position": {
108        "lat": 37.78181,
109        "lng": -122.42264
110      },
111      "access": [
112        {
113          "lat": 37.78169,
114          "lng": -122.42261
115        }
116      ],
117      "distance": 3266,
118      "excursionDistance": 233,
119      "categories": [
120        {
121          "id": "700-7600-0116",
122          "name": "Gas Station",
123          "primary": true
124        }
125      ],
126      "chains": [
127        {
128          "id": "10",
129          "name": "Shell"
130        }
131      ],
132      "references": [
133        {
134          "supplier": {
135            "id": "core"
136          },
137          "id": "1017574779"
138        },
139        {
140          "supplier": {
141            "id": "yelp"
142          },
143          "id": "v9BoIJqNLagbRB8OvyVHyw"
144        }
145      ],
146      "contacts": [
147        {
148          "phone": [
149            {
150              "value": "+14154404298"
151            }
152          ],
153          "www": [
154            {
155              "value": "https://find.shell.com/us/fuel/10008251-800-turk-st"
156            },
157            {
158              "value": "https://www.shell.us"
159            }
160          ]
161        }
162      ],
163      "openingHours": [
164        {
165          "text": [
166            "Mon-Sun: 00:00 - 23:59"
167          ],
168          "isOpen": true,
169          "structured": [
170            {
171              "start": "T000000",
172              "duration": "PT23H59M",
173              "recurrence": "FREQ:DAILY;BYDAY:MO,TU,WE,TH,FR,SA,SU"
174            }
175          ]
176        }
177      ]
178    }
179  ]
180}

API Error Codes

Response CodeDescriptionAdditional Notes
200Normal success case.

Normal success case.

400Input validation failed.

Such as missing parameter or parameter with invalid value type (for example value cannot be parsed into number).

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 there is a malformed host name used.

422Could not process the request.

There is an underlying map issue which prevents the processing of the request.

429Too many requests.

QPM reached 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.

快速开始
没找到你要找的内容?