Document
Web Service
Guides
Autocomplete
Autocomplete API
Autocomplete is a web service that returns place predictions and query predictions in response to an HTTP request. In the request, specify a text search string and geographic bounds that controls the search area.
Promptdomestic and overseas Autocomplete APIs share the same endpoint. The overseas Web Services API is categorized as a premium service requiring prior authorization. For access requests, submit a business consultation through the official support ticket system.
Guidelines
Apply for a
【Web Service API】Key
Enable overseas permissions for the applied Key by submitting a ticket to request overseas permissions
Construct the HTTP request URL, including the Key obtained in Step 1 as a required parameter
Receive and parse the data returned from the HTTP request (in JSON or XML format)
Unless otherwise specified, all input parameters and output data are encoded in
UTF-8。
Autocomplete
Autocomplete API Service URL
URL | Request Method |
https://sg-restapi.opnavi.com/v3/assistant/inputtips?parameters | GET |
The parameters represent both required and optional parameters. All parameters are separated by the ampersand character (&). The list below enumerates these parameters and their usage rules.
Request Parameters
Parameter Name | Description | Specification | Mandatory | Default |
key | Service Authorization Token | Applying for a Web Service API Key and Submitting a Work Order for Overseas Permissions on Amap Map Official Website | Mandatory | None |
keywords | Query Keyword | Input Query Keyword | Mandatory | None |
type | Query POI Type | POI Type Reference, POI Category Code | Optional | None |
location | Center Point Coordinates | Rules: Latitude and longitude are separated by a comma ",". Longitude comes first, followed by latitude. The decimal places of latitude and longitude must not exceed 6 digits. | Optional | None |
city | City Code | For the overseas search interface, the city field is required and can be filled with citycode or adcode. Methods to Obtain adcode: Obtain adcode table by country If there is no corresponding district adcode, use the country's adcode instead. For example, for the USA: 840000000. If there is no corresponding country adcode, you can enter “000000000”. Retrieve via Reverse Geocoding interface. | Optional in China, Required Overseas | None(Search within all of China) |
langCode | Return result language | Default is zh(Chinese), optional: zh(Chinese) en(English) es(Spanish) pt(Portuguese) fr(French) de(German) th(Thai) ja(Japanese) ko(Korean) ar(Arabic) tr(Turkish) he(Hebrew) it(Italian) ru(Russian) ms(Malay) id(Indonesian) vi(Vietnamese) pl(Polish) cs(Czech) uk(Ukrainian) az(Azerbaijani)
| Optional | None |
sig | Digital Signature | Methods for Obtaining and Using Digital Signatures | Optional | None |
callback | Callback Function | The callback value is a function name defined by the user. | Optional | None |
Examples
https://sg-restapi.opnavi.com/v3/assistant/inputtips?keywords=food&city=724010000&type=Food & Beverages Related&key=<your key>
Response Parameters Description
Name | Description | Specification |
status | Result Status Value, Value is 0 or 1 | 0: Request failed; 1: Request succeeded |
info | Return Status Description | When status is 0, specific error reasons will be returned in info. Otherwise, "OK" will be returned. For details, refer to theinfo status table. |
count | Number of Returned Results | The number of returned results |
tips | Suggestion Display List |
|
| tip | Suggestion Information |
|
| id | Returned Data ID | Overseas POI IDs start with 'P'. 'PO' represents ordinary POIs, while 'PS'/'PV' represent public transportation POIs. Example: P0JAK55X50 |
name | Tip Name |
|
district | Belonging Area | Country-City-District |
adcode | Area Code |
|
location | Latitude/Longitude | Longitude, Latitude |
address | Address | Longitude, Latitude |
typecode | Point of Interest (POI) Type Code |
|
city | City |
|