# Fotocasa Map Search

Returns map pin records around a coordinate. Takes the same filters as /search and returns a lighter per-pin schema. This endpoint publishes no result total upstream, so total_items and has_more are null rather than zero or false; served_page echoes the page Fotocasa actually returned, which is how you detect the end of the set — past the last page it silently clamps and keeps returning a full page.

- **Documentation:** [https://scrappa.co/docs/fotocasa-api/fotocasa_map_search](https://scrappa.co/docs/fotocasa-api/fotocasa_map_search)
- **API group:** Fotocasa API
- **Endpoint:** `GET https://scrappa.co/api/fotocasa/map-search`

## 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 |
| --- | --- | --- | --- |
| `latitude` | number | Yes | Centre latitude. |
| `longitude` | number | Yes | Centre longitude. |
| `property_type` | integer | No | Numeric propertyType, same values as /search. |
| `transaction_type` | integer | No | Numeric transactionType, same values as /search. |
| `size` | integer | No | Page size, 1-1000. |
| `page` | integer | No | 1-based page number. Check served_page against page to detect the end of the set. |

## Example request

```bash
#!/bin/bash

curl -X GET \
    -H "x-api-key: YOUR_API_KEY_HERE" \
    "https://scrappa.co/api/fotocasa/map-search?latitude=40.4168&longitude=-3.7038&property_type=2&transaction_type=1&size=5"
```

## Example response

```json
{
    "success": true,
    "data": {
        "page": 1,
        "served_page": 1,
        "page_size": 5,
        "total_items": null,
        "has_more": null,
        "items": [
            {
                "id": "1_190783970",
                "surface": 211,
                "rooms": 3
            }
        ]
    }
}
```

## Errors

| Status | Error | Description |
| --- | --- | --- |
| 404 | Not Found | The requested listing or location was not found. This response is not billable. |
| 422 | Validation Error | A public parameter is invalid, including an unknown property_type or transaction_type. This response is not billable. |
| 503 | Service Unavailable | The service could not obtain a complete result from Fotocasa. 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)
