# Fotocasa Property Search ## Overview | Property | Value | |----------|-------| | **Status** | active | | **Method** | `GET` | | **Endpoint** | `/v2/fotocasa/search` | | **Base URL** | `https://api.piloterr.com` | | **Credit Cost** | 2 credits per call | | **Documentation** | https://www.piloterr.com/library/fotocasa-search | ## Description Search Fotocasa listings by city or search URL. Returns prices, rooms, area, coordinates, and agency data via browser rendering (2 credits). ## Authentication - **Key Name:** `x-api-key` - **Location:** HTTP Header - **Get an API key:** https://app.piloterr.com/register ## Example Request ```bash curl --location --request GET 'https://api.piloterr.com/v2/fotocasa/search' \ --header 'Content-Type: application/json' \ --header 'x-api-key: YOUR_API_KEY' ``` ## Example Response ### Buy homes in Madrid ```json { "meta": { "location": "Madrid", "operation": "sale", "total_pages": 375, "current_page": 1, "has_next_page": true, "total_results": 11222 }, "listings": [ { "id": "189717534", "url": "https://www.fotocasa.es/es/comprar/vivienda/madrid-capital/aire-acondicionado-ascensor-amueblado/189717534/d", "city": "Madrid", "floor": null, "price": 990000, "rooms": 3, "title": "Barrio de Salamanca", "address": "Barrio de Salamanca", "area_m2": 99, "currency": "EUR", "latitude": 40.43689191820105, "bathrooms": 2, "longitude": -3.677214968590556, "operation": "sale", "price_drop": null, "agency_name": "Dils Lucas Fox", "neighborhood": "Barrio de Salamanca", "price_per_m2": 10000, "published_at": "2026-05-19T04:07:34.000Z", "property_type": "home", "thumbnail_url": "https://static.fotocasa.es/images/ads/18ce6fc9-f80b-415f-b538-a150d35c7073?rule=original", "property_subtype": "apartment" }, { "id": "189625641", "url": "https://www.fotocasa.es/es/comprar/vivienda/madrid-capital/aire-acondicionado-calefaccion-terraza-trastero-ascensor-amueblado/189625641/d", "city": "Madrid", "floor": 12, "price": 1620000, "rooms": 3, "title": "Alcalá, Barrio de Salamanca", "address": "Alcalá, Barrio de Salamanca", "area_m2": 130, "currency": "EUR", "latitude": 40.42785333292837, "bathrooms": 2, "longitude": -3.672679393562349, "operation": "sale", "price_drop": null, "agency_name": "ESPÍGUL IMMOBILIARIA", "neighborhood": "Barrio de Salamanca", "price_per_m2": 12462, "published_at": "2026-05-08T15:08:35.000Z", "property_type": "home", "thumbnail_url": "https://static.fotocasa.es/images/ads/f8a5ccd4-ccf2-4012-9584-ba97c261b3ff?rule=original", "property_subtype": "penthouse" } ] } ``` ### Rent homes in Barcelona ```json { "meta": { "location": "Barcelona", "operation": "rent", "total_pages": 111, "current_page": 1, "has_next_page": true, "total_results": 3319 }, "listings": [ { "id": "190623509", "url": "https://www.fotocasa.es/es/alquiler/vivienda/barcelona-capital/aire-acondicionado-calefaccion-amueblado-television-se-aceptan-mascotas-internet/190623509/d", "city": "Barcelona", "floor": null, "price": 1486, "rooms": 2, "title": "N/A, Eixample", "address": "N/A, Eixample", "area_m2": 69, "currency": "EUR", "latitude": 41.38040172808665, "bathrooms": null, "longitude": 2.15092820467445, "operation": "rent", "price_drop": null, "agency_name": "HOUSINGANYWHERE", "neighborhood": "Eixample", "price_per_m2": 22, "published_at": "2026-09-01T01:03:28.000Z", "property_type": "home", "thumbnail_url": "https://static.fotocasa.es/images/ads/9f7f7ed2-621f-43ce-8ce8-6c5ef9c07d4d?rule=original", "property_subtype": "apartment" }, { "id": "190623503", "url": "https://www.fotocasa.es/es/alquiler/vivienda/barcelona-capital/aire-acondicionado-calefaccion-amueblado-television/190623503/d", "city": "Barcelona", "floor": null, "price": 1100, "rooms": null, "title": "N/A, Sants - Montjuïc", "address": "N/A, Sants - Montjuïc", "area_m2": 40, "currency": "EUR", "latitude": 41.37519937568134, "bathrooms": null, "longitude": 2.133587230323095, "operation": "rent", "price_drop": null, "agency_name": "HOUSINGANYWHERE", "neighborhood": "Sants - Montjuïc", "price_per_m2": 28, "published_at": "2026-09-01T01:02:20.000Z", "property_type": "home", "thumbnail_url": "https://static.fotocasa.es/images/ads/55f8785f-12a8-4975-945e-24a12783bfa7?rule=original", "property_subtype": "apartment" } ] } ``` ## Documentation ## Overview Search real estate listings on fotocasa.es. Pass a **city** (`madrid`, `barcelona`, `valencia`…) or a **full search URL**. Browser rendering. **2 credits** per call. ## Quickstart ``` GET https://api.piloterr.com/v2/fotocasa/search?query=madrid&operation=buy GET https://api.piloterr.com/v2/fotocasa/search?query=barcelona&operation=rent&page=2 GET https://api.piloterr.com/v2/fotocasa/search?query=https://www.fotocasa.es/es/comprar/viviendas/madrid-capital/todas-las-zonas/l ``` ## Parameters | Parameter | Type | Required | Description | |---|---|---|---| | `query` | string | yes | City name or full fotocasa.es search URL | | `operation` | string | no | `buy` / `rent` when `query` is a city. Default: `buy` | | `page` | integer | no | Page number. Default: 1 | ## Response fields | Field | Type | Description | |---|---|---| | `listings[]` | array | Property cards | | `listings[].id` / `url` / `title` | string | Fotocasa id, detail URL, title | | `listings[].price` | number \| null | Asking price in EUR | | `listings[].currency` | string | `EUR` | | `listings[].price_drop` / `price_per_m2` | number \| null | Reduction and €/m² | | `listings[].rooms` / `bathrooms` / `area_m2` / `floor` | integer \| null | Specs | | `listings[].property_type` / `property_subtype` | string | e.g. `home` / `apartment` | | `listings[].operation` | string | `sale` or `rent` | | `listings[].city` / `neighborhood` / `address` | string | Location | | `listings[].latitude` / `longitude` | number \| null | Coordinates | | `listings[].thumbnail_url` | string | Image | | `listings[].agency_name` | string \| null | Agency | | `listings[].published_at` | string \| null | ISO 8601 | | `meta.current_page` / `total_pages` / `total_results` | integer | Pagination | | `meta.has_next_page` | boolean | More pages | | `meta.location` / `operation` | string | Search context | ## Error codes | Code | Meaning | |---|---| | `400` | Empty or non-fotocasa.es `query` | | `404` | Page not found or no listings | | `500` | Rendering or parse failed | ## Related endpoints - [Fotocasa Property Ad](https://www.piloterr.com/library/fotocasa-ad) ## Main use cases - Index asking prices and €/m² by Spanish city and neighbourhood - Feed a map UI with geo-tagged Fotocasa inventory - Watch rental vs sale supply across Madrid, Barcelona, Valencia