# Madlan Listing Search API

Search Madlan's public property listings and receive them as structured JSON. Results cover apartments, houses and land across Israel for both sale and rent, with price, room count, floor, size, address, coordinates, images, amenities and price history for each listing. All text is returned in Hebrew exactly as published.

- **Documentation:** [https://scrappa.co/docs/madlan-api/madlan_search](https://scrappa.co/docs/madlan-api/madlan_search)
- **API group:** Madlan API
- **Endpoint:** `GET https://scrappa.co/api/madlan/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 |
| --- | --- | --- | --- |
| `query` | string | No | Free-text search matched against the listing description. Hebrew is supported and returned as raw UTF-8. |
| `deal_type` | string | No | unitBuy for sale or unitRent for rent. Sale and rent listings are separated after the search returns, because Madlan does not offer a server-side deal type filter. |
| `price_min` | number | No | Minimum price in Israeli shekels. |
| `price_max` | number | No | Maximum price in Israeli shekels. Usable on its own; when price_min is also given, it must be greater than or equal to it. |
| `beds` | number | No | Number of bedrooms. |
| `floor` | number | No | Floor number. |
| `offset` | integer | No | Number of listings to skip. |
| `limit` | integer | No | Number of listings to return, 1 to 100. |

## Example request

```bash
#!/bin/bash

curl -X GET \
    -H "x-api-key: YOUR_API_KEY_HERE" \
    "https://scrappa.co/api/madlan/search?deal_type=unitRent&price_min=0&price_max=6000&beds=3&limit=3"
```

## Example response

```json
{
    "success": true,
    "offset": 0,
    "limit": 3,
    "matched_upstream": 3230,
    "total": null,
    "deal_type": "unitRent",
    "returned": 3,
    "filtered_out_by_deal_type": 0,
    "page_fill": 1,
    "listings": [
        {
            "id": "lcqaJQo4LjP",
            "price": 8000,
            "currency": "NIS",
            "dealType": "unitRent",
            "beds": 6,
            "baths": 2,
            "area": 150,
            "floor": "2",
            "address": "\u05e0\u05d5\u05e3 \u05d4\u05e8\u05d5\u05d3\u05d9\u05d5\u05df 1, \u05e0\u05d5\u05d5\u05d4 \u05d3\u05e0\u05d9\u05d0\u05dc",
            "description": "\u05de\u05d5\u05dc \u05e0\u05d5\u05e3 \u05e4\u05ea\u05d5\u05d7 \u05d5\u05e2\u05d5\u05e6\u05e8 \u05e0\u05e9\u05d9\u05de\u05d4 \u05e9\u05dc \u05d4\u05e8\u05d9 \u05d9\u05d4\u05d5\u05d3\u05d4, \u05d1\u05e9\u05db\u05d5\u05e0\u05d4 \u05d7\u05d3\u05e9\u05d4...",
            "structuredAddress": {
                "text": "\u05e0\u05d5\u05e3 \u05d4\u05e8\u05d5\u05d3\u05d9\u05d5\u05df 1, \u05e0\u05d5\u05d5\u05d4 \u05d3\u05e0\u05d9\u05d0\u05dc",
                "city": "\u05e0\u05d5\u05d5\u05d4 \u05d3\u05e0\u05d9\u05d0\u05dc",
                "streetName": "\u05e0\u05d5\u05e3 \u05d4\u05e8\u05d5\u05d3\u05d9\u05d5\u05df"
            },
            "locationPoint": {
                "lat": 32.1846,
                "lng": 34.9875
            },
            "images": [
                {
                    "imageUrl": "https://images.madlan.co.il/...",
                    "isFloorplan": false
                }
            ]
        }
    ],
    "notes": [
        "For sale and for rent are separated after the search returns: Madlan rejects every server-side deal type field, so rows are matched on their own deal type after they come back.",
        "matched_upstream is Madlan's own count and covers sale and rent together, because the deal type split happens after the search returns. On a deal_type query total is null for that reason: there is no honest total for the scoped subset.",
        "Madlan serves search results from a rotating shard set, so consecutive pages can overlap or skip. Use the listing corpus endpoint to enumerate ids.",
        "page_fill is the share of the requested page that was actually filled, after the deal type split removed rows. It is not a measure of how much of the corpus this request covered."
    ],
    "meta": {
        "attempts": 1,
        "duration_ms": 412
    }
}
```

## Errors

| Status | Error | Description |
| --- | --- | --- |
| 503 | Madlan rejected the query | Madlan answered the request but refused to compute it. Branch on `error.code`: this response is not retryable. Nothing is charged for a failed request. |
| 503 | Madlan refused the request | Madlan answered with a client-side rejection before running the query, for example a bad path or an unsupported document. Retrying the same request changes nothing. Branch on `error.code`: this response is not retryable. Nothing is charged. |
| 503 | Madlan returned an unreadable response | Madlan answered, but not with the shape this endpoint reads, for example an HTML page where structured data was expected. The request was not answered, so it is not billed. Branch on `error.code`: this response is not retryable. |
| 503 | Madlan is temporarily unavailable | The upstream could not be reached, returned a server error, or throttled the request. `rate_limited_upstream` is the throttle path and is retryable once the wait has passed; `upstream_unavailable` covers a connection that could not be established, a server error, and a listing corpus that is still cold — the corpus is built in the background, so a cold one is a 503 that schedules a rebuild rather than a fan-out inside your request. Branch on `error.code`, then try again shortly. Nothing is charged. |
| 422 | Invalid parameters | One or more parameters are missing, out of range, or a filter Madlan cannot apply. Filters it cannot apply are refused rather than ignored, so the response never carries the unfiltered corpus in answer to a filter. The response lists the offending fields. |
| 404 | No record under that id | The id is well-formed and Madlan answered, but nothing is published under it. The body carries `found => false`. The lookup was answered, so it is billed; unlike a 503 this is not an upstream fault and retrying will not change it. |

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