# Mastodon Email Scraper (`leads-scraper/mastodon-email-scraper`) Actor

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

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

### Mastodon Email Scraper

### Mastodon Email Scraper — Public Contact Emails from the Fediverse

The **Mastodon Email Scraper** collects publicly indexed contact emails from Mastodon accounts and turns them into a clean, exportable dataset.

Mastodon is decentralised, which makes contact discovery awkward. There is no single directory, no global search that reaches every server, and no central profile index.

The Mastodon Email Scraper works around that by reading Google's index of the largest public instances: `mastodon.social`, `mastodon.online`, `mstdn.social` and `fosstodon.org`.

Fediverse users are disproportionately developers, sysadmins, FOSS maintainers, academics, privacy researchers, illustrators and journalists — and a striking number of them publish a real email in their profile.

The Mastodon Email Scraper is a Mastodon email extractor built for lead generation, open-source outreach, technical recruiting and press research.

**Important:** this Mastodon Email Scraper never logs in, never calls the Mastodon or ActivityPub API, and never opens an instance directly. Every record comes from publicly indexed Google search results.

***

### Key Features of the Mastodon Email Scraper

Everything listed here is real behaviour of the crawler. Nothing is aspirational.

| Feature | What it means in practice |
|---|---|
| Multi-instance `site:` search | The Mastodon Email Scraper searches `mastodon.social`, `mastodon.online`, `mstdn.social` and `fosstodon.org` |
| Query expansion | Each keyword × domain pair runs as base, quoted, `intitle:` and one variant per query modifier |
| Domain-filtered extraction | Only emails ending in your `customDomains` list are kept |
| Global deduplication | The same address is never written twice, across any query or page |
| Obfuscation-aware parser | Handles `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` never matches inside `@gmail.company` or `@gmail.com.br` |
| Soft-wrap repair | Drops a hit that is only the tail of another email in the same block |
| Structural HTML parsing | Finds the `<h3>` title then the smallest surrounding block — no dependency on Google's CSS class names |
| Whole-page fallback parser | A Google markup change degrades to "emails without account metadata" instead of "no emails" |
| Concurrency | An `asyncio` worker pool runs queries in parallel with a shared stop signal on `maxEmails` |
| Retry logic | Up to 3 attempts per page, exponential backoff, a fresh proxy session per request |
| Block detection | CAPTCHA, "unusual traffic" and consent pages are recognised and retried rather than counted as empty |
| Blocked-query requeue | Blocked or failed queries are re-queued once at the end of the run |
| Resumable state | Key-value-store checkpoints keyed by an input hash, saved on `PERSIST_STATE`, `MIGRATING` and `ABORTING` |
| Streaming dataset writes | Each lead lands in the Apify dataset as soon as it is found |
| Run summary | Pages fetched, blocked pages, retries and emails per page are logged |

***

### How the Mastodon Email Scraper Works

The Mastodon Email Scraper pipeline is short and fully inspectable. There is no headless browser, no JavaScript rendering, no authentication and no cookies.

**1. Read input.** Keywords, optional location, email domains and limits are loaded from the input schema.

**2. Build search queries.** Google queries are composed with the `site:` operator, for example `site:mastodon.social developer "@gmail.com" "Amsterdam"`.

**3. Fetch search result pages.** Requests go out asynchronously via `aiohttp` through the Apify **GOOGLE\_SERP** proxy, with proxy rotation and retry logic on every attempt.

**4. Parse each result block.** The Mastodon Email Scraper locates the `<h3>` heading, walks up to the tightest enclosing block, and reads title, site label and snippet.

**5. Extract and normalise.** A domain-filtered regex pulls out candidate addresses; normalisation, obfuscation handling and the junk filter clean the rest.

**6. Deduplicate and push.** Unique emails stream straight into the dataset, so exporting can begin mid-run.

Base queries run before expanded variants, so the first rows the Mastodon Email Scraper writes tend to be the strongest matches.

***

### What Data Does the Mastodon Email Scraper Extract?

Each dataset item represents one unique email address, described by 14 structured fields.

