Document
Web Service
Guides
Autocomplete
Autocomplete API
The Autocomplete API is a web service that returns place predictions and query predictions in response to an HTTP request. In your request, provide a text search string and geographic bounds that define the search area.
PromptThe domestic and overseas Autocomplete APIs share the same endpoint. The overseas Web Services API is categorized as a premium service and requires prior authorization. To request access, submit a business consultation through the official support ticket system.
Get Started
Apply for a
【Web Service API】 Key
Enable overseas access for the applied Key by submitting a ticket to request the required 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
Name | Meaning | Rule Description | Required | Default |
key | Service authorization token | Obtain a Web Service API Key and submit a support ticket to request overseas permissions on the official website. | Yes | None |
keywords | Query keyword | The search keyword to query. | Yes | None |
type | POI type filter | Filters results by POI type. See the POI category code reference. | No | None |
location | Center point coordinates | Latitude and longitude separated by a comma (","). Longitude comes first, followed by latitude. Decimal places must not exceed 6 digits. | No | None |
city | City code | For the overseas search interface, the city field is required. Use a citycode or adcode value.
How to obtain the adcode: - Download the adcode table by country. - If no district-level adcode exists, use the country's adcode instead (e.g., USA: 840000000). - If no country-level adcode exists, use 000000000. - Alternatively, retrieve the adcode via the Reverse Geocoding API. | No (domestic) Yes (overseas) | None (searches all of China) |
langCode | Response language | Default is zh (Chinese). Supported values: 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) | No | None |
sig | Digital signature | Used for request authentication. See the digital signature documentation for details on how to generate and use it. | No | None |
callback | Callback function | A user-defined function name for JSONP-style callbacks. | No | 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 | 0: Request failed; 1: Request succeeded. |
info | Status description | When status is 0, this field contains the specific error reason. Otherwise, returns "OK". See the info status table for details. |
count | Number of returned results | The total number of results in the response. |
tips | List of suggestion items | Contains an array of suggestion objects. |
| tip | Suggestion information | Child element containing suggestion details. |
| id | Data ID | Overseas POI IDs start with 'P'. 'PO' represents ordinary POIs, while 'PS'/'PV' represent public transportation POIs. Example: P0JAK55X50. |
name | Tip name | The display name of the suggestion. |
district | Administrative area | Formatted as Country-City-District. |
adcode | Area code | The administrative division code. |
location | Coordinates | Formatted as longitude,latitude. |
address | Address | The formatted address of the suggestion. |
typecode | POI type code | The category code for the point of interest. |
city | City | The city name associated with the suggestion. |