Suggestions
Request
The Suggestions API is used to show possible matches for an address or Points of Interest (POI).
GET https://apis.location.studio/geo/v2/suggestions/json
Required Parameters
api_key |
String |
Your Location Studio API Key |
search_center |
String |
The latitude and longitude for the center of search. The country will be determined by the search_center for geocoding. The latitude must be in the range of -90.0 to 90.0 and longitude must be in the range of -180.0 to 180.0 otherwise HTTP Error Code 400 for Bad Request will result. |
query |
String |
Search term entered by the user. |
Optional Parameters
user_position |
String |
The latitude and longitude for the user’s position. This is used only for calculating distance in meters for each result. The latitude must be in the range of -90.0 to 90.0 and longitude must be in the range of -180.0 to 180.0 otherwise HTTP Error Code 400 for Bad Request will result. |
iterator_length |
Integer |
Number of results to return. The default value is 10. |
Response
Description
When the service returns results from a suggestions request, it places them within a suggest array. The XML response consists of zero or more <lws:suggest> elements that have the following properties:
-
brand
- array indicating the brands associated with the place.-
id
- brand id -
name
- brand name
-
-
categories
- is an array indicating the categories of the place. For example, "Grocery Stores".-
code
- category code -
name
- category name -
parent_category
-
code
- category code -
name
- category name
-
-
-
distance
- distance from the search_center in meters. Alternatively, the distance will be calculated from the user_position if it is provided. -
line1
- First line of text to be displayed for the suggestion. For POI results, this will be the name of the place. For address results this will be the house number and street name. For category/brand results, this will be the name of the category/brand. For city/state/zip/country results this will contain city/state/zip/country formatted for the country of result. -
line2
- Second line of text to be displayed for the suggestion, For POI results this will be the house number and street name of the POI. For addresses this will be the city, state, postal and country. Not used for category/brand and city/state/zip/country results. -
line3
- Third line of text to be displayed for this suggestion. For POI results this will contain city, state, postal & country. Not used for Address, category/brand and city/state/zip/country. -
search_filter
- is an opaque value that can be used in a subsequent Search API request for this match.