# Udemy Email Scraper (`leads-scraper/udemy-email-scraper`) Actor

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

- **URL**: https://apify.com/leads-scraper/udemy-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

### Udemy Email Scraper — Extract Public Contact Emails from Udemy Instructors

The **Udemy Email Scraper** finds publicly indexed contact emails belonging to Udemy instructors and trainers, and returns them as clean, structured data.

You give it keywords such as `instructor` or `trainer`, choose the email domains you care about, and the Udemy Email Scraper writes a dataset of leads with instructor names, profile URLs, bio snippets and the exact query that found them.

Udemy is the largest open course marketplace on the web. Instructor profiles, course landing pages and "about the instructor" blocks are all crawled by Google, and many instructors publish a contact address in them.

That is where the leads live. The Udemy Email Scraper is built to surface those pages and pull the address out of the snippet.

**Important:** this Udemy Email Scraper never logs into Udemy, never uses the Udemy API, and never opens `udemy.com` directly. Every record comes from publicly indexed Google search results.

It is a Udemy email extractor for lead generation, course-marketing outreach and partnership research — not a student-data tool and not an enrolment scraper.

***

### Key Features of the Udemy Email Scraper

The table below reflects what the Udemy Email Scraper genuinely does. No invented capabilities, no marketing fiction.

| Feature | What it means in practice |
|---|---|
| Google `site:` data collection | Queries are restricted to `udemy.com`, so only Udemy pages are parsed |
| Query expansion | Each keyword × domain pair is searched in several phrasings: base, quoted, `intitle:`, plus one variant per query modifier |
| Domain-filtered extraction | Only emails ending in your `customDomains` list are kept |
| Global deduplication | One email appears once across every query and every page of the run |
| Instructor handle recovery | When Google exposes a `udemy.com/user/…` path, the crawler reads the handle and builds a canonical `profileUrl` |
| Obfuscation-aware parser | Understands `name [at] domain [dot] com`, `name (at) domain`, `name @ domain.com`, `domain .com`, zero-width characters and the full-width `＠` |
| Junk filter | Rejects placeholders such as `email@`, `yourname@`, `test@`, `xxx@` and single-character locals |
| Boundary-correct matching | `@gmail.com` will not match inside `@gmail.company` or `@gmail.com.br` |
| Soft-wrap repair | Discards a hit that is only the tail of another email in the same result block |
| Structural HTML parsing | Locates the `<h3>` title, then the smallest surrounding block — it does not depend on Google's CSS class names |
| Whole-page fallback parser | If Google's markup changes, the run degrades to "emails without account metadata" rather than "no emails" |
| Concurrency | An `asyncio` worker pool runs several queries in parallel with a shared stop signal on `maxEmails` |
| Retry logic and proxy rotation | Up to 3 attempts per page with exponential backoff and a fresh proxy session per request |
| Block detection | CAPTCHA, "unusual traffic" and consent pages are detected and retried, not silently counted as empty |
| Blocked-query requeue | Failed or blocked queries are re-queued once at the end of the run |
| Resumable state | Progress is stored in the key-value store keyed by a hash of your input, saved on `PERSIST_STATE`, `MIGRATING` and `ABORTING` |
| Streaming dataset writes | Each lead is pushed to the Apify dataset the moment it is found |
| Run summary logging | Pages fetched, blocked pages, retries and emails per page are reported at the end |

***

### How the Udemy Email Scraper Works: Crawler and Parser Pipeline

The Udemy Email Scraper pipeline is short and deliberately transparent. There is no browser, no JavaScript rendering, no authentication and no cookies.

**1. Read input.** The Udemy Email Scraper loads your keywords, optional location, email domains and limits.

**2. Build queries.** It composes Google queries with the `site:` operator, for example `site:udemy.com python instructor "@gmail.com" "India"`.

**3. Fetch search result pages.** Pagination is handled asynchronously with `aiohttp` through the Apify **GOOGLE_SERP** proxy, with retry logic and a fresh proxy session on every attempt.

**4. Parse result blocks.** For each result the Udemy Email Scraper finds the `<h3>` title, walks up to the smallest enclosing block, and reads the title, the site label and the snippet.

