# OnTheMarket Scraper \[~$0.96/1K💰] | UK Property | Rent & Sale (`ahmed_jasarevic/onthemarket-scraper`) Actor

Scrape UK property listings for sale & rent from OnTheMarket.com: price, address, beds/baths, tenure, EPC rating, floorplans, photos, agent details & GPS. Reads embedded **NEXT\_DATA** JSON — no browser. Cheapest at ~$0.96 per 1,000 listings (details +$1/1K).

- **URL**: https://apify.com/ahmed\_jasarevic/onthemarket-scraper.md
- **Developed by:** [Ahmed Jasarevic](https://apify.com/ahmed_jasarevic) (community)
- **Stats:** 2 total users, 1 monthly users, 100.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

from $0.96 / 1,000 results

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/actors/running/actors-in-store.md#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 Scraper

Scrape UK property listings for **sale and rent** from [OnTheMarket.com](https://www.onthemarket.com) — one of the UK's leading property portals. Extract price, address, bedrooms/bathrooms, tenure, EPC rating, photos, floorplans, full description, and agent details (name, phone, branch address). Supports location-based search with filters (price range, bedrooms, property type) and automatic pagination.

### Strategy

This actor uses **CheerioCrawler** (plain HTTP, no browser) by extracting data from the **`__NEXT_DATA__` embedded JSON blob** served in OnTheMarket's Next.js HTML. This is the cheapest and fastest approach — no browser rendering, no anti-bot bypass needed for standard use. The site serves server-side rendered HTML with all listing data pre-embedded in the `__NEXT_DATA__` script tag.

**Data surfaces used:**

- **Search results pages** (`/for-sale/{type}/{location}/`): 30 listings per page with price, address, beds/baths, tenure, images, agent info, lat/lng
- **Property detail pages** (`/details/{id}/`): full description, EPC rating, floorplans, full-size images, detailed agent info (opt-in via `scrapeDetails`)

**Why CheerioCrawler:** OnTheMarket is a Next.js app that server-side renders all listing data into `__NEXT_DATA__` JSON. No JavaScript execution is needed — the data is already in the HTML source. This makes CheerioCrawler ~10x faster and cheaper than Playwright.

### Why Use This Scraper?

- **UK property investors** — monitor new listings, track prices, analyze market trends across locations
- **Letting agents** — competitive intelligence on rental listings, pricing benchmarks
- **PropTech companies** — build comp databases, monitoring pipelines, valuation datasets
- **Relocation services** — aggregate listings matching client criteria automatically

### How to Use

1. Go to the [Input tab](https://console.apify.com/actors/onthemarket-scraper/input) and configure your search parameters
2. Set **Search Type** to "For Sale" or "To Rent"
3. Enter a **Location** slug (e.g., `london`, `manchester`, `south-east-london`, `w4` — check [onthemarket.com](https://www.onthemarket.com) for available slugs)
4. Optionally set price range, bedrooms, property type, and max pages
5. Enable **Scrape Details** if you need full descriptions, EPC ratings, and floorplans (increases run time)
6. Click **Start** and monitor the run

### Input

| Field | Type | Default | Description |
|-------|------|---------|-------------|
| Search Type | select | `for-sale` | `for-sale` or `to-rent` |
| Property Type | select | (all) | houses, flats, bungalows, land, commercial |
| Location | string | `london` | URL slug from onthemarket.com |
| Min Price | integer | — | Minimum price in GBP |
| Max Price | integer | — | Maximum price in GBP |
| Min Bedrooms | integer | — | Minimum bedrooms |
| Max Bedrooms | integer | — | Maximum bedrooms |
| Max Pages | integer | `3` | Pages to scrape (30 listings/page) |
| Scrape Details | boolean | `false` | Fetch detail pages for EPC/description/floorplans |
| Max Items | integer | `100` | Total listings to scrape |
| Proxy Configuration | object | Apify proxy | Proxy settings |

### Output Example

```json
{
  "id": "20284906",
  "price": "£1,100,000",
  "priceRaw": 1100000,
  "address": "Riverview Road, Chiswick, W4",
  "locality": "London",
  "bedrooms": 4,
  "bathrooms": 2,
  "propertyType": "Terraced house",
  "tenure": "Freehold",
  "epcRating": "C",
  "description": "Set on one of Chiswick's quieter residential roads...",
  "floorplans": [
    {
      "url": "https://media.onthemarket.com/properties/20284906/.../floor-plan-0-1024x1024.jpg",
      "caption": "Floorplan"
    }
  ],
  "images": [
    {
      "url": "https://media.onthemarket.com/properties/20284906/.../image-0-1024x1024.jpg",
      "caption": null
    }
  ],
  "agent": {
    "name": "RiverHomes - West London Branch",
    "phone": "020 8115 0694",
    "address": "28 Thames Road\nChiswick, London\nW4 3RJ",
    "logo": "https://media.onthemarket.com/agents/companies/7028/.../logo-original.jpg"
  },
  "location": { "lat": 51.483757, "lon": -0.275877 },
  "virtualTour": true,
  "url": "https://www.onthemarket.com/details/20284906/",
  "scrapedAt": "2026-09-09T12:00:00.000Z"
}
```

### Data Fields

| Field | Source | Description |
|-------|--------|-------------|
| `id` | Search/Detail | OnTheMarket property ID |
| `price` | Search/Detail | Human-readable price (e.g., "£1,100,000") |
| `priceRaw` | Detail only | Raw numeric price |
| `address` | Search/Detail | Full address string |
| `bedrooms` | Search/Detail | Number of bedrooms |
| `bathrooms` | Search/Detail | Number of bathrooms |
| `propertyType` | Search/Detail | e.g., "Terraced house", "Flat" |
| `tenure` | Search/Detail | e.g., "Freehold", "Leasehold" |
| `epcRating` | Detail only | Energy Performance Certificate rating (A-G) |
| `description` | Detail only | Full property description |
| `floorplans` | Detail only | Array of floorplan image URLs |
| `images` | Search/Detail | Array of property photos |
| `agent.name` | Search/Detail | Agent/branch name |
| `agent.phone` | Search/Detail | Agent phone number |
| `agent.address` | Detail only | Agent branch address |
| `location` | Search/Detail | `{ lat, lon }` coordinates |
| `detailUrl` | Search | Link to full property page |

You can download the dataset in various formats such as JSON, HTML, CSV, or Excel from the Apify Console.

### Pricing / Cost

- **Free tier**: Limited to 10 listings per run (preview mode)
- **Paid tier**: Full access up to 5,000 listings per run
- Each search page request counts as 1 request; detail pages (when enabled) count as 1 request each
- Running on Apify proxy is recommended for reliability

### Tips

- **Faster runs**: Keep `Scrape Details` disabled to get 30 listings per page request without visiting individual pages
- **More data**: Enable `Scrape Details` for EPC ratings, full descriptions, and floorplans
- **Location slugs**: Visit onthemarket.com, search for your area, and copy the location slug from the URL (e.g., `south-east-london`, `manchester`, `w4`)
- **Cost control**: Set `Max Items` and `Max Pages` to limit compute usage
- **Proxy**: Uses Apify proxy by default. For heavy scraping, consider residential proxy groups

### Legal Disclaimer

This actor is provided for legitimate data extraction purposes. Users are responsible for compliance with OnTheMarket.com's Terms of Service and applicable laws. Do not use this data for spam, unsolicited communications, or any purpose that violates the site's terms. Always respect rate limits and use proxy rotation.

### Support

For issues, feature requests, or custom modifications, please open an issue on the Apify platform.

# Actor input Schema

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

Whether to search for sale or rental listings.

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

Filter by property type. 'property' = all types. Check onthemarket.com for available slugs.

## `location` (type: `string`):

Location slug from the URL (e.g. 'london', 'manchester', 'south-east-london', 'w4'). Check onthemarket.com for available location slugs.

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

Minimum price filter (in GBP). Leave empty for no minimum.

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

Maximum price filter (in GBP). Leave empty for no maximum.

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

Minimum number of bedrooms.

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

Maximum number of bedrooms.

## `scrapeDetails` (type: `boolean`):

If enabled, fetches each property's detail page for full description, EPC rating, floorplans, and full-size images. Charges per detail via pay-per-event (event: detail\_scraped). Significantly increases run time.

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

Maximum number of listings to scrape in total (across all pages).

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

Proxy settings for the crawler.

## Actor input object example

```json
{
  "searchType": "for-sale",
  "propertyType": "",
  "location": "london",
  "scrapeDetails": false,
  "maxItems": 100,
  "proxyConfiguration": {
    "useApifyProxy": true
  }
}
```

# Actor output Schema

## `dataset` (type: `string`):

No description

# 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 = {};

// Run the Actor and wait for it to finish
const run = await client.actor("ahmed_jasarevic/onthemarket-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 = {}

# Run the Actor and wait for it to finish
run = client.actor("ahmed_jasarevic/onthemarket-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 '{}' |
apify call ahmed_jasarevic/onthemarket-scraper --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "type": "http",
            "url": "https://mcp.apify.com/?tools=fetch-actor-details,ahmed_jasarevic/onthemarket-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/gDCnlh3PO07tBGUcX/builds/30V7ksAzSxTfnnNph/openapi.json