Beyond the address you get the account label Google printed, a parsed display name, the handle where the instance exposes one, a canonical profile URL and the bio snippet the email came from.

Provenance is included too: the keyword and the exact Google query behind the lead, plus a UTC timestamp.

That metadata is what lets you tell `rust maintainer` from `security researcher` in terms of actual yield, and prune your keyword list accordingly.

The Mastodon Email Scraper collects nothing beyond these fields — no follower counts, no toot history, no private data.

***

### Mastodon Email Scraper Input Schema

Every field below comes verbatim from the Mastodon Email Scraper input schema.

| Field | Type | Default | Description |
|---|---|---|---|
| `keywords` | array (required) | `["developer", "founder"]` | Search terms describing the Mastodon 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; leading `@` 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", "inquiries", "hire", "work with me"]` | 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": ["rust maintainer", "self-hosting sysadmin", "privacy researcher"],
  "location": "Amsterdam",
  "customDomains": ["@gmail.com", "@posteo.de", "@protonmail.com"],
  "maxEmails": 400,
  "countryCode": "NL",
  "expandQueries": true,
  "queryModifiers": ["email", "contact", "inquiries", "hire", "work with me"],
  "maxPagesPerQuery": 30,
  "maxConcurrency": 6
}
```

***

### Mastodon Email Scraper Output Schema

Every dataset item produced by the Mastodon Email Scraper carries all 14 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 (handle or display name) |
| `fullName` | Display name parsed from a profile-style title; empty for post captions |
| `username` | URL-safe handle when the instance 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 post 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": "Mastodon",
  "keyword": "rust maintainer",
  "query": "site:mastodon.social rust maintainer \"@gmail.com\" \"Amsterdam\"",
  "title": "Jonas Veldkamp (@jveldkamp) - Mastodon",
  "accountName": "@jveldkamp",
  "fullName": "Jonas Veldkamp",
  "username": "jveldkamp",
  "profileUrl": "https://mastodon.social/@jveldkamp",
  "url": "https://mastodon.social/@jveldkamp",
  "description": "Rust + embedded. Maintainer of two crates you have probably never used. Amsterdam. Consulting: jonas.veldkamp.dev@gmail.com",
  "email": "jonas.veldkamp.dev@gmail.com",
  "emailDomain": "@gmail.com",
  "possiblyTruncated": false,
  "foundAt": "2026-08-31T11:08:44Z"
}
```

***

### How to Use the Mastodon Email Scraper