**5. Extract and normalise emails.** A domain-filtered regex pulls addresses out of the block text, then normalisation and the junk filter clean them up.

**6. Deduplicate and push.** Every unique email is written to the dataset immediately, so you can start exporting mid-run.

Base queries run first, so the earliest rows the Udemy Email Scraper writes are usually the highest-signal ones.

***

### What Structured Data Does the Udemy Email Scraper Extract?

The Udemy Email Scraper produces one dataset item per unique email, and every item carries the same 14 fields.

Alongside the address you get the account label Google printed, a parsed display name, the instructor handle when Google exposes a `/user/` path, a canonical profile URL, and the bio snippet the email came from.

You also get full provenance: the keyword and the exact Google query that produced the lead, plus a UTC timestamp.

That provenance is what makes an instructor contact list maintainable. It shows which keyword is actually productive so you can retire the ones that are not.

Nothing outside these 14 fields is collected. The Udemy Email Scraper does not touch enrolment numbers, revenue, ratings or anything behind a login.

***

### Udemy Email Scraper Input Schema

Every field below is taken verbatim from the Udemy Email Scraper input schema.

| Field | Type | Default | Description |
|---|---|---|---|
| `keywords` | array (required) | `["instructor", "trainer"]` | Search terms describing the Udemy accounts you want (niche, job title, industry) |
| `location` | string | `""` | Optional location phrase added to every query |
| `customDomains` | array | `["@gmail.com", "@yahoo.com"]` | Only emails on these domains are collected; the leading `@` is optional |
| `maxEmails` | integer (1–10000) | `20` | Stop once this many unique emails have been collected |
| `countryCode` | string | `""` | Two-letter country code for the search proxy (`US`, `GB`, `DE`…) |
| `expandQueries` | boolean | `true` | Search each keyword × domain pair with several phrasings |
| `queryModifiers` | array | `["email", "contact", "enroll", "coaching", "workshop"]` | Extra words combined with each keyword when expansion is on |
| `maxPagesPerQuery` | integer (1–50) | `30` | Page cap per query |
| `maxConcurrency` | integer (1–20) | `5` | How many queries run in parallel |

#### JSON input example

```json
{
  "keywords": ["python instructor", "excel trainer", "aws instructor"],
  "location": "India",
  "customDomains": ["@gmail.com", "@yahoo.com"],
  "maxEmails": 300,
  "countryCode": "IN",
  "expandQueries": true,
  "queryModifiers": ["email", "contact", "enroll", "coaching", "workshop"],
  "maxPagesPerQuery": 30,
  "maxConcurrency": 5
}
```

#### Why query expansion matters for contact discovery

Google returns roughly 300 results for any single query, which is a hard ceiling on a one-shot search.

With `expandQueries` on, `python instructor` × `@gmail.com` becomes a base query, a quoted query, an `intitle:` query and one query per modifier — `enroll`, `coaching`, `workshop` and the rest.

Because deduplication is global, expansion can only add leads to the Udemy Email Scraper dataset. Leave it enabled unless you are running a deliberately tiny test.

***

### Udemy Email Scraper Output Schema

Every dataset item produced by the Udemy Email Scraper contains all 14 fields below.

| 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 (handle or display name) |
| `fullName` | Display name parsed from a profile-style title; empty for course-page titles that carry no name |
| `username` | URL-safe handle when Udemy exposes one in the result URL; 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 course snippet, cleaned of labels and engagement counters |
| `email` | Lower-cased email address |
| `emailDomain` | The matched domain (e.g. `@gmail.com`) |
| `possiblyTruncated` | `true` when Google's snippet ellipsis touched the email — verify before sending |
| `foundAt` | ISO 8601 UTC timestamp |

#### JSON output example

