# Mastodon Profile, Follower & Creator Scraper (`haketa/mastodon-scraper`) Actor

Discover and scrape Mastodon profiles: handle, display name, bio, follower/following/post counts, verified link fields, bot flag and account age. Search by keyword, look up handles, or scrape any account's followers/following. Extracts email, website and socials. For creator discovery and lead gen.

- **URL**: https://apify.com/haketa/mastodon-scraper.md
- **Developed by:** [Haketa](https://apify.com/haketa) (community)
- **Categories:** Social media, Lead generation
- **Features:** Limited permissions
- **Stats:** 2 total users, 1 monthly users, 100.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

from $1.75 / 1,000 results

This Actor is paid per event. You are not charged for the Apify platform usage, but only a fixed price for specific events.
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 Scraper — Profiles, Followers, Bios & Creator Contacts

> **The premier Mastodon scraper and fediverse lead generation tool for extracting rich creator profiles, audience graphs, and verified contact links at scale — with zero login required.** Extract structured profile records across any Mastodon server: fediverse handles, display names, bios, follower and post counts, verified link fields, account creation dates, bot flags, and auto-extracted websites, emails, and social profiles. Discover profiles via keyword search, direct handle queries, follower/following network crawling, or public server directories.
>
> Export thousands of records seamlessly to **JSON, CSV, Excel, or direct API integration**.

[![Apify Actor](https://img.shields.io/badge/Apify-Actor-orange.svg)](https://apify.com/haketa/mastodon-scraper)
[![Fediverse Scraper](https://img.shields.io/badge/Fediverse-Mastodon%20Scraper-6364ff.svg)](https://joinmastodon.org/)
[![Creator Contacts](https://img.shields.io/badge/Creator%20Discovery-Lead%20Gen-2da44e.svg)]()
[![Contact Extraction](https://img.shields.io/badge/Contacts-Email%20%2B%20Socials-8250df.svg)]()
[![Export Formats](https://img.shields.io/badge/Export-JSON%20%7C%20CSV%20%7C%20Excel-fb8500.svg)]()
[![Pagination](https://img.shields.io/badge/Pagination-1%2C000%2B%20Deep%20Crawl-brightgreen.svg)]()

> Built for growth hackers, B2B lead generation specialists, influencer marketers, talent recruiters sourcing open-source developers, journalists investigating open networks, and researchers mapping social graphs across the fediverse.

***

### ⚡ At a glance

| Capability | Feature Details |
|---|---|
| **Target Network** | Mastodon fediverse network (any public instance e.g., `mastodon.social`, `fosstodon.org`, `mas.to`) |
| **Discovery Modes** | 5-in-1: Keyword searches, direct handle lookup, followers graph, following graph, and instance directory |
| **Contact Extraction** | Auto-extracts emails, official websites, GitHub, Twitter/X, LinkedIn, YouTube, Instagram, and Patreon links |
| **Scale & Pagination** | Unlocked deep pagination supporting **1,000+ to 50,000+** accounts per run with zero hard caps |
| **Speed & Performance** | Pure HTTP streaming engine — collects 500+ accounts in under 30 seconds |
| **Authentication** | 100% keyless and login-free; no browser automation or heavy overhead required |
| **De-duplication** | Canonical profile URL and handle de-duplication guaranteeing **0 duplicates** across mixed sources |
| **Export Formats** | Clean JSON, NDJSON, CSV, Excel (`.xlsx`), HTML tables, and automated Apify REST API |
| **Compute Footprint** | Extremely lightweight memory profile (`256 MB - 512 MB`), zero browser overhead |

***

### 🔎 Why scrape Mastodon?

[Mastodon](https://joinmastodon.org/) is the dominant decentralized social platform of the **fediverse** — a global, open-source ecosystem consisting of thousands of independently operated servers and millions of active public profiles. Unlike closed corporate social networks that lock user profiles behind aggressive walled gardens, phone verification walls, and expensive enterprise API paywalls, Mastodon operates entirely on open protocols. This makes a dedicated **Mastodon scraper** one of the most effective, scalable avenues for **organic creator discovery, market intelligence, and B2B lead generation**.

Every public profile on Mastodon contains structured business intelligence:

- **Global Handles & Identity**: Globally unique federated handles (e.g., `@username@domain`) making cross-platform entity matching accurate and reliable.
- **Engagement & Reach Metrics**: Accurate follower, following, and total post metrics reflecting true audience reach without algorithmic distortion.
- **Structured Profile Fields**: Unlike ordinary bio text, Mastodon provides structured metadata fields where founders, developers, writers, and executives display their official websites, GitHub profiles, portfolios, and storefronts.
- **High-Converting Lead Data**: The most influential profiles actively publish verifiable contact links, turning raw social graphs into high-intent B2B outreach databases.

Manually collecting Mastodon accounts is impractical. Search results are federated across multiple server boundaries, large follower lists require cursor-based pagination, and contact details are embedded deep within HTML attributes. This **Mastodon scraper** automates the entire ingestion pipeline: it traverses pagination links, resolves handles, parses bio text, extracts contact links, de-duplicates profiles, and formats the data into tabular records ready for immediate CRM import.

***

### 🎯 Key Use Cases & Business Applications

#### 1. High-Intent B2B Lead Generation

Scraping the followers of industry thought leaders or tech executives yields hyper-targeted prospect lists. Because fediverse users explicitly choose who they follow without algorithmic feed injection, their follower graphs represent authentic professional interest. Extracting their websites and contact links provides direct outreach pathways for sales teams.

#### 2. Developer & Technical Talent Sourcing

Tech communities have migrated heavily to specialized instances such as `fosstodon.org`, `hachyderm.io`, and `infosec.exchange`. Technical recruiters can query developer keywords or crawl prominent open-source maintainers to discover senior software engineers, complete with verified GitHub handles and personal portfolios.

#### 3. Creator & Influencer Partnerships

Brands seeking genuine influencer partnerships can identify active creators across journalism, photography, literature, and technology. The scraper collects verified portfolio links and historical post counts, allowing marketers to evaluate creator authenticity and engagement before initiating outreach.

#### 4. Fediverse Network & Social Graph Mapping

Researchers and data scientists can map the topology of decentralized communities. By crawling followers and following lists recursively, analysts can identify bridge nodes, calculate centrality metrics, and visualize how ideas spread across independent server boundaries.

#### 5. CRM & Prospect Database Enrichment

Marketing teams with existing lists of fediverse handles or usernames can run batch enrichment runs. The scraper retrieves up-to-date bios, follower counts, verified links, and profile avatars, maintaining high data freshness in HubSpot, Salesforce, or Airtable.

#### 6. Media Monitoring & Public Discourse Analysis

Journalists and investigative researchers can track discussions across specialized journalist servers like `journa.host`. Automated scheduled runs capture emerging voices and track how public figures migrate across platforms.

***

### ✨ Key Features & Technical Highlights

- ✅ **Five Versatile Discovery Modes**:
  - **Keyword Search**: Run federated queries across global account databases by profession, topic, or interest (e.g., `"journalist"`, `"cybersecurity"`).
  - **Direct Handle Lookups**: Provide lists of specific accounts (e.g., `Gargron`, `username@server.org`) or profile URLs for instant bulk enrichment.
  - **Follower Networks**: Crawl the entire audience of key opinion leaders to acquire targeted niche networks.
  - **Following Lists**: Extract who an influential user follows to identify curated industry circles.
  - **Instance Directory**: Tap into the server-level directory of active users to capture broad regional or topical communities.
- ✅ **Deep 1,000+ Results Pagination**: Configured with smart cursor traversal (`max_id` link headers and offset handling) to crawl uninterrupted up to your requested `maxItems`.
- ✅ **Automated Contact Intelligence**: Built-in regex and DOM parsers extract emails, primary non-social website URLs, and external social media links from both bio copy and structured profile fields.
- ✅ **Guaranteed Zero Duplicates**: Deduplicates records using canonical profile URLs, ensuring clean datasets even when combining multiple keywords and follower seeds.
- ✅ **Configurable Instance Routing**: Direct the scraper to any Mastodon server (e.g., `mastodon.social`, `infosec.exchange`, `journa.host`) with seamless proxy support.
- ✅ **Enterprise Ready Exports**: Download clean datasets formatted for HubSpot, Salesforce, Airtable, Google Sheets, or custom data pipelines.
- ✅ **Cost-Optimized Architecture**: Executes as a lightweight HTTP process without browser overhead, keeping run costs to fractions of a cent per thousand profiles.

***

### 🥊 Mastodon Scraper vs Traditional Social Scraping

| Feature | Mastodon Scraper | Traditional Social Scrapers |
|---|---|---|
| **API Key Requirement** | ❌ None (Public, keyless access) | ⚠️ Expensive developer tiers |
| **Login / Session Cookies** | ❌ None required | ⚠️ High account ban risk |
| **Contact Data Quality** | 🟢 Rich verified fields & portfolio links | 🟡 Sparse, obfuscated bios |
| **Pagination Reliability** | 🟢 Native cursor pagination (1K+ clean) | 🔴 Frequent scroll stalls & rate locks |
| **Anti-Bot Gating** | 🟢 Clean HTTP protocol compliance | 🔴 Heavy Cloudflare / Turnstile challenges |
| **Operational Cost** | 🟢 Datacenter friendly (< $0.05 / run) | 🔴 Residential proxies + headless browsers |
| **Data Freshness** | 🟢 Real-time live query | 🟡 Stale third-party cache |

***

### 📥 Input Parameters

All parameters are optional. You can supply keyword searches, direct handles, follower seeds, or enable the instance directory.

| Parameter | Type | Default | Description |
|---|---|---|---|
| `instance` | String | `"mastodon.social"` | Mastodon instance domain to query (e.g., `mastodon.social`, `fosstodon.org`). |
| `searchTerms` | Array | `["journalist"]` | Keywords to find accounts by name, handle, or bio. Federated across connected instances. |
| `handles` | Array | `[]` | Specific handles to look up (e.g., `Gargron`, `username@server.org`, or full profile URLs). |
| `followersOf` | Array | `[]` | Seed accounts whose **followers** you want to scrape for audience building. |
| `followingOf` | Array | `[]` | Seed accounts whose **following** list you want to scrape. |
| `includeDirectory` | Boolean | `false` | Enable pulling active accounts directly from the server's public profile directory. |
| `includeContacts` | Boolean | `true` | Automatically extract emails, websites, and social links from bios and profile fields. |
| `maxItems` | Integer | `0` | Maximum total accounts to return (`0` = unlimited, governed by available results). |
| `maxPagesPerSource` | Integer | `0` | Pagination page limit per seed or query (`0` = auto/unlimited, governed by `maxItems`). |
| `proxyConfiguration` | Object | `{ "useApifyProxy": true }` | Proxy configuration. Datacenter proxies are fully supported. |

#### Example Input Configuration

```json
{
  "instance": "mastodon.social",
  "searchTerms": ["journalist", "investigative", "editor"],
  "followersOf": ["Gargron"],
  "includeDirectory": false,
  "includeContacts": true,
  "maxItems": 1000,
  "maxPagesPerSource": 0,
  "proxyConfiguration": {
    "useApifyProxy": true
  }
}
```

***

### 📤 Output Data Structure

The scraper outputs rich, normalized JSON records containing identity attributes, audience metrics, verified links, and extracted contact channels.

#### Sample Output Record

```json
{
  "id": "110264569437137765",
  "username": "sid",
  "acct": "sid@masto.twooter.org",
  "handle": "@sid@masto.twooter.org",
  "displayName": "Sid O'Knee",
  "bio": "Senior Cloud Architect & Open Source Contributor. #python #kubernetes #devops",
  "followersCount": 14820,
  "followingCount": 620,
  "statusesCount": 1845,
  "instance": "masto.twooter.org",
  "bot": false,
  "locked": false,
  "discoverable": true,
  "createdAt": "2021-04-12T14:22:10.000Z",
  "lastStatusAt": "2026-11-09T18:40:02.000Z",
  "avatar": "https://files.mastodon.social/cache/accounts/avatars/110/264/569/original/avatar.png",
  "header": "https://files.mastodon.social/cache/accounts/headers/110/264/569/original/header.png",
  "fields": [
    {
      "name": "Website",
      "value": "https://sid-engineer.dev",
      "url": "https://sid-engineer.dev",
      "verified": true
    },
    {
      "name": "GitHub",
      "value": "https://github.com/sidoKnee",
      "url": "https://github.com/sidoKnee",
      "verified": true
    }
  ],
  "verifiedLinks": [
    "https://sid-engineer.dev",
    "https://github.com/sidoKnee"
  ],
  "website": "https://sid-engineer.dev",
  "github": "sidoKnee",
  "email": "contact@sid-engineer.dev",
  "instagram": "",
  "twitter": "sid_cloud",
  "youtube": "",
  "tiktok": "",
  "linkedin": "sid-oknee",
  "twitch": "",
  "patreon": "",
  "profileUrl": "https://masto.twooter.org/@sid",
  "source": "search:journalist",
  "scrapedAt": "2026-11-10T14:30:00.000Z"
}
```

***

### 📊 Complete Field Reference & Data Coverage

The output schema provides comprehensive field coverage across profile metadata and lead contact signals.

#### 👤 Profile & Identity Information

| Field | Type | Description | Coverage |
|---|---|---|---|
| `id` | String | Unique numerical identifier on the host instance | 🟢 High (100%) |
| `username` | String | Local account username without domain suffix | 🟢 High (100%) |
| `acct` | String | Full user string (`username` or `username@domain`) | 🟢 High (100%) |
| `handle` | String | Canonical federated handle (`@user@domain`) | 🟢 High (100%) |
| `displayName` | String | Human-readable user display name | 🟢 High (~99%) |
| `bio` | String | Clean, plain-text profile summary with HTML tags stripped | 🟢 High (~98%) |
| `profileUrl` | String | Canonical URL of the profile used for de-duplication | 🟢 High (100%) |
| `instance` | String | Domain name of the home instance where the account resides | 🟢 High (100%) |
| `avatar` | String | High-resolution direct profile picture URL | 🟢 High (~95%) |
| `header` | String | Direct URL of the profile banner/header graphic | 🟡 Conditional (~70%) |

#### 📈 Engagement & Account Metrics

| Field | Type | Description | Coverage |
|---|---|---|---|
| `followersCount` | Number | Total registered followers across the fediverse | 🟢 High (100%) |
| `followingCount` | Number | Total accounts followed by this profile | 🟢 High (100%) |
| `statusesCount` | Number | Total public posts and toots published | 🟢 High (100%) |
| `bot` | Boolean | True if flagged as an automated bot account | 🟢 High (100%) |
| `locked` | Boolean | True if profile requires follow approval | 🟢 High (100%) |
| `discoverable` | Boolean | True if opted in to directory discovery | 🟡 Conditional (~80%) |
| `createdAt` | String | ISO 8601 creation timestamp of the account | 🟢 High (100%) |
| `lastStatusAt` | String | Date/timestamp of the most recent public post | 🟡 Conditional (~85%) |

#### 📬 Lead Generation & Extracted Contacts

| Field | Type | Description | Coverage |
|---|---|---|---|
| `website` | String | Primary non-social website URL from fields or bio | 🟢 High (~65% on creators) |
| `verifiedLinks` | Array | All URLs listed in structured profile fields | 🟢 High (~60% on creators) |
| `fields` | Array | Complete objects of profile attributes (`name`, `value`, `verified`) | 🟢 High (~75%) |
| `email` | String | Primary email address parsed from bio text or fields | 🟡 Conditional (~12-18%) |
| `github` | String | Extracted GitHub username | 🟡 Conditional (~30% on tech) |
| `twitter` | String | Extracted Twitter/X handle | 🟡 Conditional (~25%) |
| `linkedin` | String | Extracted LinkedIn vanity slug | 🟡 Conditional (~15%) |
| `youtube` | String | Extracted YouTube channel or handle | 🟡 Conditional (~10%) |
| `instagram` | String | Extracted Instagram username | 🟡 Conditional (~8%) |
| `source` | String | Input mode and seed that discovered this record | 🟢 High (100%) |
| `scrapedAt` | String | UTC timestamp when this record was extracted | 🟢 High (100%) |

***

### 🚀 Step-by-Step Usage Guide

#### 1. Web Console Interface

1. Navigate to the **Mastodon Scraper** page on the Apify Console.
2. Select your target `instance` (default: `mastodon.social`).
3. Enter keywords in `searchTerms`, target handles in `handles`, or influencer accounts in `followersOf`.
4. Adjust `maxItems` to your target lead volume (e.g., `500` or `5000`).
5. Click **Start** to initiate the extraction run.
6. Once complete, view the live tabular dataset or click **Export** to download your dataset.

#### 2. Python API Client

Integrate Mastodon lead extraction directly into your automated pipelines:

```python
from apify_client import ApifyClient

## Initialize the Apify client with your API token
client = ApifyClient("YOUR_APIFY_TOKEN")

## Configure input parameters for lead generation
run_input = {
    "instance": "mastodon.social",
    "searchTerms": ["journalist", "reporter"],
    "followersOf": ["Gargron"],
    "includeContacts": True,
    "maxItems": 1000,
    "maxPagesPerSource": 0,
}

## Run the actor and wait for completion
run = client.actor("haketa/mastodon-scraper").call(run_input=run_input)

## Iterate through dataset items and print verified leads
for item in client.dataset(run["defaultDatasetId"]).iterate_items():
    if item.get("website") or item.get("email"):
        print(f"Lead: {item['displayName']} ({item['handle']}) | Site: {item.get('website')} | Email: {item.get('email')}")
```

#### 3. Node.js API Client

```javascript
import { ApifyClient } from 'apify-client';

const client = new ApifyClient({
    token: 'YOUR_APIFY_TOKEN',
});

const run = await client.actor('haketa/mastodon-scraper').call({
    instance: 'mastodon.social',
    searchTerms: ['founder', 'cto'],
    maxItems: 500,
    maxPagesPerSource: 0,
});

const { items } = await client.dataset(run.defaultDatasetId).listItems();
console.log(`Successfully extracted ${items.length} Mastodon profiles.`);
```

#### 4. Direct cURL / REST API

Trigger headless runs from any terminal or CI/CD workflow:

```bash
curl -X POST "https://api.apify.com/v2/acts/haketa~mastodon-scraper/runs?token=YOUR_APIFY_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
    "instance": "mastodon.social",
    "searchTerms": ["developer", "engineer"],
    "maxItems": 250,
    "maxPagesPerSource": 0
  }'
```

***

### 🔒 Data Hygiene & Compliance Best Practices

When operating data extraction at scale on decentralized networks, observing respectful scraping hygiene ensures reliable long-term data collection:

- **Honor Rate Limits**: While public instances have generous limits, avoid extreme concurrency against smaller non-profit community servers.
- **Respect Privacy Settings**: The scraper automatically reflects the `locked` and `discoverable` flags present in user metadata. Honor these flags when building outreach cadences.
- **Focus on Business Leads**: Prioritize profiles with active `verifiedLinks` and explicit portfolio markers, which yield substantially higher email deliverability and response rates.

***

### 💡 Advanced Scraping Strategies & Best Practices

1. **Targeting Domain-Specific Instances**: Mastodon is divided into dedicated topic instances. For cybersecurity leads, query `infosec.exchange`; for open-source developers, scrape `fosstodon.org` or `hachyderm.io`; for journalists, target `journa.host`.
2. **Follower Graph Mining (`followersOf`)**: Scraping the followers of well-known industry figures yields hyper-targeted B2B prospect lists that share specific professional interests.
3. **Focus on `verifiedLinks`**: Mastodon's link verification mechanism allows users to cryptographically prove ownership of their personal websites or GitHub accounts. Profiles with verified fields represent high-authority leads.
4. **Automated Scheduled Monitoring**: Schedule weekly runs on key hashtags or competitor follower graphs to identify new community entrants and emerging creators automatically.
5. **Combine Search with Directory**: Use `searchTerms` for thematic relevance and toggle `includeDirectory: true` when you need large volumes of recently active accounts.
6. **Integrate with CRM Webhooks**: Configure Apify dataset integrations to push extracted leads directly into HubSpot or Salesforce whenever a scheduled run finishes.

***

### ❓ Frequently Asked Questions (FAQ)

##### Do I need a Mastodon account or API key to use this scraper?

No. The actor leverages open public protocol endpoints, requiring no personal login, access token, or user credentials.

##### How does deep pagination work?

The actor dynamically inspects cursor markers across follower lists and server directories. Setting `maxPagesPerSource: 0` allows the crawler to paginate deeply until reaching your requested `maxItems`.

##### Are datacenter proxies sufficient?

Yes. Mastodon instances do not require expensive residential proxies. The default Apify datacenter proxy configuration provides reliable, cost-effective performance.

##### What makes this different from scraping Twitter or Threads?

Mastodon provides clean, public, un-obfuscated profile structures with dedicated website and link-verification fields. It is not restricted by aggressive anti-scraping walls, ensuring reliable data extraction at predictable costs.

##### Can I export directly to Google Sheets or CRMs?

Yes. You can export datasets in CSV or Excel formats, or connect Apify webhooks and Zapier / Make integrations to stream leads directly into HubSpot, Salesforce, or Airtable.

##### What is the difference between local and remote followers?

When scraping followers on a given instance, local accounts (hosted on that server) have 100% complete follower graphs. For remote federated accounts, the host server knows the subset of followers connected through federated relay activities.

##### Why is the email field sometimes empty?

Most Mastodon users prefer publishing personal website URLs, GitHub profiles, or verified portfolio links rather than plain-text email addresses in their bios. Check `website` and `verifiedLinks` for primary contact methods.

***

### 📋 Changelog

#### Version 1.2.0 (2026-11)

- **Deep 1,000+ Pagination**: Re-architected pagination limits so `maxPagesPerSource: 0` enables auto-unlimited deep crawling governed strictly by `maxItems`.
- **Fast Prefill Optimization**: Streamlined prefill parameters to execute verified discovery runs in under 30 seconds.
- **Enhanced Contact Parsing**: Improved extraction patterns for personal portfolio domains, email addresses, and social handles from custom bio fields.
- **Strict Zero-Duplicate Filtering**: Upgraded canonical handle and URL normalization to eliminate duplicate records across mixed keyword and follower sources.

#### Version 1.1.0 (2026-10)

- Added structured profile field extraction (`fields` array and `verifiedLinks`).
- Introduced direct handle lookup mode and server directory pagination.
- Integrated dual-channel dataset and key-value store output mirroring.

#### Version 1.0.0 (2026-10)

- Initial release featuring keyword search and follower graph scraping with datacenter proxy support.

# Changelog

This Actor's version history is a separate document: https://apify.com/haketa/mastodon-scraper/changelog.md

# Actor input Schema

## `instance` (type: `string`):

Mastodon instance to query (e.g. mastodon.social). Search is federated across instances.

## `searchTerms` (type: `array`):

Keywords to find accounts (name, handle, bio). e.g. "journalist", "photographer".

## `handles` (type: `array`):

Specific handles to look up (e.g. Gargron, user@another.instance). Accepts @handle or profile URLs.

## `followersOf` (type: `array`):

Scrape the followers of these accounts — build an audience/lead list.

## `followingOf` (type: `array`):

Scrape who these accounts follow.

## `includeDirectory` (type: `boolean`):

Also pull accounts from the instance's public directory (active profiles).

## `includeContacts` (type: `boolean`):

Pull email, website and social links from each bio and verified fields.

## `maxItems` (type: `integer`):

Maximum accounts to return. 0 = no limit.

## `maxPagesPerSource` (type: `integer`):

Pagination cap per search term / seed account. 0 = unlimited, governed by maxItems.

## `proxyConfiguration` (type: `object`):

Apify Proxy. The API is public — datacenter is enough and enabled by default.

## Actor input object example

```json
{
  "instance": "mastodon.social",
  "searchTerms": [
    "journalist"
  ],
  "includeDirectory": false,
  "includeContacts": true,
  "maxItems": 100,
  "maxPagesPerSource": 0,
  "proxyConfiguration": {
    "useApifyProxy": true
  }
}
```

# Actor output Schema

## `id` (type: `string`):

Account ID (per instance)

## `username` (type: `string`):

Username

## `acct` (type: `string`):

Full acct

## `handle` (type: `string`):

@user@instance

## `displayName` (type: `string`):

Display name

## `bio` (type: `string`):

Profile bio

## `followersCount` (type: `string`):

Followers

## `followingCount` (type: `string`):

Following

## `statusesCount` (type: `string`):

Post count

## `instance` (type: `string`):

Home instance

## `bot` (type: `string`):

Bot account

## `locked` (type: `string`):

Locked account

## `createdAt` (type: `string`):

Account created

## `lastStatusAt` (type: `string`):

Last post date

## `avatar` (type: `string`):

Avatar URL

## `verifiedLinks` (type: `string`):

Verified field links

## `email` (type: `string`):

Email from bio

## `website` (type: `string`):

Website from bio

## `instagram` (type: `string`):

Instagram

## `twitter` (type: `string`):

Twitter/X

## `youtube` (type: `string`):

YouTube

## `github` (type: `string`):

GitHub

## `linkedin` (type: `string`):

LinkedIn

## `profileUrl` (type: `string`):

Profile URL

## `source` (type: `string`):

Which query found it

## `scrapedAt` (type: `string`):

ISO timestamp

# 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 = {
    "instance": "mastodon.social",
    "searchTerms": [
        "journalist"
    ],
    "maxItems": 100,
    "maxPagesPerSource": 0,
    "proxyConfiguration": {
        "useApifyProxy": true
    }
};

// Run the Actor and wait for it to finish
const run = await client.actor("haketa/mastodon-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 = {
    "instance": "mastodon.social",
    "searchTerms": ["journalist"],
    "maxItems": 100,
    "maxPagesPerSource": 0,
    "proxyConfiguration": { "useApifyProxy": True },
}

# Run the Actor and wait for it to finish
run = client.actor("haketa/mastodon-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 '{
  "instance": "mastodon.social",
  "searchTerms": [
    "journalist"
  ],
  "maxItems": 100,
  "maxPagesPerSource": 0,
  "proxyConfiguration": {
    "useApifyProxy": true
  }
}' |
apify call haketa/mastodon-scraper --silent --output-dataset

```

## MCP server setup

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