[ Whereis® API Home ] [ JSON API Home ] [ Services ] [ Utilities ]
Use Autosuggest to obtain a list of suggestions, at the requested granularity, that most closely match a submitted fragment of text.
- The "id" in the response may be used to re-request and obtain additional information about a validated location using get details by ID.
- "text" in the response provides a string which may be used to identify the result to the end user.
URL
HTTP Post to <ENDPOINT>/service/search/suggest
Request format
{
"maxSize": <int>,
"query": <string>,
"granularity": ["STATE","REGION","SUBURB",...]
}
Rules
Parameter | Mandatory? | Description |
query | Y | String fragment to match against. |
maxSize | N | Maximum number of suggestions to be returned. You cannot request less than 10 matches, although fewer may be returned. Max = 30. Default = 10. |
granularity | N | Specifies the scale of the detail to be returned in an array which may include one or more of: "SUBURB", "STATE", or "REGION". Default = ["STATE", "REGION", "SUBURB"] |
Sample request
{
"maxSize":"12",
"query":"VIC",
"granularity":["REGION"]
}
Sample response
{
"suggestions": [
{
"id": "region-40086",
"text": "Victor Harbor Metro, SA",
"granularity": "REGION"
},
{
"id": "region-30367",
"text": "Victor Harbor Lga, SA",
"granularity": "REGION"
},
{
"id": "region-30557",
"text": "Victoria-daly Lga, NT",
"granularity": "REGION"
},
{
"id": "region-30496",
"text": "Victoria Park Lga, WA",
"granularity": "REGION"
},
{
"id": "region-30497",
"text": "Victoria Plains Lga, WA",
"granularity": "REGION"
}
]
}
NOTES
Currently, only SUBURB, REGION, and STATE are supported. In future releases, support will be extended to other granularities.