**Step 1 — open the Actor.** Launch the [Mastodon Email Scraper](https://apify.com/leads-scraper/mastodon-email-scraper) from the Apify Store.

**Step 2 — write specific keywords.** The fediverse rewards precision: `kubernetes SRE`, `digital humanities`, `linocut artist` beat generic terms.

**Step 3 — choose email domains.** `@gmail.com` is the baseline. Because Mastodon skews privacy-conscious, add `@protonmail.com`, `@posteo.de`, `@tutanota.com` or `@disroot.org`.

**Step 4 — configure limits and run.** Keep `expandQueries` on so query expansion works around Google's per-query result ceiling.

**Step 5 — export.** Take the Mastodon Email Scraper dataset as JSON, CSV or XLSX, or pull it via the Apify API into your CRM.

Running the Mastodon Email Scraper on a weekly schedule keeps pace with newly indexed profiles, which matters on a network where accounts migrate between instances.

If your audience straddles networks, pair it with the [Bluesky Email Scraper](https://apify.com/leads-scraper/bluesky-email-scraper) — the developer and journalist overlap between Bluesky and Mastodon is substantial.

***

### Use Cases for the Mastodon Email Scraper

| Use case | How the Mastodon Email Scraper helps |
|---|---|
| Open-source sponsorship | Find maintainers and contributors who publish a contact address |
| Developer tool marketing | Reach engineers by stack keyword rather than by ad targeting |
| Technical recruiting | Source sysadmins, SREs and backend developers with public emails |
| Privacy and security research | Contact researchers and advocates concentrated on the fediverse |
| Academic outreach | Reach scholars who left commercial platforms for instance-based communities |
| Journalist and PR contact lists | Build beat-specific press lists from public bios |
| Creator partnerships | Contact illustrators, photographers and writers active on Mastodon |
| Conference speaker sourcing | Identify and invite specialists in a niche technical field |
| Newsletter and community growth | Find people already writing about your topic |
| CRM enrichment | Attach fediverse handles and profile URLs to existing records |

Across all of these, the Mastodon Email Scraper handles the tedious search-and-read work and leaves the qualifying to you.

***

### Why Choose This Mastodon Email Scraper

**It fits how Mastodon actually works.** Decentralisation defeats single-instance tools; the Mastodon Email Scraper searches four major instances at once.

**It is honest about its source.** Google's public index, nothing else. No API, no login, no scraping behind a wall.

**It is resilient.** Structural parsing plus a whole-page fallback keeps the run producing data through Google layout changes.

**It is resumable.** Migrations and aborts are checkpointed, keyed by a hash of your input.

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

**It has siblings.** The same engine runs the [X Email Scraper](https://apify.com/leads-scraper/x-email-scraper) for people who stayed put, the [Reddit Email Scraper](https://apify.com/leads-scraper/reddit-email-scraper) for community-driven niches, and the [Medium Email Scraper](https://apify.com/leads-scraper/medium-email-scraper) for long-form writers.

***

### Limitations

Read these before setting expectations. They are real, and none of them are bugs.

- **Only publicly indexed emails.** If an address is not in Google's index, the Mastodon Email Scraper cannot find it. Private data is never accessed.
- **Four instances only.** Coverage is `mastodon.social`, `mastodon.online`, `mstdn.social` and `fosstodon.org`. Smaller self-hosted instances are outside scope.
- **Google's ~300-result cap.** One query returns roughly 300 results at most. That is exactly why query expansion exists — leave `expandQueries` on.
- **`possiblyTruncated`.** A `true` value means Google's snippet ellipsis may have cut the address. Verify before sending.
- **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 populated only when Google's result exposes a handle. Some rows will carry `accountName` and `fullName` with an empty `username` and `profileUrl` — a Google limitation, not a defect.
- **No guaranteed volume.** Yield varies with keywords, domains and location.

The Mastodon Email Scraper is independent and not affiliated with, endorsed by or officially supported by Mastodon gGmbH or any instance operator.

***

### Related Actors

| Actor | What it collects |
|---|---|
| [Mastodon Email and Phone Number Scraper](https://apify.com/leads-scraper/mastodon-email-and-phone-number-scraper) | Emails and phone numbers from Mastodon |
| [Mastodon Phone Number Scraper](https://apify.com/leads-scraper/mastodon-phone-number-scraper) | Public phone numbers from Mastodon |
| [Behance Email Scraper](https://apify.com/leads-scraper/behance-email-scraper) | Public contact emails from Behance |
| [Bigo Live Email Scraper](https://apify.com/leads-scraper/bigo-live-email-scraper) | Public contact emails from Bigo Live |
| [Bluesky Email Scraper](https://apify.com/leads-scraper/bluesky-email-scraper) | Public contact emails from Bluesky |
| [Bumble Email Scraper](https://apify.com/leads-scraper/bumble-email-scraper) | Public contact emails from Bumble |
| [Clubhouse Email Scraper](https://apify.com/leads-scraper/clubhouse-email-scraper) | Public contact emails from Clubhouse |
| [Dailymotion Email Scraper](https://apify.com/leads-scraper/dailymotion-email-scraper) | Public contact emails from Dailymotion |
| [DeviantArt Email Scraper](https://apify.com/leads-scraper/deviantart-email-scraper) | Public contact emails from DeviantArt |
| [Discord Email Scraper](https://apify.com/leads-scraper/discord-email-scraper) | Public contact emails from Discord |
| [Dribbble Email Scraper](https://apify.com/leads-scraper/dribbble-email-scraper) | Public contact emails from Dribbble |
| [Facebook Email Scraper](https://apify.com/leads-scraper/facebook-email-scraper) | Public contact emails from Facebook |
| [Goodreads Email Scraper](https://apify.com/leads-scraper/goodreads-email-scraper) | Public contact emails from Goodreads |
| [Hinge Email Scraper](https://apify.com/leads-scraper/hinge-email-scraper) | Public contact emails from Hinge |
| [Instagram Email Scraper](https://apify.com/leads-scraper/instagram-email-scraper) | Public contact emails from Instagram |
| [KakaoTalk Email Scraper](https://apify.com/leads-scraper/kakaotalk-email-scraper) | Public contact emails from KakaoTalk |
| [Kick Email Scraper](https://apify.com/leads-scraper/kick-email-scraper) | Public contact emails from Kick |
| [Lemon8 Email Scraper](https://apify.com/leads-scraper/lemon8-email-scraper) | Public contact emails from Lemon8 |
| [Likee Email Scraper](https://apify.com/leads-scraper/likee-email-scraper) | Public contact emails from Likee |
| [LINE Email Scraper](https://apify.com/leads-scraper/line-email-scraper) | Public contact emails from LINE |
| [LinkedIn Email Scraper](https://apify.com/leads-scraper/linkedin-email-scraper) | Public contact emails from LinkedIn |
| [Medium Email Scraper](https://apify.com/leads-scraper/medium-email-scraper) | Public contact emails from Medium |
| [Mixcloud Email Scraper](https://apify.com/leads-scraper/mixcloud-email-scraper) | Public contact emails from Mixcloud |
| [Patreon Email Scraper](https://apify.com/leads-scraper/patreon-email-scraper) | Public contact emails from Patreon |
| [Pinterest Email Scraper](https://apify.com/leads-scraper/pinterest-email-scraper) | Public contact emails from Pinterest |
| [Quora Email Scraper](https://apify.com/leads-scraper/quora-email-scraper) | Public contact emails from Quora |
| [Reddit Email Scraper](https://apify.com/leads-scraper/reddit-email-scraper) | Public contact emails from Reddit |
| [Rumble Email Scraper](https://apify.com/leads-scraper/rumble-email-scraper) | Public contact emails from Rumble |
| [Snapchat Email Scraper](https://apify.com/leads-scraper/snapchat-email-scraper) | Public contact emails from Snapchat |
| [SoundCloud Email Scraper](https://apify.com/leads-scraper/soundcloud-email-scraper) | Public contact emails from SoundCloud |
| [Substack Email Scraper](https://apify.com/leads-scraper/substack-email-scraper) | Public contact emails from Substack |
| [Telegram Email Scraper](https://apify.com/leads-scraper/telegram-email-scraper) | Public contact emails from Telegram |
| [Threads Email Scraper](https://apify.com/leads-scraper/threads-email-scraper) | Public contact emails from Threads |
| [TikTok Email Scraper](https://apify.com/leads-scraper/tiktok-email-scraper) | Public contact emails from TikTok |
| [Tinder Email Scraper](https://apify.com/leads-scraper/tinder-email-scraper) | Public contact emails from Tinder |
| [Tumblr Email Scraper](https://apify.com/leads-scraper/tumblr-email-scraper) | Public contact emails from Tumblr |
| [Twitch Email Scraper](https://apify.com/leads-scraper/twitch-email-scraper) | Public contact emails from Twitch |
| [Vimeo Email Scraper](https://apify.com/leads-scraper/vimeo-email-scraper) | Public contact emails from Vimeo |
| [VK Email Scraper](https://apify.com/leads-scraper/vk-email-scraper) | Public contact emails from VK |
| [WeChat Email Scraper](https://apify.com/leads-scraper/wechat-email-scraper) | Public contact emails from WeChat |
| [Weibo Email Scraper](https://apify.com/leads-scraper/weibo-email-scraper) | Public contact emails from Weibo |
| [X Email Scraper](https://apify.com/leads-scraper/x-email-scraper) | Public contact emails from X |

### Mastodon Email Scraper Example Run

A developer-tools company wants beta testers for a self-hosting product.

They run the Mastodon Email Scraper with `keywords: ["self-hosting", "homelab", "docker sysadmin"]`, `customDomains: ["@gmail.com", "@protonmail.com"]` and `maxEmails: 350`.

Query expansion turns three keywords into more than a dozen phrasings across four instances, and the crawler paginates through Google collecting matches.

They filter out rows flagged `possiblyTruncated`, deduplicate against their existing CRM, and export a clean CSV. Setup took minutes, not an afternoon.

***

### Mastodon Email Scraper FAQ

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

No. It never logs in, never uses the Mastodon or ActivityPub API, and never opens an instance directly. All data comes from publicly indexed Google search results.

#### Which instances does the Mastodon Email Scraper cover?

`mastodon.social`, `mastodon.online`, `mstdn.social` and `fosstodon.org`. Self-hosted and smaller instances are not in scope.

#### Where do the emails come from?

From Google result titles, site labels and snippets — usually profile bios where the account holder published a contact address themselves.

#### Do I need an Apify proxy?

Yes. The Mastodon Email Scraper requires the Apify GOOGLE\_SERP proxy and cannot run without Apify proxy credentials.

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

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

#### Why is `username` empty on some rows?

Google did not expose a handle in that result. Those rows still include `accountName`, `fullName` and the bio snippet. It is a Google limitation, not a scraper defect.

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

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

#### Should I leave query expansion on?

Yes. Google caps a single query at roughly 300 results; expansion is how the Mastodon Email Scraper reaches beyond that ceiling.

#### Can I target privacy-focused email providers?

Yes. `customDomains` accepts any list — `@protonmail.com`, `@posteo.de`, `@tutanota.com` and so on, with or without the leading `@`.

#### Does the Mastodon Email Scraper deduplicate results?

Yes, globally. Each email appears once per run regardless of how many queries surfaced it.

#### What if the run is interrupted?

State is checkpointed in the key-value store, keyed by a hash of your input, and flushed on `PERSIST_STATE`, `MIGRATING` and `ABORTING`. Restarting resumes.

#### Is this affiliated with Mastodon?

No. The Mastodon Email Scraper is independent and is not affiliated with, endorsed by or officially supported by Mastodon or any instance.

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

Comply with GDPR, CAN-SPAM and local law. The fediverse is culturally hostile to bulk marketing — keep outreach relevant, personal and easy to opt out of.

***

### Leave a review

If the Mastodon 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? Email **neurodata.apify@gmail.com** with your run ID so the Mastodon Email Scraper logs can be reviewed.

# Actor input Schema

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

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

## `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": [
    "developer",
    "founder"
  ],
  "location": "",
  "customDomains": [
    "@gmail.com",
    "@yahoo.com"
  ],
  "maxEmails": 20,
  "countryCode": "",
  "expandQueries": true,
  "queryModifiers": [
    "email",
    "contact",
    "inquiries",
    "hire",
    "work with me"
  ],
  "maxPagesPerQuery": 30,
  "maxConcurrency": 5
}
```

# Actor output Schema

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

Records produced by Mastodon 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": [
        "developer",
        "founder"
    ],
    "location": "",
    "customDomains": [
        "@gmail.com",
        "@yahoo.com"
    ],
    "countryCode": "",
    "queryModifiers": [
        "email",
        "contact",
        "inquiries",
        "hire",
        "work with me"
    ]
};

// Run the Actor and wait for it to finish
const run = await client.actor("leads-scraper/mastodon-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": [
        "developer",
        "founder",
    ],
    "location": "",
    "customDomains": [
        "@gmail.com",
        "@yahoo.com",
    ],
    "countryCode": "",
    "queryModifiers": [
        "email",
        "contact",
        "inquiries",
        "hire",
        "work with me",
    ],
}

# Run the Actor and wait for it to finish
run = client.actor("leads-scraper/mastodon-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": [
    "developer",
    "founder"
  ],
  "location": "",
  "customDomains": [
    "@gmail.com",
    "@yahoo.com"
  ],
  "countryCode": "",
  "queryModifiers": [
    "email",
    "contact",
    "inquiries",
    "hire",
    "work with me"
  ]
}' |
apify call leads-scraper/mastodon-email-scraper --silent --output-dataset

```

## MCP server setup

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