# Idealista Short URIs

direction=encode maps a location to a shortUri. direction=decode reverses shortUris back to locationId.

- **Documentation:** [https://scrappa.co/docs/idealista-api/idealista_shorturis](https://scrappa.co/docs/idealista-api/idealista_shorturis)
- **API group:** Idealista API
- **Endpoint:** `POST https://scrappa.co/api/idealista/shorturis`

## 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 |
| --- | --- | --- | --- |
| `country` | string | No | es, it, pt, or fr. |
| `direction` | string | No | encode or decode. |
| `location_id` | string | No | Required for encode. |

## Example request

```bash
#!/bin/bash

curl -X GET \
    -H "x-api-key: YOUR_API_KEY_HERE" \
    "https://scrappa.co/api/idealista/shorturis?country=es&direction=encode&location_id=0-EU-ES-28&operation=sale&property_type=homes"
```

## Example response

```json
{
    "success": true,
    "data": {
        "locations": [
            {
                "shortUri": "bd4"
            }
        ]
    }
}
```

## Errors

| Status | Error | Description |
| --- | --- | --- |
| 404 | Not Found | The requested listing, zone, or agency was not found. This response is not billable. |
| 422 | Validation Error | A public parameter is invalid, including rejected property types. This response is not billable. |
| 503 | Service Unavailable | The service could not obtain a complete result. This response is not billable. |

## 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)
