# OnTheMarket Email Scraper (`leads-scraper/onthemarket-email-scraper`) Actor

OnTheMarket Email Scraper SD - OnTheMarket Email Scraper is a lead generation tool that extracts leads with public contact emails, account names and profile URLs from OnTheMarket results by keyword, location and email domain - OnTheMarket email extractor.

- **URL**: https://apify.com/leads-scraper/onthemarket-email-scraper.md
- **Developed by:** [Leads Scraper](https://apify.com/leads-scraper) (community)
- **Stats:** 2 total users, 1 monthly users, 100.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

from $2.49 / 1,000 results

This Actor is paid per event and usage. You are charged both the fixed price for specific events and for Apify platform usage.
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?

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 Email Scraper: a small, honest UK branch-contact source

The OnTheMarket Email Scraper collects contact emails that are publicly visible in Google's index alongside OnTheMarket pages.
Read the constraint before the pitch: OnTheMarket restricts much of its listing index, so this Actor returns few results; the Domain Agents and RealEstate.com.au Agents Actors cover their markets more fully.
In a measured run the OnTheMarket Email Scraper parsed three result blocks, recovered no identity data and returned one unique email.

That is the honest ceiling on this platform, and it is the first thing you should plan around.
Use the OnTheMarket Email Scraper as a narrow supplementary pass over the UK market, not as the backbone of a UK estate agent email list.
If you need real volume from this category, the Australian Actors are far stronger sources for their markets, and the US franchise Actors are stronger still.

OnTheMarket is a UK portal backed by estate and letting agents, and its pages are organised around branches rather than individual negotiators.
Branches publish a contact address because vendors, landlords and tenants have to be able to reach them.
The OnTheMarket Email Scraper reads only what Google already indexed from those public pages, which is the entire basis on which an OnTheMarket email extractor can work.

#### Who the OnTheMarket Email Scraper is for

UK proptech vendors run the OnTheMarket Email Scraper to sell agency CRM, branch websites, virtual staging, floor plans and transaction management.
Mortgage brokers, conveyancers, EPC assessors and survey firms use it to look for branch-level referral partners.
Recruiters and franchise development teams use the OnTheMarket Email Scraper to source estate and letting agency branches by town or borough.

#### What the OnTheMarket Email Scraper never does

The OnTheMarket Email Scraper never logs into OnTheMarket, never uses an OnTheMarket API and never opens the website.
There is no browser, no JavaScript rendering, no authentication and no cookies in the pipeline.
Every field comes from publicly indexed Google search results: titles, snippets and site labels.

### Key features of the OnTheMarket Email Scraper

| Feature | What it does for a UK estate agent contact list |
|---|---|
| Google `site:` targeting | Every query is scoped to `onthemarket.com` so nothing off-platform leaks in |
| Query expansion | Base, quoted and `intitle:` phrasings plus one variant per query modifier |
| Structural parsing | Locates the `<h3>` title then the smallest surrounding block, never Google CSS class names |
| Domain-filtered extraction | Only addresses ending in your `customDomains` are kept |
| Global deduplication | One row per unique email across every query and every page |
| Email normalisation | Handles `name [at] domain [dot] com`, `name (at) domain`, `name @ domain.com`, `domain .com`, zero-width characters and the full-width at sign |
| Junk filter | Rejects placeholders such as `email@`, `yourname@`, `test@`, `xxx@` and single-character locals |
| Boundary-correct matching | `@gmail.com` never matches inside `@gmail.company` or `@gmail.com.br` |
| Soft-wrap repair | Drops a hit that is only the tail of another address in the same block |
| Concurrency pool | An `asyncio` worker pool with a shared stop signal on `maxEmails` |
| Retries and block detection | Up to 3 attempts per page, exponential backoff, a fresh proxy session per request, and CAPTCHA or consent pages retried rather than counted as empty |
| Requeue of failures | Blocked or failed queries are retried once at the end of the run |
| Resumable state | Stored in the key-value store keyed by a hash of your input, saved on `PERSIST_STATE`, `MIGRATING` and `ABORTING` |
| Fallback parser | A Google layout change degrades the run to emails without account details, not to nothing |
| Run summary | Logs pages fetched, blocked pages, retries and emails per page |

On a restricted index, query expansion is the feature doing most of the work in an OnTheMarket Email Scraper run.
Each extra phrasing is another chance to reach a page Google did index, so leave `expandQueries` on.

### How the OnTheMarket Email Scraper works

1. The OnTheMarket Email Scraper reads your input: keywords, location, email domains and limits.
2. It builds Google queries with the `site:` operator, for example `site:onthemarket.com "letting agent" "@gmail.com" "Clapham"`.
3. It fetches result pages through the Apify GOOGLE_SERP proxy with async `aiohttp` requests.
4. It parses each result block structurally instead of by CSS class.
5. It extracts addresses from the block text with a domain-filtered regex.
6. It deduplicates globally and pushes each lead to the dataset immediately.

Base queries run before expanded variants, so whatever OnTheMarket pages are indexed surface first.
The OnTheMarket Email Scraper writes rows as it finds them, which matters when a run may only produce a handful.

### Input reference for the OnTheMarket Email Scraper

| Field | Type | Default | Meaning |
|---|---|---|---|
| `keywords` | array (required) | `["estate agent", "letting agent"]` | Search terms describing the accounts you want |
| `location` | string | `""` | Optional location phrase added to every query |
| `customDomains` | array | `["@gmail.com","@yahoo.com"]` | Only emails on these domains are kept; the `@` is optional |
| `maxEmails` | integer 1-10000 | `20` | Stop after this many unique emails |
| `countryCode` | string | `""` | Two-letter country for the search proxy (US, GB, DE...) |
| `expandQueries` | boolean | `true` | Search each keyword x domain pair in several phrasings |
| `queryModifiers` | array | `["email","contact","listing agent","inquiries","broker"]` | Extra words combined with each keyword when expansion is on |
| `maxPagesPerQuery` | integer 1-50 | `30` | Page cap per query |
| `maxConcurrency` | integer 1-20 | `5` | Parallel queries |

#### `location` is the input that matters most

UK agency branches are organised by town and borough, so `location` is the single most valuable control in the OnTheMarket Email Scraper.
Start with cities and boroughs: `London`, `Manchester`, `Birmingham`, `Leeds`, `Bristol`, `Edinburgh`, `Glasgow`, `Cardiff`, `Islington`, `Wandsworth`.
Then narrow to the neighbourhood or high street a branch would name: `Clapham`, `Shoreditch`, `Didsbury`, `Chorlton`, `Jesmond`, `Harrogate`, `Cheltenham`, `Guildford`.

Write the phrase the way a branch page would print it.
`Clapham` beats `Clapham, London, United Kingdom`, and a neighbourhood name usually beats a postcode district, though outward codes such as `SW4` are worth a second run.
Because the index is restricted, run many small locations and accept that several will return nothing at all.

#### `countryCode` guidance

Set `countryCode` to `GB`. UK routing matters here because names such as `Richmond`, `Kingston`, `Bolton` and `Hamilton` exist in several countries.
Without it, the OnTheMarket Email Scraper will spend part of an already thin page budget on non-UK results.

#### Example input

```json
{
  "keywords": ["estate agent", "letting agent", "branch"],
  "location": "Clapham",
  "customDomains": ["@gmail.com", "@yahoo.com", "@hotmail.co.uk", "@btinternet.com"],
  "maxEmails": 100,
  "countryCode": "GB",
  "expandQueries": true,
  "queryModifiers": ["email", "contact", "listing agent", "inquiries", "broker"],
  "maxPagesPerQuery": 30,
  "maxConcurrency": 5
}
```

### Output reference for the OnTheMarket Email Scraper

Every dataset item written by the OnTheMarket Email Scraper carries all fourteen fields.

| Field | Meaning |
|---|---|
| `network` | Platform name |
| `keyword` | The keyword that produced the lead |
| `query` | The exact Google query used |
| `title` | Raw result title |
| `accountName` | Account label Google prints |
| `fullName` | Display name parsed from a profile-style title; empty for listing captions |
| `username` | URL-safe handle when the platform exposes one; otherwise `null` |
| `profileUrl` | Canonical account URL when a handle is known; otherwise empty |
| `url` | Direct platform link when exposed, else the profile URL |
| `description` | Bio or caption snippet, cleaned of labels and counters |
| `email` | Lower-cased email address |
| `emailDomain` | The matched domain |
| `possiblyTruncated` | `true` when Google's snippet ellipsis touched the email |
| `foundAt` | ISO 8601 UTC timestamp |

#### Example output

```json
[
  {
    "network": "OnTheMarket",
    "keyword": "letting agent",
    "query": "site:onthemarket.com \"letting agent\" \"@gmail.com\" \"Clapham\"",
    "title": "Property to rent in Clapham, London - OnTheMarket",
    "accountName": "OnTheMarket",
    "fullName": "",
    "username": null,
    "profileUrl": "",
    "url": "https://www.onthemarket.com/to-rent/property/clapham/",
    "description": "Lettings inquiries and viewing requests to claphamlets.rentals@gmail.com.",
    "email": "claphamlets.rentals@gmail.com",
    "emailDomain": "@gmail.com",
    "possiblyTruncated": false,
    "foundAt": "2026-08-31T13:15:52Z"
  },
  {
    "network": "OnTheMarket",
    "keyword": "estate agent",
    "query": "site:onthemarket.com \"estate agent\" contact \"@yahoo.com\" \"Clapham\"",
    "title": "Harewood & Vale, Clapham - Estate Agent - OnTheMarket",
    "accountName": "harewood-vale-clapham",
    "fullName": "Harewood & Vale",
    "username": "harewood-vale-clapham",
    "profileUrl": "https://www.onthemarket.com/agents/branch/harewood-vale-clapham/",
    "url": "https://www.onthemarket.com/agents/branch/harewood-vale-clapham/",
    "description": "Sales and lettings across Clapham and Balham. Branch inquiries to harewoodvale.clapham@yahoo.com.",
    "email": "harewoodvale.clapham@yahoo.com",
    "emailDomain": "@yahoo.com",
    "possiblyTruncated": false,
    "foundAt": "2026-08-31T13:16:40Z"
  }
]
```

The first row is the shape you should expect most often: an address with `username: null` and an empty `profileUrl`, because the restricted index leaves Google little to print.
The second is the branch-page case, and it is comparatively rare in an OnTheMarket Email Scraper run.
Note that a resolved handle here identifies a branch, not an individual negotiator.

### Use cases for the OnTheMarket Email Scraper

| Use case | How the OnTheMarket Email Scraper fits |
|---|---|
| UK gap filling | A small supplementary pass over a UK list built from other sources |
| Branch-level software sales | Reach an agency branch rather than a single negotiator |
| Mortgage and conveyancing referrals | Identify branches operating on a specific high street |
| Listing media services | Pitch photography or video to a branch with recurring inventory |
| Recruiting | Sample which branches publish a public contact address in a borough |
| Market research | Measure how much of a portal's index is publicly reachable |
| List validation | Cross-check a purchased UK agent contact database against live indexed pages |

#### Example run recipes

Three OnTheMarket Email Scraper configurations worth trying, with modest expectations.

South London branches: keywords `["estate agent", "letting agent"]`, location `Clapham`, `countryCode` `GB`, `maxEmails` 50.
Greater Manchester: keywords `["letting agent", "branch"]`, location `Didsbury`, domains `["@gmail.com", "@hotmail.co.uk", "@btinternet.com"]`.
Wide sweep: run the OnTheMarket Email Scraper across ten boroughs in separate jobs and merge, since any single job may return nothing.

### Results you should realistically expect

Expect very few rows. In a measured run the OnTheMarket Email Scraper parsed three result blocks, produced no identity data and returned one unique email.
OnTheMarket restricts much of its listing index, so an empty or near-empty run is a normal outcome rather than a fault.
No volume is guaranteed anywhere in this family of Actors, and here that caveat carries real weight.

For fuller coverage of their own markets, use [Domain Agents Email Scraper](https://apify.com/leads-scraper/domain-agents-email-scraper) and [RealEstate.com.au Agents Email Scraper](https://apify.com/neuro-scraper/realestate-com-au-agents-email-scraper), which return substantially more per run.
If your market is the United States, [Keller Williams Agent Email Scraper](https://apify.com/neuro-scraper/keller-williams-agent-email-scraper) and [Coldwell Banker Agent Email Scraper](https://apify.com/neuro-scraper/coldwell-banker-agent-email-scraper) are the two densest sources in this category.

### Responsible use

UK branches publish these addresses so vendors, landlords and tenants can reach them, so make OnTheMarket Email Scraper outreach a relevant business offer rather than a blast.
For UK recipients, GDPR and PECR govern marketing email, including lawful basis, sender identification and a working unsubscribe path.
CAN-SPAM applies to US recipients, CASL to Canadian ones and the Spam Act to Australian ones; phone follow-up brings TCPA-adjacent rules into scope.

Fair Housing style principles apply to property outreach in every market, and UK equality law covers comparable ground.
Do not use the `location` input to include or exclude people on the basis of protected characteristics.
This is not legal advice; confirm your own obligations before you send.

### Limitations of the OnTheMarket Email Scraper

- OnTheMarket restricts much of its listing index, so this Actor returns few results; the Domain Agents and RealEstate.com.au Agents Actors cover their markets more fully. This is the governing limitation.
- The OnTheMarket Email Scraper only finds addresses that are publicly visible in Google's index.
- Google caps a single query at roughly 300 results, which is why query expansion exists; keep `expandQueries` on.
- `possiblyTruncated: true` means Google's snippet ellipsis touched the address, so verify those rows before sending.
- `username` and `profileUrl` populate only when Google exposes a handle; empty values are a Google limitation, not a bug.
- The OnTheMarket Email Scraper requires the Apify GOOGLE_SERP proxy and cannot run without Apify proxy credentials.
- Free Apify plans are capped at 100 emails per run; paid plans are uncapped.
- Results vary with keywords, domains and location, and no volume is guaranteed.

### FAQ about the OnTheMarket Email Scraper

#### How many results should I expect?

Very few. In a measured run the OnTheMarket Email Scraper parsed three result blocks, recovered no identity data and returned one unique email.
Plan for single digits and treat an empty run as a normal outcome.

#### Why is volume so low?

Because OnTheMarket restricts much of its listing index, there are fewer public pages for Google to index and for the Actor to parse.
No input change overcomes a restricted index.

#### Which Actor should I use instead for volume?

[Domain Agents Email Scraper](https://apify.com/leads-scraper/domain-agents-email-scraper) and [RealEstate.com.au Agents Email Scraper](https://apify.com/neuro-scraper/realestate-com-au-agents-email-scraper) cover their markets far more fully than the OnTheMarket Email Scraper covers the UK.

#### Does it log into OnTheMarket?

No. The OnTheMarket Email Scraper reads publicly indexed Google results only, with no login, no API and no site visits.

#### Does the OnTheMarket Email Scraper return branches or individual negotiators?

Branches. OnTheMarket's canonical handle format is a branch path, so a resolved `profileUrl` points at an office.

#### What should I put in `location`?

A borough, town or neighbourhood as a branch page would print it: `Clapham`, `Islington`, `Didsbury`, `Harrogate`, `Bristol`.
Outward postcodes such as `SW4` are worth a separate run.

#### Should I set `countryCode`?

Yes, use `GB`. Many UK place names also exist abroad, and GB routing keeps a thin page budget pointed at UK pages.

#### Which email domains should I add to the OnTheMarket Email Scraper?

The defaults plus UK consumer domains: `@hotmail.co.uk`, `@outlook.com`, `@btinternet.com`, `@sky.com` and `@live.co.uk`.
Agency domains work too when you already know which branch network you want.

#### Why is `profileUrl` empty on most rows?

Google frequently prints no branch handle for these pages, so the OnTheMarket Email Scraper has nothing to build a canonical link from.

#### What does `possiblyTruncated` mean?

Google's snippet ellipsis touched the address, so it may be incomplete. Verify before adding it to a sequence.

#### Can I resume an interrupted OnTheMarket Email Scraper run?

Yes. State lives in the key-value store keyed by a hash of your input and is saved on `PERSIST_STATE`, `MIGRATING` and `ABORTING`.

#### Is this affiliated with OnTheMarket?

No. The OnTheMarket Email Scraper is an independent Actor and is not affiliated with, supported by or endorsed by OnTheMarket.

### Related Actors

| Actor | What it collects |
|---|---|
| [OnTheMarket Email and Phone Number Scraper](https://apify.com/leads-scraper/onthemarket-email-and-phone-number-scraper) | Emails and phone numbers from OnTheMarket |
| [OnTheMarket Phone Number Scraper](https://apify.com/leads-scraper/onthemarket-phone-number-scraper) | Public phone numbers from OnTheMarket |
| [Apartment List Email Scraper](https://apify.com/leads-scraper/apartment-list-email-scraper) | Public contact emails from Apartment List |
| [ApartmentFinder Email Scraper](https://apify.com/leads-scraper/apartmentfinder-email-scraper) | Public contact emails from ApartmentFinder |
| [Apartments.com Email Scraper](https://apify.com/leads-scraper/apartments-com-email-scraper) | Public contact emails from Apartments.com |
| [Century 21 Agent Email Scraper](https://apify.com/neuro-scraper/century-21-agent-email-scraper) | Public contact emails from Century 21 |
| [Coldwell Banker Agent Email Scraper](https://apify.com/neuro-scraper/coldwell-banker-agent-email-scraper) | Public contact emails from Coldwell Banker |
| [CommercialCafe Email Scraper](https://apify.com/neuro-scraper/commercialcafe-email-scraper) | Public contact emails from CommercialCafe |
| [CommercialSearch Email Scraper](https://apify.com/neuro-scraper/commercialsearch-email-scraper) | Public contact emails from CommercialSearch |
| [Compass Agent Email Scraper](https://apify.com/neuro-scraper/compass-agent-email-scraper) | Public contact emails from Compass |
| [Crexi Email Scraper](https://apify.com/leads-scraper/crexi-email-scraper) | Public contact emails from Crexi |
| [Domain Agents Email Scraper](https://apify.com/leads-scraper/domain-agents-email-scraper) | Public contact emails from Domain |
| [Homes & Land Email Scraper](https://apify.com/neuro-scraper/homes-and-land-email-scraper) | Public contact emails from Homes & Land |
| [Homes.com Email Scraper](https://apify.com/leads-scraper/homes-com-email-scraper) | Public contact emails from Homes.com |
| [HotPads Email Scraper](https://apify.com/leads-scraper/hotpads-email-scraper) | Public contact emails from HotPads |
| [Keller Williams Agent Email Scraper](https://apify.com/neuro-scraper/keller-williams-agent-email-scraper) | Public contact emails from Keller Williams |
| [Land And Farm Email Scraper](https://apify.com/leads-scraper/land-and-farm-email-scraper) | Public contact emails from Land And Farm |
| [Land.com Email Scraper](https://apify.com/leads-scraper/land-com-email-scraper) | Public contact emails from Land.com |
| [LandWatch Email Scraper](https://apify.com/leads-scraper/landwatch-email-scraper) | Public contact emails from LandWatch |
| [LoopNet Email Scraper](https://apify.com/leads-scraper/loopnet-email-scraper) | Public contact emails from LoopNet |
| [RealEstate.com.au Agents Email Scraper](https://apify.com/neuro-scraper/realestate-com-au-agents-email-scraper) | Public contact emails from realestate.com.au |
| [Realtor.ca Email Scraper](https://apify.com/leads-scraper/realtor-ca-email-scraper) | Public contact emails from Realtor.ca |
| [Realtor.com Rentals Email Scraper](https://apify.com/leads-scraper/realtor-com-rentals-email-scraper) | Public contact emails from Realtor.com |
| [Redfin Rentals Email Scraper](https://apify.com/leads-scraper/redfin-rentals-email-scraper) | Public contact emails from Redfin |
| [RE/MAX Agent Email Scraper](https://apify.com/leads-scraper/remax-agent-email-scraper) | Public contact emails from RE/MAX |
| [Rent.com Email Scraper](https://apify.com/leads-scraper/rent-com-email-scraper) | Public contact emails from Rent.com |
| [RentCafe Email Scraper](https://apify.com/leads-scraper/rentcafe-email-scraper) | Public contact emails from RentCafe |
| [Zillow Rentals Email Scraper](https://apify.com/leads-scraper/zillow-rentals-email-scraper) | Public contact emails from Zillow |
| [Zumper Email Scraper](https://apify.com/leads-scraper/zumper-email-scraper) | Public contact emails from Zumper |
| [Apartment List Email and Phone Number Scraper](https://apify.com/neuro-scraper/apartment-list-email-and-phone-number-scraper) | Emails and phone numbers from Apartment List |
| [ApartmentFinder Email and Phone Number Scraper](https://apify.com/neuro-scraper/apartmentfinder-email-and-phone-number-scraper) | Emails and phone numbers from ApartmentFinder |
| [Apartments.com Email and Phone Number Scraper](https://apify.com/neuro-scraper/apartments-com-email-and-phone-number-scraper) | Emails and phone numbers from Apartments.com |
| [Century 21 Email and Phone Number Scraper](https://apify.com/neuro-scraper/century-21-agent-email-and-phone-number-scraper) | Emails and phone numbers from Century 21 |
| [Coldwell Banker Email and Phone Number Scraper](https://apify.com/neuro-scraper/coldwell-banker-agent-email-and-phone-number-scraper) | Emails and phone numbers from Coldwell Banker |
| [CommercialCafe Email and Phone Number Scraper](https://apify.com/neuro-scraper/commercialcafe-email-and-phone-number-scraper) | Emails and phone numbers from CommercialCafe |
| [CommercialSearch Email and Phone Number Scraper](https://apify.com/neuro-scraper/commercialsearch-email-and-phone-number-scraper) | Emails and phone numbers from CommercialSearch |
| [Compass Email and Phone Number Scraper](https://apify.com/neuro-scraper/compass-agent-email-and-phone-number-scraper) | Emails and phone numbers from Compass |
| [Crexi Email and Phone Number Scraper](https://apify.com/leads-scraper/crexi-email-and-phone-number-scraper) | Emails and phone numbers from Crexi |
| [Domain Email and Phone Number Scraper](https://apify.com/leads-scraper/domain-agents-email-and-phone-number-scraper) | Emails and phone numbers from Domain |
| [Homes & Land Email and Phone Number Scraper](https://apify.com/neuro-scraper/homes-and-land-email-and-phone-number-scraper) | Emails and phone numbers from Homes & Land |
| [Homes.com Email and Phone Number Scraper](https://apify.com/leads-scraper/homes-com-email-and-phone-number-scraper) | Emails and phone numbers from Homes.com |
| [Keller Williams Email and Phone Number Scraper](https://apify.com/neuro-scraper/keller-williams-agent-email-and-phone-number-scraper) | Emails and phone numbers from Keller Williams |

### Leave a review

If the OnTheMarket Email Scraper saved you time, please leave a star rating and a short review
on the Actor page.

Reviews are how other buyers judge whether a tool works, and they tell us which features to
build next.

If something did not work, email <neurodata.apify@gmail.com>
instead - bugs get fixed faster than they get complained about.

### Support

Questions, a bug report or a custom build? Email neurodata.apify@gmail.com and we will help.

# Actor input Schema

## `keywords` (type: `array`):

Search terms describing the OnTheMarket accounts you want (niche, job title, industry).

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

Optional location phrase added to every query (e.g. "New York").

## `customDomains` (type: `array`):

Only emails ending with one of these domains are collected. With or without the leading @. Each domain is searched separately, so more domains means more results but a longer run - remove some for a faster, narrower search, or add your own (e.g. @company.com).

## `maxEmails` (type: `integer`):

Stop once this many unique emails have been collected.

## `countryCode` (type: `string`):

Two-letter country code for the search proxy (e.g. US, GB, DE). Empty for any.

## `expandQueries` (type: `boolean`):

Search each keyword x domain pair with several phrasings. Recommended - Google caps a single query at ~300 results.

## `queryModifiers` (type: `array`):

Extra words combined with each keyword when Expand queries is on. Tuned for OnTheMarket.

## `maxPagesPerQuery` (type: `integer`):

Google rarely returns more than ~30 pages for one query.

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

How many queries run in parallel.

## Actor input object example

```json
{
  "keywords": [
    "estate agent",
    "letting agent"
  ],
  "location": "",
  "customDomains": [
    "@gmail.com",
    "@yahoo.com"
  ],
  "maxEmails": 20,
  "countryCode": "",
  "expandQueries": true,
  "queryModifiers": [
    "email",
    "contact",
    "listing agent",
    "inquiries",
    "broker"
  ],
  "maxPagesPerQuery": 30,
  "maxConcurrency": 5
}
```

# Actor output Schema

## `results` (type: `string`):

Records produced by OnTheMarket Email Scraper, stored in the run's default dataset.

# 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 = {
    "keywords": [
        "estate agent",
        "letting agent"
    ],
    "location": "",
    "customDomains": [
        "@gmail.com",
        "@yahoo.com"
    ],
    "countryCode": "",
    "queryModifiers": [
        "email",
        "contact",
        "listing agent",
        "inquiries",
        "broker"
    ]
};

// Run the Actor and wait for it to finish
const run = await client.actor("leads-scraper/onthemarket-email-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 = {
    "keywords": [
        "estate agent",
        "letting agent",
    ],
    "location": "",
    "customDomains": [
        "@gmail.com",
        "@yahoo.com",
    ],
    "countryCode": "",
    "queryModifiers": [
        "email",
        "contact",
        "listing agent",
        "inquiries",
        "broker",
    ],
}

# Run the Actor and wait for it to finish
run = client.actor("leads-scraper/onthemarket-email-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 '{
  "keywords": [
    "estate agent",
    "letting agent"
  ],
  "location": "",
  "customDomains": [
    "@gmail.com",
    "@yahoo.com"
  ],
  "countryCode": "",
  "queryModifiers": [
    "email",
    "contact",
    "listing agent",
    "inquiries",
    "broker"
  ]
}' |
apify call leads-scraper/onthemarket-email-scraper --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "type": "http",
            "url": "https://mcp.apify.com/?tools=fetch-actor-details,leads-scraper/onthemarket-email-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/bAeGCShs0lceOpoeL/builds/vjU3ZOr8kL00fju36/openapi.json
