# Fincaraiz Location Autocomplete API Documentation

Scrappa's `GET /api/fincaraiz/location-autocomplete` resolves a Colombian place name into the ids the search endpoint needs.

Pass the term, get back typed matches — city, department, zone, commune, or neighbourhood — each with a UUID `id`, a `type`, and coordinates.

Each result also carries `search_filter_value`, which is exactly the `{id, type}` pair to pass to the search endpoint as a location. Copying from there removes the most common integration mistake on this platform: sending the id without its type, or sending a numeric estate id that belongs to a different vocabulary and matches nothing.

A term that matches nothing returns an empty list, which is a valid 200.

- **Documentation:** [https://scrappa.co/docs/fincaraiz-api/fincaraiz_location_autocomplete](https://scrappa.co/docs/fincaraiz-api/fincaraiz_location_autocomplete)
- **API group:** Fincaraiz API
- **Endpoint:** `GET https://scrappa.co/api/fincaraiz/location-autocomplete`

## Authentication

Send your Scrappa API key in the `X-API-KEY` request header. Paid endpoints also support accountless x402 payments when called without an API key.

## Parameters

| Parameter | Type | Required | Description |
| --- | --- | --- | --- |
| `term` | string | Yes | Place name to resolve, for example medellin or bogota. |

## Example request

```bash
#!/bin/bash

curl -X GET \
    -H "x-api-key: YOUR_API_KEY_HERE" \
    "https://scrappa.co/api/fincaraiz/location-autocomplete?term=medellin"
```

## Example response

```json
{
    "success": true,
    "term": "medellin",
    "returned": 2,
    "locations": [
        {
            "id": "183f0a11-0000-4000-8000-000000000000",
            "type": "CITY",
            "name": "Medellin",
            "slug": [
                "medellin"
            ],
            "estate": {
                "id": "2d63ee80-0000-4000-8000-000000000000",
                "name": "Antioquia"
            },
            "coordinates": [
                -75.5762,
                6.2442
            ],
            "search_filter_value": {
                "id": "183f0a11-0000-4000-8000-000000000000",
                "type": "CITY"
            }
        }
    ],
    "meta": {
        "billable": true,
        "endpoint_family": "location-autocomplete",
        "attempts": 1
    }
}
```

## Errors

| Status | Error | Description |
| --- | --- | --- |
| 503 | Upstream Unavailable | The upstream request failed after retries, or returned a response this endpoint cannot read (`upstream_unavailable`, `parser_drift`). Retryable and never billed. |
| 503 | Unreadable Response | The platform answered successfully with a body this endpoint cannot read, so nothing is published and nothing is charged (`parser_drift`). Retryable. |
| 422 | Validation Error | The term is missing or too long. Non-billable. |

## Frequently asked questions

### Why do I need both an id and a type for a location?

The search endpoint requires each location to carry both. An id alone is rejected. Every autocomplete result includes a search_filter_value field containing the ready-made pair.

### Can I use the estate ids from the vocabulary endpoint in search?

No. The two id sets are unrelated: search geography uses UUIDs, the vocabulary uses small integers. Feeding an estate number into search returns zero results.

## Related endpoints

- [Search](https://scrappa.co/docs/fincaraiz-api/fincaraiz_search)
- [Location Vocabulary](https://scrappa.co/docs/fincaraiz-api/fincaraiz_location_vocabulary)

## More Scrappa resources

- [API documentation](https://scrappa.co/docs)
- [Full LLM-readable API reference](https://scrappa.co/llms-full.txt)
- [OpenAPI specification](https://scrappa.co/docs/api.json)
- [Pricing](https://scrappa.co/pricing)
