TocToc Autocomplete API resolves a place name to the ids the search route needs. Each result has a label, a parent label, a type (region, commune, street or avenue), the TocToc page path and the region_id and commune_id to pass into search. A street or avenue carries the ids of its commune. A query with no match returns an empty list. A query under 2 characters returns an empty list and is not billed. Failed requests are not billed.
Run this endpoint
Endpoint
Parameters
Start with the required fields, then add optional filters only when your use case needs them.
Runnable path
1 required parameter needed before sending a request.
1 optional filter available.
string
Required
Search text, for example providencia. Under 2 characters returns an empty list and is not billed.
coffee shops
integer
Optional
Number of results, 1 to 25 (default 10).
10
Response Schema
Example response fields are illustrative; inspect the JSON before integrating.
Example response fields
Scan these fields before integrating.
data
meta
success
{
"data": {
"query": "providencia",
"results": [
{
"type": "commune",
"label": "Providencia",
"place_id": 47,
"seo_path": "metropolitana/providencia",
"sublabel": "Santiago",
"region_id": 13,
"commune_id": 337
},
{
"type": "avenue",
"label": "Avenida Providencia",
"place_id": 3433,
"seo_path": "metropolitana/providencia/providencia",
"sublabel": "Providencia",
"region_id": 13,
"commune_id": 337
}
]
},
"meta": {
"billable": true,
"endpoint_family": "autocomplete"
},
"success": true
}
Errors
Handle these documented responses before retrying or showing customer-facing failures.
Validation Error
A parameter is missing or invalid. This response is not billed.
{
"errors": {
"query": [
"The query field is required."
]
},
"message": "The request validation failed"
}Upstream Unavailable
TocToc could not be reached or returned data that does not match the request. This response is not billed and can be retried.
{
"meta": {
"billable": false,
"retryable": true,
"endpoint_family": "autocomplete"
},
"error": {
"code": "UPSTREAM_UNAVAILABLE",
"message": "TocToc could not be reached. Please retry shortly."
},
"success": false
}Generate Code with AI
Copy a ready-made prompt with all the endpoint details, parameters, and example responses. Paste it into ChatGPT, Claude, or any AI assistant to instantly generate working code.
Try It Live
Test this endpoint in our interactive playground with real data.