Complete Guide: How to Pull UK Property Listings from OnTheMarket Using Python
A step-by-step guide to pulling OnTheMarket property listings into Python rows, with price, address, agent and coordinates fields.

This is a complete guide to reading UK property listings from OnTheMarket with Python. You will run the OnTheMarket Scraper Actor, set the transaction, location and caps, and print the fields a property search usually needs: price, address, bedrooms, agent and coordinates. The examples come from a search capture dated 2026-11-19.
OnTheMarket publishes its listings as public search pages. Each page shows a set of properties with price, address, bedrooms and the branch that advertises them. Reading one town this way means opening result pages one after another and copying the details into a sheet. The Actor does that reading for you and returns one dataset row per listing, so the next step is code, not copying.
We use the OnTheMarket Scraper Actor (reventadata/onthemarket-scraper) from Python with the official apify-client package. The Actor reads public search pages and needs no login. It returns the fields the listing shows in its search results.
Disclaimer: OnTheMarket is a trademark of its owner. The OnTheMarket Scraper is not affiliated with, authorised by or endorsed by OnTheMarket or CoStar Group. It only describes what the tool reads.
Prerequisites and setup
You need Python 3, an Apify account and your personal API token. Copy the token from API & Integrations in the Apify Console, then set it in your terminal:
export APIFY_API_TOKEN="your_apify_token_here"
Install the client. The ~=3.0 pin keeps the 3.x API the code below uses:
pip install -U "apify-client~=3.0"
Create a folder for the script. Nothing else is needed: no browser, no driver and no local copy of the Actor.
TL;DR
Set transaction, propertyType, location, maxItems and maxPages, call the Actor, and read the rows from its default dataset. The script below does all four steps and prints the price, address, bedrooms, agent and listing link of each property.
What you'll get
Each dataset row is one property. The fields this guide uses are id, url, title, address, propertyType, bedrooms, bathrooms, price, priceDisplay, priceQualifier, priceFrequency, latitude, longitude, agentName, agentPhone, addedOrReduced and searchUrl. The full row also carries key features, photo URLs and the agent's branch links.
The Actor is useful when a question needs many listings in one place: the average asking price for flats in a postcode district, the properties with a given number of bedrooms, or the agents who list the most stock in one town. Each of those is a sort or filter over rows, which is easier once the rows exist.
Understanding OnTheMarket Scraper
The Actor takes five inputs. transaction is buy for sale or rent for to rent. propertyType is property for all property types or houses for houses only. location is the location slug from an OnTheMarket search URL, such as london, manchester or newcastle-upon-tyne. maxItems caps the rows across all pages, and maxPages caps the number of search pages.
The site sets the limits. Each search page holds 30 listings, and search results stop at page 34, which is about 1,020 listings for one search. A larger area needs several narrower location slugs, merged by property id afterwards.
An unknown location slug ends the run with an error, and a search that matches nothing ends with a status message and no rows.
Step 1: Start the run from Python
Save this as onthemarket_listings.py:
import os
from apify_client import ApifyClient
# 1. Create the client with the token from your environment
client = ApifyClient(os.environ["APIFY_API_TOKEN"])
# 2. Define the search; the field names match the Actor's input schema
run_input = {
"transaction": "buy",
"propertyType": "property",
"location": "london",
"maxItems": 10,
"maxPages": 1,
}
# 3. Start the run and wait until it finishes
run = client.actor("reventadata/onthemarket-scraper").call(run_input=run_input)
if run is None or run.status != "SUCCEEDED":
status = run.status if run else "unknown"
raise SystemExit(f"Run did not succeed (status: {status}).")
# 4. Read the rows from the run's default dataset
items = client.dataset(run.default_dataset_id).list_items().items
print(f"Retrieved {len(items)} listings.")
Run it with python3 onthemarket_listings.py. The first line of output confirms the number of rows the dataset holds.
Step 2: Print the fields that matter
Add this under the script to print each listing:
for item in items:
print(f"Address: {item.get('address')}")
print(f" Price: {item.get('priceDisplay')}")
print(f" Beds: {item.get('bedrooms')}, baths: {item.get('bathrooms')}")
print(f" Agent: {item.get('agentName')} {item.get('agentPhone') or ''}".rstrip())
print(f" Listing: {item.get('url')}")
print("-" * 50)
Some fields are empty on some listings, so the code reads each one with get. Bedrooms, coordinates and key features are the ones most often missing.
Step 3: Save the rows
Write the rows to a JSON file with json.dump(items, f, ensure_ascii=False, indent=2), or export the dataset as CSV from the Apify Console. The ensure_ascii=False flag keeps the pound sign and accented street names as written.
Understanding your data
A row from the capture dated 2026-11-19, a London search for sale, is shown here with the fields this guide prints. The full row has more fields, listed in the Actor's output schema.
{
"id": "20762979",
"url": "https://www.onthemarket.com/details/20762979/",
"transaction": "buy",
"title": "1 bedroom flat for sale",
"address": "Holmewood Gardens, London SW2",
"propertyType": "Flat",
"bedrooms": 1,
"bathrooms": 1,
"price": 290000.0,
"currency": "GBP",
"priceFrequency": null,
"priceQualifier": "Offers in excess of",
"priceDisplay": "£290,000",
"latitude": 51.448513,
"longitude": -0.121948,
"addedOrReduced": "Added < 7 days",
"agentName": "Trevlyn Properties - Maidstone",
"agentPhone": "020 3641 3807",
"searchUrl": "https://www.onthemarket.com/for-sale/property/london/"
}
The fields are the listing's own:
priceis the number in GBP. On a rent search it is the rent amount, andpriceFrequencytells you whether it is per calendar month (pcm) or per week (pw).priceQualifierholds wording such as "Offers in excess of" when the listing uses it.addedOrReducedis the status tag the site shows, such as "Added < 7 days".agentNameandagentPhoneare the branch details the listing publishes.searchUrlis the search page that produced the row, so you can trace each row back to its search.
The flags isSpotlight, isRecentlyAdded and isExclusive are the site's own labels. The Actor copies them and does not judge them.
Pro tips and advanced usage
Use maxPages while you test. One page is enough to check the field names and the shape of the output before a large run.
Keep maxItems close to what you need. It caps rows across all pages, so a run stops once it has that many rows, which keeps the time and the dataset small.
Narrow the location before you raise the caps. When a search reaches the 34-page ceiling, split the area into smaller slugs and merge the results by id. Each property ID comes back once per run, but two runs for overlapping locations can return the same property, so deduplicate after you merge.
Set transaction to rent for rentals, and read priceFrequency before you compare numbers. A rent and a sale price are different kinds of figure, so keep them in separate tables.
Keep the token out of the script. Read it from the environment as in the code above, and never paste it into a shared file.
Working with the Apify API
The client call above is the whole API surface this guide needs. actor(...).call(run_input=...) starts the run and waits for it to finish, and returns a run object with status and default_dataset_id. dataset(...).list_items().items reads the rows from that dataset.
For a larger job, call the same two steps from a scheduled script and append each run's rows to a file named by date. Store the dataset ID with the file so a later run can be traced back to its input. The status check in Step 1 stops the script with a readable message when the run ends in any state other than success, so a failed run does not print an empty list as if it had worked.
If you prefer a different language, the Apify API accepts the same input as JSON, and the dataset can be read with an HTTP call. The field names in the rows do not change between languages.
Advanced usage patterns
A common pattern is to compare two runs. Run the same location for buy and rent on the same day, then compare the median price per bedroom count. Keep the two result sets separate because their prices use different units.
A second pattern is a watch list. Save the id values from one run, then on the next run print only the rows whose id is new. The addedOrReduced tag helps here, because the site labels recent additions and reductions itself.
For map work, the latitude and longitude fields are the listing's coordinates. They can be empty on some rows, so filter out the nulls before you plot them. Keep the url on each marker as well, so a reader who clicks it lands on the listing page the row came from.
Troubleshooting guide
An unknown location. The slug must match the search URL on onthemarket.com. Copy it from the address bar, for example london from /for-sale/property/london/. The run ends with an error when the slug is unknown.
A search that returns no rows. The run ends with a status message. Widen the location, or check that transaction and propertyType are the values the site uses.
Empty fields on some rows. Bedrooms, coordinates, agent details and key features are missing on some listings. Read every field with get and handle None.
Where to look. Open the run in the Apify Console. Its log has the status message, and a failed run names the input problem.
Best practices
Write the rows to a file before you analyse them, so the analysis can be rerun without a new run. Note the input you used beside the file, because the same location with a different transaction gives a different set of rows.
Use the caps while you build the script and remove them only when the output looks right. Without maxPages the run walks every page the site reports for the search, or stops once it reaches maxItems, which defaults to 1,000 rows.
Treat the listing data as the site published it. Prices, qualifiers and tags are copied as shown, so check the listing page before you quote a figure to someone else. Each row has a url field that points to the listing page, so any row can be checked against its source in one step.
Name each output file with the location, the transaction and the date, for example london-buy-2026-11-19.json, so files from different runs do not overwrite each other. Keep the input you used in the same folder, so the file can be reproduced later.
Conclusion and next steps
The script above turns one OnTheMarket search into rows you can sort, filter and store. Start with one location and one page, check the fields, then widen the search and schedule it with your usual tool.
For current pricing and details, see the Store page.
If you pull listings from a different town, tell us which slug you used in the comments, and we will add a note on any slug that behaves differently.
About the author
- Hi, I'm the engineer behind ReventaData. I build pay-per-event Apify Actors that turn public marketplace, classifieds, jobs and real-estate sites into clean, reliable datasets. Here on Hashnode, I share practical tutorials on collecting structured web data with Python and Apify, and on putting it to work: price tracking, lead lists and market analysis. Explore our turnkey scrapers: https://apify.com/reventadata
Comments
Join the discussionNo comments yet. Be the first to comment.




