Skip to content

Autocomplete

Complete partial addresses and location names. Optimized for type-ahead search boxes.

POST /api/v1/{customer_uuid}/autocomplete/

Request Body

Field Type Required Description
query string Yes Partial address or location name
at string No Location bias as "lat,lng"
country string No ISO 3166-1 alpha-3 country code
language string No BCP47 language code
limit integer No Max results (1-20, default 5)

Example Request

curl -X POST https://geocoder.amigocloud.com/api/v1/{uuid}/autocomplete/ \
  -H "X-API-Key: your-key" \
  -H "Content-Type: application/json" \
  -d '{
    "query": "Provi",
    "country": "CHL",
    "language": "es-CL",
    "limit": 3
  }'

Example Response

{
  "results": [
    {
      "label": "Providencia, Región Metropolitana, Chile",
      "position": { "lat": -33.4303, "lng": -70.6116 },
      "address": {
        "house_number": null,
        "street": null,
        "neighborhood": null,
        "city": "Providencia",
        "county": null,
        "state": "Región Metropolitana",
        "state_code": null,
        "postal_code": null,
        "country": "Chile",
        "country_code": "CHL"
      },
      "result_type": "city",
      "provider_id": "locationiq:relation:12345",
      "relevance": 0.65,
      "distance": null,
      "bounding_box": null,
      "title": "Providencia",
      "category": "place"
    }
  ],
  "provider": "locationiq",
  "cached": false
}

Caching

Results are cached for 1 minute.