DEV Community

Ben
Ben

Posted on

How to Scrape UK Property Listings from OnTheMarket — Python + No-Code

If you want UK property data, everyone fights over Rightmove and Zoopla — both of
which block hard. OnTheMarket, Britain's third major portal, is far more
accessible and carries the same agent-listed for-sale and to-rent inventory. Better
still, it's a modern site that ships its listing data as structured JSON inside the
page, so you get clean, typed fields without brittle HTML scraping.

Why OnTheMarket?

  • Accessible — unlike Rightmove/Zoopla, it doesn't immediately wall off basic requests, so you don't need heavy residential proxies for modest runs.
  • Structured data built in — it's a Next.js site that embeds the full results set as JSON, so fields come out typed and consistent.
  • For sale and to rent — the same source covers both, nationwide.

Read the embedded JSON (Python)

OnTheMarket renders results into a __NEXT_DATA__ script tag. Parse it instead of
scraping cards:

import httpx, json, re

html = httpx.get("https://www.onthemarket.com/for-sale/property/london/",
                 headers={"User-Agent": "Mozilla/5.0"}, timeout=30).text
data = json.loads(re.search(r'<script id="__NEXT_DATA__"[^>]*>(.*?)</script>', html, re.S).group(1))
for p in data["props"]["initialReduxState"]["results"]["list"]:
    print(p["property-title"], "", p["price"], "", p["address"])
Enter fullscreen mode Exit fullscreen mode

Each listing carries price, bedrooms, property type, address, agent and even
latitude/longitude. Pagination is just ?page=2, ?page=3, …

The catch: filters, paging & clean fields

A useful dataset means resolving location slugs, threading price/bedroom filters,
paging through thousands of results, mapping the raw keys into clean fields
(price_value as a number, geo-coordinates, agent contact) and skipping the promo
cards mixed into the list. That's the part worth automating.

The no-code option

The OnTheMarket Scraper on
Apify does it — pick for-sale or to-rent, a location, optional price/bedroom filters,
click Run.

{
  "listingType": "for-sale",
  "location": "manchester",
  "minPrice": 200000,
  "maxPrice": 500000,
  "minBedrooms": 2,
  "maxResults": 200
}
Enter fullscreen mode Exit fullscreen mode

Output is one clean row per property — price (text + numeric), bedrooms, type,
address, agent name & phone, latitude/longitude, features, image and URL — ready for
mapping, dashboards or a property product.

Common use cases

  • UK market analysis — track asking prices and supply by area, type and beds.
  • Lead generation — build estate-agent and listing lead lists with contacts.
  • Proptech & portals — power a search product or alerting tool with fresh listings.
  • Investment sourcing — filter by price/beds/location, then map with the geo data.

FAQ

Do I need an API key? No — just a location (or a search URL) and your filters.

For sale and to rent? Both — set listingType.

Do listings include geo-coordinates? Yes — every listing has latitude/longitude.

Is it legal? You're reading publicly available listing data. Use it responsibly
and within applicable laws and OnTheMarket's terms.


Building something with UK property data? The OnTheMarket Scraper handles it. See also the Redfin Scraper and Craigslist Real Estate Scraper.

Top comments (0)