# OnTheMarket Property Scraper (UK) (`scrapyx/onthemarket-properties-scraper`) Actor

Scrapes houses, flats and land for sale or to rent from OnTheMarket — the UK's #3 property portal after Rightmove and Zoopla. Search any town, city or outcode with price and bedroom filters; returns price, address, bedrooms, EPC, floorplans, full descriptions, photos and agent details.

- **URL**: https://apify.com/scrapyx/onthemarket-properties-scraper.md
- **Developed by:** [Ibnu Adzim](https://apify.com/scrapyx) (community)
- **Categories:** Real estate
- **Stats:** 2 total users, 1 monthly users, 100.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

from $0.0007 / actor start

This Actor is paid per event. You are not charged for the Apify platform usage, but only a fixed price for specific events.
Since this Actor supports Apify Store discounts, the price gets lower the higher subscription plan you have.

Learn more: https://docs.apify.com/platform/actors/running/actors-in-store#pay-per-event

## What's an Apify Actor?

Actors are web data automations that power AI and operations. They run on the Apify platform to scrape websites, process data, connect APIs, and automate workflows.
In Batch mode, an Actor accepts a well-defined JSON input, performs an action which can take anything from a few seconds to a few hours,
and optionally produces a well-defined JSON output, datasets with results, or files in key-value store.
In Standby mode, an Actor provides a web server which can be used as a website, API, or an MCP server.
Actors are written with capital "A".

## How to integrate an Actor?

If asked about integration, you help developers integrate Actors into their projects.
You adapt to their stack and deliver integrations that are safe, well-documented, and production-ready.
The best way to integrate Actors is as follows.

- **AI agents and MCP clients** — the [Apify MCP server](https://docs.apify.com/integrations/mcp.md) at `https://mcp.apify.com` (remote, streamable HTTP, OAuth on first use).
- **Agentic workflows and local Actor development** — [Agent Skills](https://apify.com/.well-known/agent-skills/index.json) with the [Apify CLI](https://docs.apify.com/cli/docs.md): `npm install -g apify-cli`, then `apify login`.
- **JavaScript/TypeScript projects** — the official [JS/TS client](https://docs.apify.com/api/client/js/docs.md): `npm install apify-client`.
- **Python projects** — the official [Python client](https://docs.apify.com/api/client/python/docs.md): `pip install apify-client`.
- **Any other language** — the [REST API](https://docs.apify.com/api/v2.md).

For usage examples, see the [API](#api) section below.

For more details, see Apify documentation as [Markdown index](https://docs.apify.com/llms.txt) and [Markdown full-text](https://docs.apify.com/llms-full.txt).

# README

## OnTheMarket Property Scraper (UK)

Scrapes houses, flats and land for sale or to rent from
**[OnTheMarket](https://www.onthemarket.com)** — the UK's #3 property portal
after Rightmove and Zoopla, and the one with by far the least scraper
competition.

Public data only. No login, no cookies, no browser.

### What you get

Two record types share one dataset, told apart by `recordType`.

#### `PROPERTY` — one row per listing

Search rows carry price, address, bedrooms, bathrooms, property type,
key features, coordinates, agent and all photos. With **Fetch full property
details** on (the default), each row also gets a `propertyDetails` object:

- the full description text
- **EPC** (energy performance) rating and certificate
- floorplans and additional documents
- `keyInfo` — tenure, council tax band, ground rent, service charge
- the complete photo set
- agent details and branch
- `areaStats` — local area context

#### `SEARCH_SUMMARY` — one row per location searched

Upstream's match total, how deep the run paged, which filters you requested
next to **what OnTheMarket says it actually applied**, and whether the query
hit the portal's row ceiling.

### Input

| Field | What it does |
| --- | --- |
| **For sale / to rent** | which side of the market |
| **Property type** | all property, houses, flats, bungalows, detached, semi-detached, terraced, land, farms, mews, character property |
| **Locations** | one search per entry: `london`, `manchester`, `sw1`, `greater-london`… human spellings like `Milton Keynes` are slugified for you |
| **Price / bedrooms** | min–max ranges |
| **Search radius** | widen around the location, in miles |
| **New homes only** | restrict to new builds |
| **Sort by** | default, recently updated, price, or keyword relevance |
| **Property URLs** | scrape specific listings directly, skipping search |
| **Max properties per location** | `0` = unlimited (up to the portal's own 1,020 ceiling) |
| **Fetch full property details** | off = fast listing-only crawl, 1 request per 30 properties |

#### Example

```json
{
  "searchType": "for-sale",
  "propertyType": "houses",
  "locations": ["bristol", "bath", "cheltenham"],
  "minPrice": 300000,
  "minBedrooms": 3,
  "maxItems": 500,
  "includePropertyDetails": true
}
```

### Two things this actor is honest about

**1. OnTheMarket stops at ~1,020 rows per search — whatever it claims.**
A London search reports 50,000 matches but goes empty after page 34. This is
the portal's limit, not the actor's, and no scraper can page past it. When a
run hits it you get `resultCapReached: true` and a log line telling you to
split the area:

```
WARN  for-sale/houses/bristol: upstream reports 1566 matches but OnTheMarket stops
      paginating at 1020 rows per query -- split the area into smaller locations,
      or narrow by price/bedrooms, to reach the rest.
```

That is exactly why **Locations is a list** — several narrow searches return
far more data than one broad one.

**2. A bad sort value returns zero results, not an error.** OnTheMarket answers
an unrecognised `sort-field` with HTTP 200 and an empty list, which would look
like "no properties match" rather than a typo. This actor validates the sort
before the first request and refuses the run instead, so you never get a
silently empty dataset.

Every run also reports `filtersRequested` next to `upstreamCriteriaText`
(OnTheMarket's own description of what it applied, e.g. `"£300k +, 3 beds +,
House"`), so you can confirm your filters landed.

### Notes on reliability

- **No WAF challenge.** Serves data cold on every TLS profile tested.
- **Runs unattended.** No human-captured session, no expiring token.
- **Unknown locations fail cleanly** as `not_found` — never silently-wrong
  nationwide results.
- **Residential proxy by default** on cloud runs.
- **Failures never vanish.** A listing withdrawn mid-crawl degrades that one
  row (`_detailError`); every input maps to at least one output row.

### Output envelope

Every record carries `_input`, `_source` and `_scrapedAt`. Upstream field names
pass through **verbatim** — no renaming. `_source` is `S1-nextdata-search` for
listing-only rows and `S1-nextdata-search+S2-nextdata-detail` once details are
attached.

Note `location` on a property row is upstream's `{lat, lon}`; the location you
searched is `locationQueried`.

See [`CRAWLING_METHOD.md`](CRAWLING_METHOD.md) for the full reverse-engineering
trail, the pagination-ceiling bisection and the sort-trap evidence.

# Actor input Schema

## `searchType` (type: `string`):

Which side of the market to search.

## `propertyType` (type: `string`):

Only these values are real OnTheMarket path segments — anything else returns HTTP 404. Use 'All property' unless you specifically want to narrow.

## `locations` (type: `array`):

OnTheMarket location slugs — one search per entry, each with its own SEARCH\_SUMMARY row. Towns, cities and outcodes all work: london, manchester, birmingham, bristol, leeds, edinburgh, sw1, greater-london. A human spelling like 'Milton Keynes' is slugified automatically. An unknown location returns a clean 404 reported as not\_found, never silently-wrong results.

Because OnTheMarket caps each query at ~1,020 rows, several narrow locations return far more data than one broad one.

## `minPrice` (type: `integer`):

Leave empty or 0 for no minimum.

## `maxPrice` (type: `integer`):

Leave empty or 0 for no maximum.

## `minBedrooms` (type: `integer`):

Leave empty or 0 for any.

## `maxBedrooms` (type: `integer`):

Leave empty or 0 for any.

## `radius` (type: `integer`):

Widen the search around the location by this many miles. Leave empty or 0 for the location only.

## `newHomesOnly` (type: `boolean`):

Restrict results to new-build properties.

## `sortField` (type: `string`):

Leave as default unless you need a specific order. Only these values work — OnTheMarket answers an unrecognised sort with HTTP 200 and ZERO results rather than an error, so anything else is refused before the run starts.

## `sortOrder` (type: `string`):

Only applies when a sort field is chosen.

## `propertyUrls` (type: `array`):

Scrape specific listings directly, skipping search. Accepts a full URL (https://www.onthemarket.com/details/18956817/) or a bare numeric id. Can be combined with a location search in the same run.

## `maxItems` (type: `integer`):

Stop paginating a location after this many properties. Set to 0 for unlimited — note OnTheMarket itself stops at 1,020 rows per query (34 pages × 30) however many matches it reports, so unlimited means 'up to 1,020'. Split into smaller locations to reach the rest.

## `includePropertyDetails` (type: `boolean`):

Fetch the complete listing (full description, EPC, floorplans, key info, agent details, area stats, all photos) for each result via one extra request per property. Turn this off for a fast listing-only crawl — search rows already carry price, address, bedrooms, bathrooms, property type, features and photos.

## `maxConcurrency` (type: `integer`):

Upper bound on requests in flight at once, across location pagination and detail fetches.

## `proxyConfiguration` (type: `object`):

OnTheMarket runs no active bot challenge and a direct connection works, but Residential is the default for cloud runs — container egress is a different posture than a home connection, and this portfolio has lost a full cloud run to that difference before.

## Actor input object example

```json
{
  "searchType": "for-sale",
  "propertyType": "property",
  "locations": [
    "london"
  ],
  "minPrice": 0,
  "maxPrice": 0,
  "minBedrooms": 0,
  "maxBedrooms": 0,
  "radius": 0,
  "newHomesOnly": false,
  "sortField": "",
  "sortOrder": "",
  "propertyUrls": [],
  "maxItems": 100,
  "includePropertyDetails": true,
  "maxConcurrency": 4,
  "proxyConfiguration": {
    "useApifyProxy": true,
    "apifyProxyGroups": [
      "RESIDENTIAL"
    ]
  }
}
```

# Actor output Schema

## `items` (type: `string`):

One row per scraped record. See the dataset's default view for field definitions.

# API

You can run this Actor programmatically using our API. Below are code examples in JavaScript, Python, and CLI, as well as the OpenAPI specification and MCP server setup.

## JavaScript example

```javascript
import { ApifyClient } from 'apify-client';

// Initialize the ApifyClient with your Apify API token
// Replace the '<YOUR_API_TOKEN>' with your token
const client = new ApifyClient({
    token: '<YOUR_API_TOKEN>',
});

// Prepare Actor input
const input = {
    "locations": [
        "london"
    ]
};

// Run the Actor and wait for it to finish
const run = await client.actor("scrapyx/onthemarket-properties-scraper").call(input);

// Fetch and print Actor results from the run's dataset (if any)
console.log('Results from dataset');
console.log(`💾 Check your data here: https://console.apify.com/storage/datasets/${run.defaultDatasetId}`);
const { items } = await client.dataset(run.defaultDatasetId).listItems();
items.forEach((item) => {
    console.dir(item);
});

// 📚 Want to learn more 📖? Go to → https://docs.apify.com/api/client/js/docs

```

## Python example

```python
from apify_client import ApifyClient

# Initialize the ApifyClient with your Apify API token
# Replace '<YOUR_API_TOKEN>' with your token.
client = ApifyClient("<YOUR_API_TOKEN>")

# Prepare the Actor input
run_input = { "locations": ["london"] }

# Run the Actor and wait for it to finish
run = client.actor("scrapyx/onthemarket-properties-scraper").call(run_input=run_input)

# Fetch and print Actor results from the run's dataset (if there are any)
print(f"💾 Check your data here: https://console.apify.com/storage/datasets/{run.default_dataset_id}")
for item in client.dataset(run.default_dataset_id).iterate_items():
    print(item)

# 📚 Want to learn more 📖? Go to → https://docs.apify.com/api/client/python/docs/quick-start

```

## CLI example

```bash
echo '{
  "locations": [
    "london"
  ]
}' |
apify call scrapyx/onthemarket-properties-scraper --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "type": "http",
            "url": "https://mcp.apify.com/?tools=fetch-actor-details,scrapyx/onthemarket-properties-scraper"
        }
    }
}

```

The hosted server signs you in with OAuth on first connect, so no API token belongs in this config. Clients without OAuth support can send an `Authorization: Bearer <APIFY_API_TOKEN>` header instead, using a token from API & Integrations in Apify Console (https://console.apify.com/settings/integrations).

## OpenAPI specification

Download the OpenAPI definition: https://api.apify.com/v2/actors/5Hl3ObQ23SRnQEV0W/builds/w705JqQJqnXchMdpi/openapi.json
