# OnTheMarket Property Scraper (`nanodata/onthemarket-property-scraper`) Actor

Collect UK property listings for sale and to rent from OnTheMarket list pages: price, bedrooms, address, agent, photo links and dates. Pay per listing.

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

## Pricing

from $0.80 / 1,000 onthemarket listing scrapeds

This Actor is paid per event. You are not charged for the Apify platform usage, but only a fixed price for specific events.

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

## What's an Apify Actor?

An Actor is a serverless cloud program that runs on the Apify platform. It has two run modes.
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.

Apify vocabulary and the platform model are defined once, in the agent quickstart at https://apify.com/agents.md.

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

Do not guess an integration path. Every one of them is in the agent quickstart at https://apify.com/agents.md: the Apify MCP server, Agent Skills with the Apify CLI, the JavaScript and Python clients, the REST API, and the account-free path for an agent with no human to sign in. It also carries the rule on stating cost before the first paid run.

For examples already wired to this Actor's own input schema, see the [API](#api) section below.

Each client library has reference documentation the quickstart does not restate: [JavaScript/TypeScript](https://docs.apify.com/api/client/js/docs.md) (`npm install apify-client`) and [Python](https://docs.apify.com/api/client/python/docs.md) (`pip install apify-client`).

# README

## OnTheMarket Property Scraper

Collect UK property listings from [OnTheMarket](https://www.onthemarket.com) results pages, for sale or to rent. Give it one or more list links and get one structured row per listing: price, bedrooms, address, map position, tags, agent details and photo links.

### What you can do with it

- Track asking prices and new listings in a town, county or London.
- Compare sale and rental prices for the same area.
- Find reduced, chain free, shared ownership, retirement and new home listings through the `tags` field.
- Build lists of listings with the agent branch and phone number shown on the page.
- Feed a spreadsheet, dashboard or alert with fresh listings every day.

An empty input (`{}`) runs a small demo: homes for sale in London, 5 listings.

### Input

| Field | Type | Description | Default |
|-------|------|-------------|---------|
| `startUrls` | string\[] | OnTheMarket results links for sale (`/for-sale/...`) or to rent (`/to-rent/...`). Add `?page=N` to start at a later page. | London, for sale (demo) |
| `maxResults` | integer | Maximum listings for each start link, 1 to 1000. | 50 (5 in the demo) |

Example:

```json
{
  "startUrls": [
    "https://www.onthemarket.com/for-sale/property/london/",
    "https://www.onthemarket.com/to-rent/property/manchester/"
  ],
  "maxResults": 40
}
```

Numbers may be given as text (`"40"`). A value that is not a number stops the run with a clear message in the run status.

#### Links the actor will not open

The actor follows the rules in the site's robots.txt. A start link is skipped, with a message in the log and the run status, when the rules do not allow it. This covers, for example:

- links with `/flat/` or `/apartment/` in the path,
- bedroom count pages other than the plain, flats and houses variants (for example `3-bed-detached`),
- links with filter or sort parameters such as `max-price`, `min-price`, `radius`, `sort-field` or `view=map`,
- agent search, agent contact and similar pages.

The actor opens results pages only. It never opens listing photos, floor plans or energy certificates. If every start link is skipped, the run stops at the start and nothing is charged.

### Output

One row per listing. Fields the page does not show are `null`. Sponsored advert cards in the results are left out.

| Field | Description |
|-------|-------------|
| `property_id`, `url` | OnTheMarket listing id and link |
| `transaction` | `sale` or `rent` |
| `title`, `property_type` | Short title and type, for example `2 bedroom flat for sale` and `Flat` |
| `price_text`, `price_amount`, `price_currency` | Price as shown, as a number, and `GBP` |
| `price_qualifier`, `price_short` | Qualifier such as `Guide price` or `Shared ownership`, and the short price |
| `rent_period`, `rent_per_week` | Rent period (`pcm`) and the weekly rent when shown |
| `bedrooms`, `bathrooms` | Room counts |
| `address`, `postcode_district` | Address as shown and the postcode district read from it |
| `latitude`, `longitude` | Map position when shown |
| `tenure`, `features` | Tenure and the feature lines on the card |
| `tags` | Labels worked out from the listing text: new home, retirement, auction, shared ownership, chain free, reduced, recently added, featured |
| `main_label`, `added_reduced_text`, `icon_labels` | Card label, added or reduced text, badges |
| `has_virtual_tour`, `is_premium`, `premium_text`, `is_spotlight` | Card flags |
| `fees_label`, `fees_text` | Tenant fees note on rent listings |
| `image_count`, `cover_image_url`, `image_urls` | Photo links exactly as given by the site. Photos are not downloaded |
| `agent_id`, `agent_name`, `agent_url`, `agent_phone`, `agent_logo_url` | Agent or developer details as shown for the listing |
| `development_features` | Development summary lines on new home listings |
| `search_query`, `search_url`, `page_number` | Which start link and results page found the listing |
| `data_source`, `scraped_at` | Always `website`, and the UTC collection time |

Sample row (shortened):

```json
{
  "property_id": 20560690,
  "url": "https://www.onthemarket.com/details/20560690/",
  "title": "3 bedroom flat for sale",
  "transaction": "sale",
  "property_type": "Flat",
  "price_text": "£375,000",
  "price_amount": 375000,
  "price_currency": "GBP",
  "price_qualifier": "Offers in excess of",
  "bedrooms": 3,
  "bathrooms": 2,
  "address": "Sydenham Road, London, SE26",
  "postcode_district": "SE26",
  "latitude": 51.426194,
  "longitude": -0.05367,
  "tenure": "Share of freehold",
  "tags": ["reduced", "featured"],
  "added_reduced_text": "Reduced < 7 days",
  "image_count": 5,
  "agent_name": "Mann - Sydenham",
  "agent_phone": "020 8115 3261",
  "agent_url": "https://www.onthemarket.com/agents/branch/mann-sydenham/",
  "search_query": "https://www.onthemarket.com/for-sale/property/london/",
  "page_number": 2,
  "data_source": "website"
}
```

Results are de-duplicated by listing id within a run, also after a restart.

### Run outcomes

| Situation | Result |
|-----------|--------|
| Listings found | Run succeeds, status "Delivered N listings." |
| Search has no listings, or the link has no results page | Run succeeds with 0 rows, nothing is charged, and the status says so |
| The charge limit you set is reached | Run succeeds and stops, status "Stopped at the max charge limit. N listings delivered." |
| Every start link is skipped by the site's rules, or the site does not answer any request | Run fails with a status that says what happened. Retry later if the site did not answer |
| Input is not valid (for example `maxResults` is not a number) | Run fails at the start with the reason in the status |

### Pricing

Pay per event:

| Event | Name | Price |
|-------|------|-------|
| Run start, charged once with the first delivered rows | `actor-start` | $0.001 |
| One listing delivered | `onthemarket-listing-result` | $0.0008 |

Nothing is charged when no listing is delivered. If you set a maximum total charge for the run, the run stops before a row would go over it. See the Pricing tab for current prices.

### Limitations

- The site shows about 34 pages of 30 listings for one search, so one link returns up to roughly 1000 listings. Split a large area into smaller towns or districts to cover more.
- The actor reads results pages only. It does not open each listing, so the full description, floor plans and the complete photo gallery are not included. `image_count` counts the photos given in the results data, which is usually a preview of 5.
- Filter and sort parameters in links are not allowed by the site's robots.txt, so use area links and filter the dataset afterwards.
- `tags` and `postcode_district` are worked out from the text on the card. A listing that does not mention a feature gets no tag for it.
- Some listings show no price, bedrooms, bathrooms or map position. Those fields are `null`.
- Page layout changes on the site can cause a run to fail until the actor is updated.

### FAQ

**Can I scrape both sale and rental listings?**
Yes. Use a `/for-sale/` link for sales and a `/to-rent/` link for rentals. You can mix both in one run.

**How many listings can I get from one link?**
Up to about 1000, because the site stops a search at about 34 pages. Use narrower areas to cover a larger market.

**Why do some fields come back empty?**
Listings only show what the agent published. Sale rows have no rent period, and many listings have no tenure, tags or map position.

**Can I use a link with filters?**
Not with the filter parameters that the site's robots.txt does not allow, for example price range, radius or sort order. Those links are skipped with a message. Use plain area links.

**How fresh is the data?**
Each run reads the live results pages, so rows reflect the site at the time of the run. `scraped_at` records the time.

**Can I get the full listing description or all photos?**
No. This actor returns what the results pages show: title, features, price, agent and photo links.

# Actor input Schema

## `startUrls` (type: `array`):

Links to OnTheMarket results pages for sale (/for-sale/...) or to rent (/to-rent/...), for example https://www.onthemarket.com/for-sale/property/london/. Add ?page=N to start at a later page. Links that the site's robots.txt does not allow (for example flat, apartment or most bedroom-count facet pages, agent pages, photo and floor plan paths) are skipped with a message. Leave empty for a small demo (London, for sale, 5 listings).

## `maxResults` (type: `integer`):

Maximum listings returned for each start link. OnTheMarket shows about 34 pages of 30 listings for one search, so a single link returns up to roughly 1000.

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

Network settings for the run. The default works for most searches.

## Actor input object example

```json
{
  "startUrls": [
    "https://www.onthemarket.com/for-sale/property/london/"
  ],
  "maxResults": 50,
  "proxyConfiguration": {
    "useApifyProxy": true
  }
}
```

# Actor output Schema

## `defaultDataset` (type: `string`):

OnTheMarket property listings with price, rooms, address, agent and photo links

# 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 = {
    "startUrls": [
        "https://www.onthemarket.com/for-sale/property/london/"
    ],
    "proxyConfiguration": {
        "useApifyProxy": true
    }
};

// Run the Actor and wait for it to finish
const run = await client.actor("nanodata/onthemarket-property-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 = {
    "startUrls": ["https://www.onthemarket.com/for-sale/property/london/"],
    "proxyConfiguration": { "useApifyProxy": True },
}

# Run the Actor and wait for it to finish
run = client.actor("nanodata/onthemarket-property-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 '{
  "startUrls": [
    "https://www.onthemarket.com/for-sale/property/london/"
  ],
  "proxyConfiguration": {
    "useApifyProxy": true
  }
}' |
apify call nanodata/onthemarket-property-scraper --silent --output-dataset

```

## MCP server setup

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