# OnTheMarket Agent Listings API Documentation

<p><strong>OnTheMarket Agent Listings API</strong> returns the current property inventory of one estate-agent branch from OnTheMarket as JSON. The response carries the branch summary, paging metadata (one-based page, 30 listings per page and a has_more flag) and each listing card with the id, title, price and numeric GBP value, bedrooms, bathrooms, address, features, tenure, coordinates, labels and branch summary.</p>

- **Documentation:** [https://scrappa.co/docs/onthemarket-api/onthemarket_agent_listings](https://scrappa.co/docs/onthemarket-api/onthemarket_agent_listings)
- **API group:** OnTheMarket API
- **Endpoint:** `GET https://scrappa.co/api/onthemarket/agent-listings`

## 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 |
| --- | --- | --- | --- |
| `slug` | string | Yes | Agent branch slug, e.g. bairstow-eves-stratford. |
| `search_type` | string | Yes | for-sale or to-rent. |
| `page` | integer | No | One-based page number. 30 listings per page. Defaults to 1. |
| `under_offer` | boolean | No | Include under-offer properties. |
| `let_agreed` | boolean | No | Include let-agreed properties (to-rent only). |

## Example response

```json
{
    "data": {
        "agent": {
            "name": "Bairstow Eves - Stratford",
            "slug": "bairstow-eves-stratford"
        },
        "listings": [
            {
                "id": "18729963",
                "agent": {
                    "name": "Bairstow Eves - Stratford",
                    "branch_id": 73402,
                    "telephone": "020 4645 2667",
                    "details_url": "https://www.onthemarket.com/agents/branch/bairstow-eves-stratford/"
                },
                "price": "\u00a3195,000",
                "tenure": "Leasehold (98 years remaining)",
                "address": "Romford Road, London, E7",
                "bedrooms": 1,
                "features": [
                    "Tenure: Leasehold (98 years remaining)"
                ],
                "location": {
                    "lat": 51.54902,
                    "lon": 0.043963
                },
                "bathrooms": 1,
                "spotlight": true,
                "main_label": "Spotlight Property",
                "price_value": 195000,
                "short_price": "\u00a3195k",
                "property_url": "https://www.onthemarket.com/details/18729963/",
                "property_title": "1 bedroom flat for sale",
                "price_qualifier": "Offers over",
                "humanised_property_type": "Flat"
            }
        ],
        "search_metadata": {
            "page": 1,
            "has_more": true,
            "frame_size": 30,
            "total_results": 113,
            "total_results_display": "113"
        }
    },
    "meta": {
        "billable": true,
        "endpoint_family": "agent_listings"
    },
    "success": true
}
```

## Errors

| Status | Error | Description |
| --- | --- | --- |
| 422 | Validation Error | A public parameter is missing or invalid. This response is not billable. |
| 404 | Not Found | The agent branch slug is unknown. This response is not billable. |
| 502 | Invalid Source Response | OnTheMarket returned a response that could not be parsed. This response is not billable. |
| 503 | Service Unavailable | The upstream source is temporarily unavailable or returned an unexpected shape. This response is not billable and can be retried. |

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