```json
{
  "network": "Udemy",
  "keyword": "python instructor",
  "query": "site:udemy.com python instructor \"@gmail.com\" \"India\"",
  "title": "Arjun Mehta | Python & Data Science Instructor | Udemy",
  "accountName": "Arjun Mehta",
  "fullName": "Arjun Mehta",
  "username": "arjun-mehta-7",
  "profileUrl": "https://www.udemy.com/user/arjun-mehta-7/",
  "url": "https://www.udemy.com/user/arjun-mehta-7/",
  "description": "Python and data science instructor with 14 courses. Corporate training enquiries: arjun.mehta.teaches@gmail.com",
  "email": "arjun.mehta.teaches@gmail.com",
  "emailDomain": "@gmail.com",
  "possiblyTruncated": false,
  "foundAt": "2026-08-31T09:42:17Z"
}
```

Export the Udemy Email Scraper dataset as JSON, CSV, XLSX or HTML, or pull it through the Apify API into your CRM.

***

### How to Use the Udemy Email Scraper

**Step 1 — open the Actor.** Launch the [Udemy Email Scraper](https://apify.com/leads-scraper/udemy-email-scraper) on the Apify platform.

**Step 2 — enter keywords.** Be specific. `unity game development instructor` and `forex trading trainer` beat `teacher`, because Udemy bios are written in the vocabulary of the topic.

**Step 3 — pick your email domains.** Start with `@gmail.com` and `@yahoo.com`, then add `@outlook.com`, `@hotmail.com` or a regional provider if you are targeting a specific market.

**Step 4 — set `maxEmails` and run.** Leave query expansion on so the automation works around Google's per-query result cap.

**Step 5 — export.** Download the data, or schedule a weekly Udemy Email Scraper run so newly indexed instructor pages get picked up automatically.

If you want the same workflow on an academic marketplace, the **Coursera Email Scraper** covers university-partnered instructors instead.

***

### Use Cases for the Udemy Email Scraper

| Use case | How the Udemy Email Scraper helps |
|---|---|
| Course promotion services | Reach instructors who want more enrolments and will pay for marketing help |
| Video production and editing | Pitch re-shoots, captions and thumbnails to instructors with large catalogues |
| Localisation and dubbing | Build an instructor contact list by topic for translation offers |
| SaaS lead generation | Find trainers for screen-recording, LMS, quiz or scheduling products |
| Affiliate and coupon partnerships | Contact instructors directly about promo campaigns |
| Corporate training sourcing | Identify subject-matter experts who already teach your stack |
| Technical recruiting | Instructors are often practising engineers with public contact details |
| Guest speaking and webinars | Book experienced teachers who are used to presenting |
| Market research | Read `description` snippets to see how a topic is positioned across the marketplace |
| CRM enrichment | Match instructor names and profile URLs to records you already hold |

Udemy's instructor base is enormous and global, so keyword-driven contact discovery scales further here than on invite-only platforms.

In every one of these scenarios the Udemy Email Scraper does the tedious part — reading thousands of search results — and leaves the judgement to you.

***

### Why Choose This Udemy Email Scraper

**It is honest about its source.** The Udemy Email Scraper reads Google's public index. Nothing more, nothing hidden.

**It is resilient.** Structural parsing plus a whole-page fallback means a Google layout change degrades output quality instead of breaking the crawler.

**It is resumable.** Migrations and aborts do not cost you a run; state is keyed by a hash of your input.

**It is precise.** Domain filtering, boundary-correct matching, obfuscation handling and the junk filter keep noise out of your dataset.

**It is provenance-first.** Every row records the keyword and query that produced it, so you can tune the automation instead of guessing.

**It is part of a family.** The same engine powers dozens of sibling Actors, including the [Skillshare Email Scraper](https://apify.com/neuro-scraper/skillshare-email-scraper) for creative teachers and the [Kajabi Email Scraper](https://apify.com/neuro-scraper/kajabi-email-scraper) for instructors who also sell independently.

***

### Limitations of the Udemy Email Scraper

These are real constraints. Read them before you set expectations.

- **Only publicly indexed emails.** If an address is not visible in Google's index, the Udemy Email Scraper cannot find it. Private data is never accessed.
- **Google's ~300-result cap.** A single query returns roughly 300 results at most. Query expansion exists precisely to work around this, so keep `expandQueries` on.
- **`possiblyTruncated`.** When Google's snippet ellipsis touches an address, this flag is set to `true`. Verify those rows before sending anything.
- **Apify GOOGLE_SERP proxy required.** The Actor cannot run without Apify proxy credentials.
- **Free-plan cap.** Free Apify plans are limited to 100 emails per run. Paid plans are uncapped.
- **`username` and `profileUrl` availability.** These are only populated when Google's result exposes a handle. Course-page results that never show a `udemy.com/user/…` path will carry `accountName` and often `fullName`, but leave `username` empty and `profileUrl` blank. That is a Google limitation, not a bug.
- **No guaranteed volume.** Results vary with keywords, domains and location.

Nothing here is affiliated with, endorsed by or officially supported by Udemy.

***

### Related Actors

| Actor | What it collects |
|---|---|
| [Academia.edu Email Scraper](https://apify.com/neuro-scraper/academia-edu-email-scraper) | Public contact emails from Academia.edu |
| [Buy Me a Coffee Email Scraper](https://apify.com/neuro-scraper/buy-me-a-coffee-email-scraper) | Public contact emails from Buy Me a Coffee |
| [Carrd Email Scraper](https://apify.com/neuro-scraper/carrd-email-scraper) | Public contact emails from Carrd |
| [Domestika Email Scraper](https://apify.com/neuro-scraper/domestika-email-scraper) | Public contact emails from Domestika |
| [edX Email Scraper](https://apify.com/leads-scraper/edx-email-scraper) | Public contact emails from edX |
| [Gumroad Email Scraper](https://apify.com/leads-scraper/gumroad-email-scraper) | Public contact emails from Gumroad |
| [Kaggle Email Scraper](https://apify.com/neuro-scraper/kaggle-email-scraper) | Public contact emails from Kaggle |
| [Kajabi Email Scraper](https://apify.com/neuro-scraper/kajabi-email-scraper) | Public contact emails from Kajabi |
| [Ko-fi Email Scraper](https://apify.com/neuro-scraper/ko-fi-email-scraper) | Public contact emails from Ko-fi |
| [Linktree Email Scraper](https://apify.com/leads-scraper/linktree-email-scraper) | Public contact emails from Linktree |
| [MasterClass Email Scraper](https://apify.com/neuro-scraper/masterclass-email-scraper) | Public contact emails from MasterClass |
| [Meetup Email Scraper](https://apify.com/leads-scraper/meetup-email-scraper) | Public contact emails from Meetup |
| [Pluralsight Email Scraper](https://apify.com/leads-scraper/pluralsight-email-scraper) | Public contact emails from Pluralsight |
| [Preply Email Scraper](https://apify.com/neuro-scraper/preply-email-scraper) | Public contact emails from Preply |
| [ResearchGate Email Scraper](https://apify.com/neuro-scraper/researchgate-email-scraper) | Public contact emails from ResearchGate |
| [Skillshare Email Scraper](https://apify.com/neuro-scraper/skillshare-email-scraper) | Public contact emails from Skillshare |
| [Teachable Email Scraper](https://apify.com/neuro-scraper/teachable-email-scraper) | Public contact emails from Teachable |
| [Academia.edu Email and Phone Number Scraper](https://apify.com/neuro-scraper/academia-edu-email-and-phone-number-scraper) | Emails and phone numbers from Academia.edu |
| [Buy Me a Coffee Email and Phone Number Scraper](https://apify.com/neuro-scraper/buy-me-a-coffee-email-and-phone-number-scraper) | Emails and phone numbers from Buy Me a Coffee |
| [Carrd Email and Phone Number Scraper](https://apify.com/neuro-scraper/carrd-email-and-phone-number-scraper) | Emails and phone numbers from Carrd |
| [Domestika Email and Phone Number Scraper](https://apify.com/neuro-scraper/domestika-email-and-phone-number-scraper) | Emails and phone numbers from Domestika |
| [edX Email and Phone Number Scraper](https://apify.com/neuro-scraper/edx-email-and-phone-number-scraper) | Emails and phone numbers from edX |
| [Gumroad Email and Phone Number Scraper](https://apify.com/leads-scraper/gumroad-email-and-phone-number-scraper) | Emails and phone numbers from Gumroad |
| [Kaggle Email and Phone Number Scraper](https://apify.com/neuro-scraper/kaggle-email-and-phone-number-scraper) | Emails and phone numbers from Kaggle |
| [Kajabi Email and Phone Number Scraper](https://apify.com/neuro-scraper/kajabi-email-and-phone-number-scraper) | Emails and phone numbers from Kajabi |
| [Ko-fi Email and Phone Number Scraper](https://apify.com/neuro-scraper/ko-fi-email-and-phone-number-scraper) | Emails and phone numbers from Ko-fi |
| [Linktree Email and Phone Number Scraper](https://apify.com/leads-scraper/linktree-email-and-phone-number-scraper) | Emails and phone numbers from Linktree |
| [MasterClass Email and Phone Number Scraper](https://apify.com/neuro-scraper/masterclass-email-and-phone-number-scraper) | Emails and phone numbers from MasterClass |
| [Meetup Email and Phone Number Scraper](https://apify.com/neuro-scraper/meetup-email-and-phone-number-scraper) | Emails and phone numbers from Meetup |
| [Pluralsight Email and Phone Number Scraper](https://apify.com/neuro-scraper/pluralsight-email-and-phone-number-scraper) | Emails and phone numbers from Pluralsight |
| [Preply Email and Phone Number Scraper](https://apify.com/neuro-scraper/preply-email-and-phone-number-scraper) | Emails and phone numbers from Preply |
| [ResearchGate Email and Phone Number Scraper](https://apify.com/neuro-scraper/researchgate-email-and-phone-number-scraper) | Emails and phone numbers from ResearchGate |
| [Skillshare Email and Phone Number Scraper](https://apify.com/neuro-scraper/skillshare-email-and-phone-number-scraper) | Emails and phone numbers from Skillshare |
| [Teachable Email and Phone Number Scraper](https://apify.com/neuro-scraper/teachable-email-and-phone-number-scraper) | Emails and phone numbers from Teachable |
| [Academia.edu Phone Number Scraper](https://apify.com/neuro-scraper/academia-edu-phone-number-scraper) | Public phone numbers from Academia.edu |
| [Buy Me a Coffee Phone Number Scraper](https://apify.com/neuro-scraper/buy-me-a-coffee-phone-number-scraper) | Public phone numbers from Buy Me a Coffee |
| [Carrd Phone Number Scraper](https://apify.com/neuro-scraper/carrd-phone-number-scraper) | Public phone numbers from Carrd |
| [Domestika Phone Number Scraper](https://apify.com/neuro-scraper/domestika-phone-number-scraper) | Public phone numbers from Domestika |
| [edX Phone Number Scraper](https://apify.com/neuro-scraper/edx-phone-number-scraper) | Public phone numbers from edX |
| [Gumroad Phone Number Scraper](https://apify.com/leads-scraper/gumroad-phone-number-scraper) | Public phone numbers from Gumroad |
| [Kaggle Phone Number Scraper](https://apify.com/neuro-scraper/kaggle-phone-number-scraper) | Public phone numbers from Kaggle |
| [Kajabi Phone Number Scraper](https://apify.com/neuro-scraper/kajabi-phone-number-scraper) | Public phone numbers from Kajabi |

### Udemy Email Scraper Example Run

A localisation agency wants to offer subtitle translation to instructors teaching software topics.

They run the Udemy Email Scraper with `keywords: ["python instructor", "javascript instructor", "excel trainer"]`, `customDomains: ["@gmail.com", "@outlook.com"]` and `maxEmails: 250`.

Query expansion turns three keywords into more than twenty phrasings; the automation paginates through Google while the dataset fills with instructor names, handles and addresses.

They sort by `possiblyTruncated`, drop the flagged rows, open a few `udemy.com/user/…` profile URLs to check catalogue size, then export a CSV. Total setup time: under five minutes.

***

### Udemy Email Scraper FAQ

#### Does the Udemy Email Scraper log into Udemy?

No. It never logs in, never uses the Udemy API and never opens `udemy.com`. All data comes from publicly indexed Google search results.

#### Where do the emails actually come from?

From Google result titles, site labels and snippets for pages on `udemy.com` — typically instructor bios and course descriptions where the instructor published a contact address themselves.

#### Is this a Udemy email extractor or a full course scraper?

It is a Udemy email extractor. It returns the 14 fields listed above and nothing else — no ratings, no prices, no enrolment counts, no curricula.

#### Will I get a working profile URL?

When Google's result exposes a `udemy.com/user/…` path, yes — the parser reads the handle and builds `https://www.udemy.com/user/<username>/`. Course-page results may not expose one.

#### Do I need an Apify proxy?

Yes. The Udemy Email Scraper requires the Apify GOOGLE_SERP proxy and cannot run without Apify proxy credentials.

#### How many emails can it collect per run?

Free Apify plans are capped at 100 emails per run. Paid plans are uncapped, bounded only by your `maxEmails` value and what Google has indexed.

#### What does `possiblyTruncated: true` mean?

Google's snippet ellipsis touched the email, so the address may be cut off. Verify those rows before sending.

#### Should I leave query expansion enabled?

Yes. Google caps a single query at roughly 300 results, and query expansion is how the Udemy Email Scraper reaches past that ceiling.

#### Can I target instructors in one country?

Set `countryCode` to a two-letter code and optionally add a `location` phrase. Both narrow the search; neither guarantees geographic accuracy.

#### Can I filter to a specific email domain?

Yes — `customDomains` accepts any list, with or without the leading `@`. Boundary-correct matching prevents false hits like `@gmail.company`.

#### Does it deduplicate?

Yes, globally. An email appears once per run no matter how many queries or pages surfaced it.

#### What happens if a run is interrupted?

Progress is saved in the key-value store, keyed by a hash of your input, and flushed on `PERSIST_STATE`, `MIGRATING` and `ABORTING`. Restarting resumes rather than starting over.

#### Is this affiliated with Udemy?

No. The Udemy Email Scraper is an independent tool and is not affiliated with, endorsed by or officially supported by Udemy.

#### How should I use the results responsibly?

Follow GDPR, CAN-SPAM and any other law that applies to you. Publicly visible does not mean consent to bulk marketing — keep outreach relevant and honour opt-outs.

***

### Leave a review

If the Udemy 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, bug reports or a custom build request? Email **neurodata.apify@gmail.com** and include your run ID so the Udemy Email Scraper logs can be checked quickly.

# Actor input Schema

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

Search terms describing the Udemy 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 Udemy.

## `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": [
    "instructor",
    "trainer"
  ],
  "location": "",
  "customDomains": [
    "@gmail.com",
    "@yahoo.com"
  ],
  "maxEmails": 20,
  "countryCode": "",
  "expandQueries": true,
  "queryModifiers": [
    "email",
    "contact",
    "enroll",
    "coaching",
    "workshop"
  ],
  "maxPagesPerQuery": 30,
  "maxConcurrency": 5
}
```

# Actor output Schema

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

Records produced by Udemy 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": [
        "instructor",
        "trainer"
    ],
    "location": "",
    "customDomains": [
        "@gmail.com",
        "@yahoo.com"
    ],
    "countryCode": "",
    "queryModifiers": [
        "email",
        "contact",
        "enroll",
        "coaching",
        "workshop"
    ]
};

// Run the Actor and wait for it to finish
const run = await client.actor("leads-scraper/udemy-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": [
        "instructor",
        "trainer",
    ],
    "location": "",
    "customDomains": [
        "@gmail.com",
        "@yahoo.com",
    ],
    "countryCode": "",
    "queryModifiers": [
        "email",
        "contact",
        "enroll",
        "coaching",
        "workshop",
    ],
}

# Run the Actor and wait for it to finish
run = client.actor("leads-scraper/udemy-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": [
    "instructor",
    "trainer"
  ],
  "location": "",
  "customDomains": [
    "@gmail.com",
    "@yahoo.com"
  ],
  "countryCode": "",
  "queryModifiers": [
    "email",
    "contact",
    "enroll",
    "coaching",
    "workshop"
  ]
}' |
apify call leads-scraper/udemy-email-scraper --silent --output-dataset

```

## MCP server setup

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