- Developers
- Sygic Maps API
- Search API
- Autocomplete v0 [Deprecated]
Autocomplete v0 [Deprecated]
- Move to section
Please note Sygic does no longer issue new Sygic Maps API keys. This documentation is for existing customers only. If you wish to include maps & navigation into your project, please refer to Sygic Maps SDK.
Overview
Sygic's Autocomplete provides users with suggestions that best match their input based on the string and user's location. It is a two step function:
- Get candidates - all suggestions for given query
- Get candidate details - extensive details about selected candidate
Request
API Reference
https://search.api.sygic.com/v0/api/autocomplete?key=yourAPIkey
Request authentication is done via parameter key, which must be included in the request URL.
Methods
- GET
Parameters
Required Parameters
Parameter | Data type | Description |
query | string | Search query. | key | string | The API key. |
Optional Parameters
Parameter | Data type | Value | Description |
lat lon |
float | lat=42.1245 lon=15.5584 | Latitude and longitude of user GPS position. Used for more location relevant results. | boundaryLeft boundaryRight boundaryTop boundaryBottom |
float | Example: boundaryLeft=15.2 boundaryRight=15.5 boundaryBottom=42.125 boundaryTop=42.3 |
Square boundaries of search focus. All boundary parameters must be specified together or none. |
id | string | Session id used for consecutive autocomplete calls. Causes cancellation of previous requests if they did not finish before next request is received. Means of generating unique id for each user is up to client. | |
typeFilter | string | country, postal_code, city, street, address, postal_address, poi_group, poi_category, poi | Result type filter to restrict search only to specified types. Multiple values are accepted. |
regionFilter | string | europe, north_america | Filter parameter to restrict search operation to the specified region. Only one value is accepted. |
countryFilter | string | ISO 3 country codes | Filter parameter to restrict search operation to the specified list of countries. |
lang | string | culture info format ("en-US") or country ISO code | Language preference of results. |
Get Candidates
Request
GET https://search.api.sygic.com/v0/api/autocomplete?query=veveri&key=yourAPIkey
Response
[
{
"id": "czoAAGN6ZQDV7q4wAQAAAAZWRVZFUkmXAgAAAQAAAAIAAAAAAAAA//9/////f/8=",
"detail_url": "https://search.api.sygic.com/v0/api/details?resultId=czoAAGN6ZQDV7q4wAQAAAAZWRVZFUkmXAgAAAQAAAAIAAAAAAAAA%2F%2F9%2F%2F%2F%2F%2Ff%2F8%3D&key=yourAPIkey",
"type": "city",
"iso": "cze",
"names": {
"country": "Czech Republic",
"postal_code": "37333",
"city": "Veveří"
},
"highlights": {
"city": [
[
0,
6
]
]
},
"is_address_approximate": false,
"approximate_possition": {
"lat": 48.76665,
"lon": 14.79044
},
"score": 74,
"group_id": 0,
"category_id": 0,
"languages": {
"country": "CS",
"postal_code": "CS",
"city": "CS"
},
"matched_words": [
"VEVERI"
],
"unmatched_words": []
},
{
"id": "PgEAAGN6ZQDV7q4wAQAAAAZWRVZFUkmqAwAAAgAAAAMAAAAAAAAA//9/////f/8=",
"detail_url": "https://search.api.sygic.com/v0/api/details?resultId=PgEAAGN6ZQDV7q4wAQAAAAZWRVZFUkmqAwAAAgAAAAMAAAAAAAAA%2F%2F9%2F%2F%2F%2F%2Ff%2F8%3D&key=yourAPIkey",
"type": "street",
"iso": "cze",
"names": {
"country": "Czech Republic",
"postal_code": "60200",
"city": "Brno",
"street": "Veveří"
},
"highlights": {
"street": [
[
0,
6
]
]
},
"is_address_approximate": false,
"approximate_possition": {
"lat": 49.20852,
"lon": 16.5919
},
"score": 70,
"group_id": 0,
"category_id": 0,
"languages": {
"country": "CS",
"postal_code": "CS",
"city": "CS",
"street": "CS"
},
"matched_words": [
"VEVERI"
],
"unmatched_words": []
},
{
"id": "dToAAGN6ZQDV7q4wAQAAAAZWRVZFUkkfCgAAAQAAAAIAAAAAAAAA//9/////f/8=",
"detail_url": "https://search.api.sygic.com/v0/api/details?resultId=dToAAGN6ZQDV7q4wAQAAAAZWRVZFUkkfCgAAAQAAAAIAAAAAAAAA%2F%2F9%2F%2F%2F%2F%2Ff%2F8%3D&key=yourAPIkey",
"type": "city",
"iso": "cze",
"names": {
"country": "Czech Republic",
"postal_code": "79351",
"city": "Veveří"
},
"highlights": {
"city": [
[
0,
6
]
]
},
"is_address_approximate": false,
"approximate_possition": {
"lat": 49.84868,
"lon": 17.32746
},
"score": 65.40859,
"group_id": 0,
"category_id": 0,
"languages": {
"country": "CS",
"postal_code": "CS",
"city": "CS"
},
"matched_words": [
"VEVERI"
],
"unmatched_words": []
},
...
]
Response Codes
Status Code | Description |
200 | service returned result |
204 | request was cancelled |
400 | error in input parameters |
500 | service error |
503 | service not available |
504 | request processing timeout |
Get Candidate Details
Request
GET https://search.api.sygic.com/v0/api/details?resultId={id}&key=yourAPIkey
Response
{
"type": "city",
"position": {
"lat": 48.76665,
"lon": 14.79044
},
"boundary": {
"top": 48.77,
"bottom": 48.75,
"left": 14.77,
"right": 14.8
},
"city_is_capital": false,
"city_is_builtup": false,
}