# OnTheMarket Agent Branch API Documentation

<p><strong>OnTheMarket Agent Branch API</strong> returns one estate-agent branch profile from OnTheMarket as JSON. The response carries the branch id, name, company name, address, postcode, telephone, public branch url, logo, coordinates, social links, hero image, description, affiliation titles, featured sale and rent listings and the public search urls for the branch.</p>

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

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

## Example response

```json
{
    "data": {
        "agent": {
            "name": "Bairstow Eves - Stratford",
            "address": "142 The Grove\nStratford\nE15 1NS",
            "socials": {
                "facebook": "https://www.facebook.com/BairstowEvesEstateAgents"
            },
            "location": {
                "lat": 51.544062,
                "lon": 0.004052
            },
            "logo_url": "https://media.onthemarket.com/agents/companies/14646/260126141925387/logo-300x200.jpg",
            "postcode": "E15 1NS",
            "branch_id": 73402,
            "telephone": "020 4645 2667",
            "hero_image": {
                "title": "House",
                "mobile_image_url": "https://media.onthemarket.com/agent-hero-images/default-5-mobile.jpg",
                "desktop_image_url": "https://media.onthemarket.com/agent-hero-images/default-5-desktop.jpg"
            },
            "description": "<p>Since 1899, Bairstow Eves has provided trusted expertise with extensive local knowledge.</p>",
            "details_url": "https://www.onthemarket.com/agents/branch/bairstow-eves-stratford/",
            "affiliations": [
                "ARLA logo",
                "NAEA logo",
                "TPO logo"
            ],
            "sale_preview": [
                {
                    "id": "20035804",
                    "agent": {
                        "name": "Frank Innes - Mapperley",
                        "logo_url": "https://media.onthemarket.com/agents/companies/14665/260126142222870/logo-190x100.jpg",
                        "branch_id": 73818,
                        "telephone": "0115 691 4648",
                        "details_url": "https://www.onthemarket.com/agents/branch/frank-innes-mapperley/"
                    },
                    "price": "\u00a3275,000",
                    "images": [
                        {
                            "url": "https://media.onthemarket.com/properties/20035804/1651432388/image-0-480x320.jpg",
                            "webp_url": "https://media.onthemarket.com/properties/20035804/1651432388/image-0-480x320.webp"
                        }
                    ],
                    "tenure": "Freehold",
                    "address": "Marshall Road, Nottingham, Nottinghamshire, NG3",
                    "reduced": true,
                    "bedrooms": 2,
                    "features": [
                        "Tenure: Freehold",
                        "Detached Bungalow",
                        "Two Bedrooms",
                        "Modernised Throughout"
                    ],
                    "for_sale": true,
                    "location": {
                        "lat": 52.977144,
                        "lon": -1.115554
                    },
                    "postcode": "NG3",
                    "bathrooms": 1,
                    "spotlight": true,
                    "main_label": "Reduced",
                    "cover_image": {
                        "url": "https://media.onthemarket.com/properties/20035804/1651432388/image-0-480x320.jpg",
                        "webp_url": "https://media.onthemarket.com/properties/20035804/1651432388/image-0-480x320.webp"
                    },
                    "price_value": 275000,
                    "images_count": 17,
                    "property_url": "https://www.onthemarket.com/details/20035804/",
                    "virtual_tour": true,
                    "data_label_id": "reduced",
                    "online_viewing": true,
                    "property_title": "2 bedroom bungalow for sale",
                    "address_locality": "Nottinghamshire",
                    "floorplans_count": 1,
                    "days_since_added_reduced": "Reduced < 7 days"
                }
            ],
            "search_to_rent_url": "https://www.onthemarket.com/agents/branch/bairstow-eves-stratford/properties/?let-agreed=true&search-type=to-rent",
            "search_for_sale_url": "https://www.onthemarket.com/agents/branch/bairstow-eves-stratford/properties/?search-type=for-sale&under-offer=true"
        }
    },
    "meta": {
        "billable": true,
        "endpoint_family": "agent"
    },
    "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)
