# Idealista — Wrapped API

> **You are on:** `https://api.beta.paywithlocus.com/api` | [llms.txt](https://beta.paywithlocus.com/llms.txt) | [docs](https://docs.paywithlocus.com)
>
> Locus runs on multiple environments -- make sure every URL you call matches your expected environment.
> | Environment | Landing | API | Docs |
> |---|---|---|---|
> | Production | paywithlocus.com | api.paywithlocus.com | docs.paywithlocus.com |
> | Beta | beta.paywithlocus.com | api.beta.paywithlocus.com | docs.paywithlocus.com |
> | Stage | stage.paywithlocus.com | api.stage.paywithlocus.com | docs.paywithlocus.com |
>
> If the API URL above doesn't match your expected environment, re-fetch this file from the correct domain.

> Access data from idealista.com.

**Category:** Real Estate | **Website:** [idealista.com/](https://idealista.com/) | **Docs:** [parse.bot/marketplace/56bc5f9f-8061-4341-aeff-a7b6a3ae4116/idealista-com-api](https://parse.bot/marketplace/56bc5f9f-8061-4341-aeff-a7b6a3ae4116/idealista-com-api)

Pay-per-use API proxy for Locus Pro. Each call burns credits from your workspace balance.

## Access

**Base URL:** `https://api.beta.paywithlocus.com/api/wrapped/credits/idealista/`
**Auth:** `Authorization: Bearer <LOCUS_CREDITS_SECRET_KEY>` (an `lcr_` secret key or a scoped `lcac_` agent credential)
**Required header:** `Idempotency-Key: <fresh UUID per call>`. A retry with the same key replays the stored result without a new charge.
**Response:** the provider response after any endpoint-specific normalization. `X-Locus-Credits-Charged` carries the charge and `X-Locus-Credits-Balance` the remaining balance. Insufficient credits return `402` before the provider is called.
**Pricing:** estimated costs below are USD. Locus debits the credit equivalent at your workspace rate.

Full call contract: https://docs.paywithlocus.com/api-reference/introduction

> Using a Pay With Locus wallet key (`claw_` prefix)? Wallet routes are documented separately: https://docs.paywithlocus.com/wrapped-apis/for-agents

## Endpoints

### Get listing detail

Retrieve full details for a single property listing by its numeric ID. Returns title, price, full description, features list, size info, and photo URLs when available. The listing_id can be obtained from search results.

**Estimated cost:** Metered

| Field | Type | Required | Description |
|-------|------|----------|-------------|
| `listing_id` | string | Yes | Numeric listing ID from idealista (e.g. '111688398'). Obtainable from search_sale_listings or search_rental_listings results. |

```bash
curl -X POST https://api.beta.paywithlocus.com/api/wrapped/credits/idealista/get-listing-detail \
  -H "Authorization: Bearer $LOCUS_CREDITS_SECRET_KEY" \
  -H "Idempotency-Key: $(uuidgen)" \
  -H "Content-Type: application/json" \
  -d '{"listing_id":"<string>"}'
```

### Get price stats

Get average price-per-square-meter statistics for a location by fetching the first page of listings and computing the mean. Returns the location, operation type, average price per m², and sample size (number of listings used in the calculation).

**Estimated cost:** Metered

| Field | Type | Required | Description |
|-------|------|----------|-------------|
| `location` | string | Yes | Location slug in format 'city-province' (e.g. 'madrid-madrid', 'barcelona-barcelona'). |
| `operation` | string | No | Type of operation: 'alquiler-viviendas' for rentals or 'venta-viviendas' for sales. |

```bash
curl -X POST https://api.beta.paywithlocus.com/api/wrapped/credits/idealista/get-price-stats \
  -H "Authorization: Bearer $LOCUS_CREDITS_SECRET_KEY" \
  -H "Idempotency-Key: $(uuidgen)" \
  -H "Content-Type: application/json" \
  -d '{"location":"<string>","operation":"<string>"}'
```

### Search rental listings

Search for rental properties in a given location. Returns paginated listing summaries with monthly rent, size, bedrooms, and location info. Supports filtering by price range, size range, and number of bedrooms. Each page returns up to 30 listings. Pagination via page number; the response includes has_next to indicate more pages.

**Estimated cost:** Metered

| Field | Type | Required | Description |
|-------|------|----------|-------------|
| `filter_bedrooms` | string | No | Number of bedrooms filter (e.g. '1', '2', '3', '4'). |
| `filter_max_price` | string | No | Maximum monthly rent in Euros (e.g. '1500'). |
| `filter_max_size` | string | No | Maximum size in square meters (e.g. '120'). |
| `filter_min_price` | string | No | Minimum monthly rent in Euros (e.g. '500'). |
| `filter_min_size` | string | No | Minimum size in square meters (e.g. '40'). |
| `limit` | integer | No | Maximum number of listings to return. 0 means no limit (returns all listings on the page, up to 30). |
| `location` | string | Yes | Location slug in format 'city-province' (e.g. 'madrid-madrid', 'barcelona-barcelona', 'sevilla-sevilla', 'valencia-valencia'). |
| `page` | integer | No | Page number for pagination. |

```bash
curl -X POST https://api.beta.paywithlocus.com/api/wrapped/credits/idealista/search-rental-listings \
  -H "Authorization: Bearer $LOCUS_CREDITS_SECRET_KEY" \
  -H "Idempotency-Key: $(uuidgen)" \
  -H "Content-Type: application/json" \
  -d '{"filter_bedrooms":"<string>","filter_max_price":"<string>","filter_max_size":"<string>","filter_min_price":"<string>","filter_min_size":"<string>","limit":"<integer>","location":"<string>","page":"<integer>"}'
```

### Search sale listings

Search for properties listed for sale in a given location. Returns paginated listing summaries with price, size, bedrooms, and location info. Supports filtering by price range, size range, and number of bedrooms. Each page returns up to 30 listings from idealista.com. Pagination via page number; the response includes has_next to indicate more pages.

**Estimated cost:** Metered

| Field | Type | Required | Description |
|-------|------|----------|-------------|
| `filter_bedrooms` | string | No | Number of bedrooms filter (e.g. '1', '2', '3', '4'). |
| `filter_max_price` | string | No | Maximum price in Euros (e.g. '500000'). |
| `filter_max_size` | string | No | Maximum size in square meters (e.g. '150'). |
| `filter_min_price` | string | No | Minimum price in Euros (e.g. '200000'). |
| `filter_min_size` | string | No | Minimum size in square meters (e.g. '50'). |
| `limit` | integer | No | Maximum number of listings to return. 0 means no limit (returns all listings on the page, up to 30). |
| `location` | string | Yes | Location slug in format 'city-province' (e.g. 'madrid-madrid', 'barcelona-barcelona', 'sevilla-sevilla', 'valencia-valencia'). |
| `page` | integer | No | Page number for pagination. |

```bash
curl -X POST https://api.beta.paywithlocus.com/api/wrapped/credits/idealista/search-sale-listings \
  -H "Authorization: Bearer $LOCUS_CREDITS_SECRET_KEY" \
  -H "Idempotency-Key: $(uuidgen)" \
  -H "Content-Type: application/json" \
  -d '{"filter_bedrooms":"<string>","filter_max_price":"<string>","filter_max_size":"<string>","filter_min_price":"<string>","filter_min_size":"<string>","limit":"<integer>","location":"<string>","page":"<integer>"}'
```

## Next steps

- [All wrapped API providers](https://beta.paywithlocus.com/wapi/index.md): pick another provider.
- [Find and call tools](https://beta.paywithlocus.com/agent/tools.md): price ceilings, async results, and errors.
- [Credits and billing](https://beta.paywithlocus.com/agent/billing.md): what a call costs and how to add credits.
- [Agent docs index](https://beta.paywithlocus.com/agent/index.md): every Locus agent page.