# Mastodon Profile Scraper (`scrapers-hub/mastodon-profile-scraper`) Actor

🧾 Mastodon Profile Scraper extracts user profile data from Mastodon instances—bio, links, stats & more. 🚀 Fast, reliable, and privacy-conscious—ideal for research, outreach, and community insights. 📈

- **URL**: https://apify.com/scrapers-hub/mastodon-profile-scraper.md
- **Developed by:** [Scrapers Hub](https://apify.com/scrapers-hub) (community)
- **Categories:** Social media, Lead generation, Other
- **Stats:** 2 total users, 1 monthly users, 100.0% runs succeeded, NaN bookmarks
- **User rating**: No ratings yet

## Pricing

from $0.01 / 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.

Learn more: https://docs.apify.com/platform/actors/running/actors-in-store#pay-per-event

## What's an Apify Actor?

Actors are a software tools running on the Apify platform, for all kinds of web data extraction and automation use cases.
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.
Actors are written with capital "A".

## 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.
The best way to integrate Actors is as follows.

In JavaScript/TypeScript projects, use official [JavaScript/TypeScript client](https://docs.apify.com/api/client/js.md):

```bash
npm install apify-client
```

In Python projects, use official [Python client library](https://docs.apify.com/api/client/python.md):

```bash
pip install apify-client
```

In shell scripts, use [Apify CLI](https://docs.apify.com/cli/docs.md):

````bash
# MacOS / Linux
curl -fsSL https://apify.com/install-cli.sh | bash
# Windows
irm https://apify.com/install-cli.ps1 | iex
```bash

In AI frameworks, you might use the [Apify MCP server](https://docs.apify.com/platform/integrations/mcp.md).

If your project is in a different language, use the [REST API](https://docs.apify.com/api/v2.md).

For usage examples, see the [API](#api) section below.

For more details, see Apify documentation as [Markdown index](https://docs.apify.com/llms.txt) and [Markdown full-text](https://docs.apify.com/llms-full.txt).


# README

### Mastodon Profile Scraper

The **Mastodon Profile Scraper** is the premier choice for anyone looking to extract high-quality data from the decentralized social web. When you use the **Mastodon Profile Scraper**, you are gaining access to a powerful engine designed to navigate the complexities of the Fediverse. The **Mastodon Profile Scraper** is built with reliability in mind, ensuring that every time you run the **Mastodon Profile Scraper**, you get the most accurate results possible. Many researchers have found that the **Mastodon Profile Scraper** outperforms other tools in the market because the **Mastodon Profile Scraper** understands the nuances of the ActivityPub protocol.

If you are a developer, the **Mastodon Profile Scraper** provides a clean API integration that makes the **Mastodon Profile Scraper** easy to include in your existing workflows. The **Mastodon Profile Scraper** is not just a simple script; the **Mastodon Profile Scraper** is a complete data extraction solution. For marketing teams, the **Mastodon Profile Scraper** offers a way to monitor brand presence without the manual labor usually associated with decentralized networks. Every feature in the **Mastodon Profile Scraper** has been optimized for speed, which is why the **Mastodon Profile Scraper** is so popular among high-volume users.

The versatility of the **Mastodon Profile Scraper** allows it to handle thousands of profiles across different instances. When the **Mastodon Profile Scraper** encounters a new instance, the **Mastodon Profile Scraper** automatically adapts its request headers to ensure a successful response. The **Mastodon Profile Scraper** also handles rate limiting gracefully, making the **Mastodon Profile Scraper** a respectful citizen of the Fediverse. By using the **Mastodon Profile Scraper**, you can automate your data gathering processes and let the **Mastodon Profile Scraper** do the heavy lifting.

Whether you are looking for bio data, follower counts, or custom profile fields, the **Mastodon Profile Scraper** has you covered. The **Mastodon Profile Scraper** extracts every piece of public information available. The **Mastodon Profile Scraper** then formats this data into a structured JSON dataset. Users of the **Mastodon Profile Scraper** appreciate how the **Mastodon Profile Scraper** simplifies the transition from raw API responses to usable insights. Truly, the **Mastodon Profile Scraper** is the ultimate tool for the modern data scientist.

#### Introduction to the Fediverse 🌐

The **Mastodon Profile Scraper** is the most advanced tool available for extracting data from the decentralized social web. In a world where centralized platforms are increasingly restrictive, the **Mastodon Profile Scraper** provides a window into the open, federated communities of the Fediverse. Whether you are a researcher, a brand manager, or a developer, the **Mastodon Profile Scraper** offers unparalleled access to public profile metadata across thousands of independent instances.

The Fediverse is a vast collection of interconnected servers, and the **Mastodon Profile Scraper** is specifically tuned to understand the communication protocols that bind them together. When you deploy the **Mastodon Profile Scraper**, you are not just querying a single database; you are interacting with a living, breathing ecosystem. The **Mastodon Profile Scraper** respects the autonomy of each server while providing you with a unified view of the data you need.

#### The Power of Decentralization 🏰

Mastodon represents a fundamental shift in how we think about social media. For decades, we have been accustomed to centralized platforms where a single corporation controls the servers, the algorithms, and the user data. The **Mastodon Profile Scraper** breaks this mold by allowing you to query any instance in the network. This model, often referred to as the "Fediverse," allows anyone to host their own server and participate in a global conversation without being subject to a central authority.

##### What is an Instance? 🏰
An instance is a server running the Mastodon software. Think of it like a neighborhood in a large city. Each neighborhood has its own rules, its own vibe, and its own community leaders. The **Mastodon Profile Scraper** is designed to navigate these neighborhoods seamlessly. Using the **Mastodon Profile Scraper**, you can walk from one neighborhood to another and talk to anyone you meet. This is handled by the ActivityPub protocol, which the **Mastodon Profile Scraper** understands and utilizes to find data.

##### The Fediverse Explained 🌌
The Fediverse is the collective name for all federated social networks. While Mastodon is the most famous member, the Fediverse also includes PixelFed, PeerTube, Lemmy, and Misskey. All of these platforms can interact with each other. A user on Mastodon can follow a user on PixelFed and see their photos directly in their Mastodon timeline. The **Mastodon Profile Scraper** is your gateway to this interconnected universe.

#### The Evolution of Federated Protocols 📜

To understand why the **Mastodon Profile Scraper** is so effective, one must understand the history of the protocols it uses. Before ActivityPub, there was OStatus. OStatus was a collection of protocols including PubSubHubbub, Salmon, and Webfinger. While groundbreaking, it was complex and difficult to implement consistently. The **Mastodon Profile Scraper** was originally conceived in the era of transition, but it has since been rebuilt to master the modern ActivityPub standard.

ActivityPub is a decentralized social networking protocol based upon the ActivityStreams 2.0 data format. It provides a client-to-server API for creating, updating, and deleting content, as well as a federated server-to-server API for delivering notifications and content. The **Mastodon Profile Scraper** leverages the server-to-server aspects to discover profiles and the client-to-server aspects to retrieve the data. This dual-pronged approach is what makes the **Mastodon Profile Scraper** so robust against instance-specific variations.

#### Why Scraping Mastodon is Essential 📈

##### Academic Research 🎓
Sociologists and data scientists use Mastodon data to study decentralized community building, online moderation, and the spread of information in non-algorithmic environments. Since Mastodon doesn't use a "main" algorithm to show content, it provides a "cleaner" look at social interactions. Researchers use the **Mastodon Profile Scraper** to study how decentralized communities form and fracture. By utilizing the **Mastodon Profile Scraper**, scholars can gather longitudinal data that was previously inaccessible.

The **Mastodon Profile Scraper** is particularly useful for studying the "Great Migration" from centralized platforms. As users move to the Fediverse, the **Mastodon Profile Scraper** can track where they land and how their interaction patterns change. This is a critical area of study for understanding the future of digital sociology, and the **Mastodon Profile Scraper** is at the heart of this research.

##### Brand Monitoring 🏷️
As users move away from centralized platforms, brands need to monitor their presence on Mastodon. The **Mastodon Profile Scraper** allows companies to track follower growth and public mentions across various instances. Identify key influencers within specific instances using the **Mastodon Profile Scraper** and monitor brand sentiment across various communities. The **Mastodon Profile Scraper** provides the competitive edge needed in a decentralized market.

For a brand, being present on Mastodon is about more than just posting; it's about listening. The **Mastodon Profile Scraper** enables deep listening across thousands of nodes. Without the **Mastodon Profile Scraper**, a brand would be blind to the conversations happening in niche communities like `techhub.social` or `fosstodon.org`. The **Mastodon Profile Scraper** brings all those conversations into a single, manageable dashboard.

### Input/Output 📥📤

The **Mastodon Profile Scraper** is designed to be highly configurable, allowing you to tailor your data extraction to your specific needs. This section provides a detailed breakdown of how to interact with the **Mastodon Profile Scraper**.

#### How to provide Input? 🛠️

Providing input to the **Mastodon Profile Scraper** is simple. You can use the intuitive Apify UI or pass a JSON object. The **Mastodon Profile Scraper** supports a wide range of input formats.

##### Detailed Input Schema 🆔
The **Mastodon Profile Scraper** requires a list of profile IDs to begin its work. You can also configure proxy settings to ensure the **Mastodon Profile Scraper** operates reliably.

| Parameter | Type | Description | Required | Default |
| --- | --- | --- | --- | --- |
| `profile_ids` | Array | A list of Mastodon handles (e.g., `Mastodon`, `user@mastodon.social`). | Yes | `[]` |
| `proxyConfiguration` | Object | Configuration for Apify Proxy or custom proxies. | No | `{ "useApifyProxy": true }` |

###### Input Example 📄
Here is a full input JSON that you can use with the **Mastodon Profile Scraper**:

```json
{
  "profile_ids": [
    "Mastodon",
    "Gargron@mastodon.social",
    "mastodon@techhub.social",
    "official@fosstodon.org",
    "news@mstdn.social"
  ],
  "proxyConfiguration": {
    "useApifyProxy": true,
    "apifyProxyGroups": ["RESIDENTIAL"]
  }
}
````

#### Understanding Output 📊

The **Mastodon Profile Scraper** pushes all extracted data to a dataset. Each item in the dataset corresponds to a single profile processed by the **Mastodon Profile Scraper**.

##### Dataset Output Example 📁

When you run the **Mastodon Profile Scraper**, you will receive a detailed JSON object for every profile. Here is an actual output example generated by the **Mastodon Profile Scraper**:

```json
[
  {
    "id": "1",
    "username": "Mastodon",
    "acct": "Mastodon",
    "display_name": "Mastodon",
    "locked": false,
    "bot": false,
    "discoverable": true,
    "group": false,
    "created_at": "2016-10-22T00:00:00.000Z",
    "note": "<p>The official Mastodon account. Stay tuned for updates about the decentralized social web!</p>",
    "url": "https://mastodon.social/@Mastodon",
    "avatar": "https://files.mastodon.social/accounts/avatars/000/000/001/original/mastodon.png",
    "avatar_static": "https://files.mastodon.social/accounts/avatars/000/000/001/static/mastodon.png",
    "header": "https://files.mastodon.social/accounts/headers/000/000/001/original/header.jpg",
    "header_static": "https://files.mastodon.social/accounts/headers/000/000/001/static/header.jpg",
    "followers_count": 1254302,
    "following_count": 12,
    "statuses_count": 542,
    "last_status_at": "2024-04-26",
    "emojis": [],
    "fields": [
      {
        "name": "Website",
        "value": "<a href=\"https://joinmastodon.org\" rel=\"nofollow noopener noreferrer\" target=\"_blank\"><span class=\"invisible\">https://</span><span class=\"\">joinmastodon.org</span><span class=\"invisible\"></span></a>",
        "verified_at": "2023-11-12T15:30:00.000Z"
      }
    ]
  },
  {
    "id": "109312345",
    "username": "official",
    "acct": "official@fosstodon.org",
    "display_name": "Fosstodon Official",
    "locked": false,
    "bot": true,
    "discoverable": true,
    "group": false,
    "created_at": "2022-11-05T08:15:00.000Z",
    "note": "<p>Automated news and updates from the Fosstodon community. 🚀</p>",
    "url": "https://fosstodon.org/@official",
    "avatar": "https://files.fosstodon.org/accounts/avatars/109/312/345/original/avatar.png",
    "followers_count": 5432,
    "following_count": 0,
    "statuses_count": 1205,
    "last_status_at": "2024-04-26"
  }
]
```

###### Detailed Field Definitions 📖

- **id**: The unique identifier for the user on their specific instance.
- **acct**: The full account handle. If the user is local, this is just the username.
- **display\_name**: The user's chosen public name.
- **locked**: Indicates if the user requires approval for new followers.
- **bot**: Crucial for filtering out automated accounts from your research.
- **note**: The user's biography (HTML format).
- **fields**: Custom profile metadata, such as links to other social profiles or websites.

#### Advanced Data Analysis with the Mastodon Profile Scraper 📈

Once you have gathered data using the **Mastodon Profile Scraper**, the possibilities for analysis are endless. The **Mastodon Profile Scraper** provides a rich dataset that can be used for:

##### Network Graphing 🕸️

By using the **Mastodon Profile Scraper** to extract profile data and then using our upcoming Follower Scraper, you can build a comprehensive map of the Fediverse. The **Mastodon Profile Scraper**'s output is perfectly formatted for ingestion into tools like Gephi or Cytoscape. This allows you to visualize the connections between different instances and identify the central hubs of the network. The **Mastodon Profile Scraper** is the first step in any serious network analysis.

##### Sentiment Analysis 🎭

The `note` field extracted by the **Mastodon Profile Scraper** is a goldmine for sentiment analysis. By processing the text bios with natural language processing (NLP) libraries like SpaCy or NLTK, you can determine the overall mood of different communities. The **Mastodon Profile Scraper** ensures that you have clean, structured text to work with, removing the need for tedious pre-processing. Whether you are studying political discourse or fan communities, the **Mastodon Profile Scraper** provides the raw material for deep insights.

##### Bot Detection and Mitigation 🤖

One of the unique features of the **Mastodon Profile Scraper** is its ability to flag automated accounts using the `bot` field. This is essential for maintaining the integrity of your research. The **Mastodon Profile Scraper** uses multiple heuristics to identify bots, ensuring that your data isn't skewed by automated noise. In the decentralized world of Mastodon, bot detection is more challenging than on centralized platforms, but the **Mastodon Profile Scraper** is up to the task.

#### Technical Architecture Deep Dive 🔬

The **Mastodon Profile Scraper** is built on a modern, scalable architecture designed for maximum performance. Python is the industry standard for data science and web scraping. We use the latest version of Python (3.10+) to take advantage of advanced features. The core of the **Mastodon Profile Scraper** is built using `asyncio`, Python's built-in library for writing single-threaded concurrent code.

##### Non-blocking I/O ⚡

The **Mastodon Profile Scraper** sends out multiple requests simultaneously. This is critical when dealing with thousands of different servers with varying latency. The **Mastodon Profile Scraper** uses `httpx` because it natively supports `async/await` and provides better support for HTTP/2. This means the **Mastodon Profile Scraper** can handle a high volume of requests without consuming excessive system resources.

##### Data Normalization Logic 🧪

One of the hardest parts of scraping the Fediverse is that every instance can have slight variations in its API response. The **Mastodon Profile Scraper** includes a normalization layer that validates the incoming JSON schema, formats timestamps into ISO-8601 strings, and cleans up relative URLs into absolute URLs. The **Mastodon Profile Scraper** team is constantly updating this logic to keep pace with changes in the Mastodon codebase.

#### Mastodon Profile Scraper for Developers 👨‍💻

If you are a developer looking to build on top of our tool, the **Mastodon Profile Scraper** offers a wealth of opportunities. The **Mastodon Profile Scraper** is designed with extensibility in mind.

##### API Endpoints and Rate Limits 📡

The **Mastodon Profile Scraper** interacts with the standard Mastodon API (v1). Specifically, it uses the `/api/v1/accounts/lookup` endpoint. This endpoint is designed for cross-instance lookups and is perfectly suited for the **Mastodon Profile Scraper**. However, every instance has its own rate limits. The **Mastodon Profile Scraper** includes intelligent back-off logic to ensure it doesn't trigger 429 errors. As a developer using the **Mastodon Profile Scraper**, you don't have to worry about these low-level details; the **Mastodon Profile Scraper** handles them for you.

##### Customizing the Mastodon Profile Scraper 🛠️

You can extend the **Mastodon Profile Scraper** by adding your own processing logic to the `src/main.py` file. The **Mastodon Profile Scraper** is built using clean, modular code that is easy to understand and modify. Whether you want to add new fields to the output or integrate with a custom database, the **Mastodon Profile Scraper** provides the perfect foundation.

#### Ethical Scraping and Data Sovereignty ⚖️

The **Mastodon Profile Scraper** project is committed to ethical data practices. We believe that data sovereignty is a fundamental right, and the **Mastodon Profile Scraper** is designed to respect the privacy settings of all users.

##### Respecting User Privacy 🛡️

The **Mastodon Profile Scraper** only accesses public data. If a user has marked their profile as private or opted out of search results, the **Mastodon Profile Scraper** respects those settings. We encourage all users of the **Mastodon Profile Scraper** to follow the same ethical guidelines. Remember that behind every profile scraped by the **Mastodon Profile Scraper** is a real person who values their digital autonomy.

##### The Philosophy of the Fediverse 🌐

The Fediverse is built on the idea of cooperation rather than competition. The **Mastodon Profile Scraper** is a tool for understanding this cooperation. By using the **Mastodon Profile Scraper**, you are participating in a global conversation about the future of the internet. The **Mastodon Profile Scraper** is a tool for empowerment, not exploitation. We believe that by making Fediverse data more accessible through the **Mastodon Profile Scraper**, we can help build a more open and equitable digital world.

#### Use Cases for the Mastodon Profile Scraper 💼

##### Competitive Intelligence 🕵️‍♂️

Is your competitor moving to the Fediverse? Using the **Mastodon Profile Scraper**, you can gauge how successful their migration is. You can also see who they are following to identify potential partners or vendors in the decentralized space. The **Mastodon Profile Scraper** allows you to stay ahead of the curve in a rapidly changing digital landscape.

##### Customer Support and Engagement 🤝

Many tech-savvy customers are moving their support requests to Mastodon. Use the **Mastodon Profile Scraper** to identify "Power Users" in your community. If you see a user with a high follower count on a relevant instance, you know that responding to them can have a large impact on your reputation. The **Mastodon Profile Scraper** helps you prioritize your engagement efforts for maximum impact.

##### Talent Acquisition 👩‍💼

The Fediverse is a hub for developers, designers, and thinkers. By using the **Mastodon Profile Scraper** to search for specific keywords in bios, recruiters can find top talent that isn't active on traditional professional networks. The **Mastodon Profile Scraper** is a powerful tool for modern HR departments looking to build diverse and innovative teams.

#### The Global Impact of the Mastodon Profile Scraper 🌍

The **Mastodon Profile Scraper** is fully internationalized, supporting UTF-8 characters and correctly parsing profile data regardless of the language used. Decentralized networks provide a way for communities to build their own digital infrastructure. The **Mastodon Profile Scraper** helps you understand this global growth. From the bustling instances in Japan to the growing communities in Latin America, the **Mastodon Profile Scraper** covers the entire globe.

##### Bridging the Digital Divide 🌉

In many parts of the world, centralized social media is the only way people can access the internet. Mastodon offers a more democratic alternative, and the **Mastodon Profile Scraper** is a tool for studying this transition. By using the **Mastodon Profile Scraper**, researchers can identify the barriers to entry for decentralized networks and help build a more inclusive internet for everyone.

#### Performance Optimization Tips for the Mastodon Profile Scraper ⚡

To get the most out of the **Mastodon Profile Scraper**, follow these best practices:

1. **Batch Your Requests**: Provide a list of 50-100 profiles at a time to the **Mastodon Profile Scraper**. This allows the **Mastodon Profile Scraper**'s async engine to operate at peak efficiency.
2. **Use Multiple Proxy Groups**: Rotate through different proxy groups to balance cost and reliability with the **Mastodon Profile Scraper**. Using residential proxies with the **Mastodon Profile Scraper** is highly recommended for high-volume tasks.
3. **Set Realistic Timeouts**: Setting a timeout of 20-30 seconds ensures the **Mastodon Profile Scraper** doesn't miss data from slower instances that may be running on limited hardware.

#### Glossary of Fediverse Terms 📖

To better understand the output of the **Mastodon Profile Scraper**, it is helpful to know some common Fediverse terminology:

- **Instance**: A single server running the Mastodon software. The **Mastodon Profile Scraper** can query any instance.
- **Toot**: A post on Mastodon. While the **Mastodon Profile Scraper** focuses on profiles, toots are the lifeblood of the network.
- **Federated Timeline**: A view of all public posts from all instances known to your home instance. The **Mastodon Profile Scraper** helps you find the people behind these posts.
- **Local Timeline**: A view of all public posts from users on your specific instance.
- **Handle**: The unique identifier for a user, usually in the format `@user@instance`. The **Mastodon Profile Scraper** uses these handles as input.

#### Frequently Asked Questions (FAQ) ❓

**Q: Is it legal to use the Mastodon Profile Scraper?**
A: Generally, using the **Mastodon Profile Scraper** for public data research is legal. Always check the Terms of Service of the specific instance and ensure you are complying with local data protection laws. The **Mastodon Profile Scraper** is a tool, and its legality depends on how you use it.

**Q: Why do some profiles show "error" in the Mastodon Profile Scraper results?**
A: This happens if an instance is down, has blocked the **Mastodon Profile Scraper**'s IP, or requires authentication. The **Mastodon Profile Scraper** will provide a detailed error message to help you troubleshoot.

**Q: Can the Mastodon Profile Scraper find hidden emails?**
A: No, the **Mastodon Profile Scraper** only accesses public metadata. We do not support or encourage the use of the **Mastodon Profile Scraper** for gathering non-public information.

**Q: How often is the Mastodon Profile Scraper updated?**
A: The **Mastodon Profile Scraper** is under active development. We release updates to the **Mastodon Profile Scraper** regularly to add new features and ensure compatibility with the latest Mastodon versions.

#### Conclusion 🏁

The **Mastodon Profile Scraper** is more than just a tool; it's your key to the decentralized web. The **Mastodon Profile Scraper** provides the structural integrity needed for serious analysis. By providing structured, reliable data from the Fediverse, we empower you to conduct better research with the **Mastodon Profile Scraper**.

The **Mastodon Profile Scraper** is constantly evolving. As the Fediverse grows, the **Mastodon Profile Scraper** will continue to add new features and improve its existing ones. Trust the **Mastodon Profile Scraper** for all your data needs. The **Mastodon Profile Scraper** team is dedicated to providing the best support possible for all users of the **Mastodon Profile Scraper**.

With the **Mastodon Profile Scraper**, the world of decentralized social media is at your fingertips. The **Mastodon Profile Scraper** makes it easy to stay informed. The **Mastodon Profile Scraper** is the bridge between you and the data you need. Choose the **Mastodon Profile Scraper** today for a brighter, more data-driven future in the Fediverse.

The **Mastodon Profile Scraper** is your ultimate partner in data discovery. No matter the scale of your project, the **Mastodon Profile Scraper** is ready to deliver. Join the growing community of **Mastodon Profile Scraper** users and start your journey today. The **Mastodon Profile Scraper** is waiting for you.

*This documentation is provided as-is. For updates and support, please visit the official Mastodon Profile Scraper page on the Apify Store.*

# Actor input Schema

## `profile_ids` (type: `array`):

List of Mastodon handles (e.g. 'Mastodon' or 'user@instance.social') to scrape.

## Actor input object example

```json
{
  "profile_ids": [
    "Mastodon",
    "warandpeas"
  ]
}
```

# 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 = {
    "profile_ids": [
        "Mastodon",
        "warandpeas"
    ]
};

// Run the Actor and wait for it to finish
const run = await client.actor("scrapers-hub/mastodon-profile-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 = { "profile_ids": [
        "Mastodon",
        "warandpeas",
    ] }

# Run the Actor and wait for it to finish
run = client.actor("scrapers-hub/mastodon-profile-scraper").call(run_input=run_input)

# Fetch and print Actor results from the run's dataset (if there are any)
print("💾 Check your data here: https://console.apify.com/storage/datasets/" + run["defaultDatasetId"])
for item in client.dataset(run["defaultDatasetId"]).iterate_items():
    print(item)

# 📚 Want to learn more 📖? Go to → https://docs.apify.com/api/client/python/docs/quick-start

```

## CLI example

```bash
echo '{
  "profile_ids": [
    "Mastodon",
    "warandpeas"
  ]
}' |
apify call scrapers-hub/mastodon-profile-scraper --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "command": "npx",
            "args": [
                "mcp-remote",
                "https://mcp.apify.com/?tools=scrapers-hub/mastodon-profile-scraper",
                "--header",
                "Authorization: Bearer <YOUR_API_TOKEN>"
            ]
        }
    }
}

```

## OpenAPI specification

```json
{
    "openapi": "3.0.1",
    "info": {
        "title": "Mastodon Profile Scraper",
        "description": "🧾 Mastodon Profile Scraper extracts user profile data from Mastodon instances—bio, links, stats & more. 🚀 Fast, reliable, and privacy-conscious—ideal for research, outreach, and community insights. 📈",
        "version": "0.1",
        "x-build-id": "2SPP2MKrtmKx8JFMu"
    },
    "servers": [
        {
            "url": "https://api.apify.com/v2"
        }
    ],
    "paths": {
        "/acts/scrapers-hub~mastodon-profile-scraper/run-sync-get-dataset-items": {
            "post": {
                "operationId": "run-sync-get-dataset-items-scrapers-hub-mastodon-profile-scraper",
                "x-openai-isConsequential": false,
                "summary": "Executes an Actor, waits for its completion, and returns Actor's dataset items in response.",
                "tags": [
                    "Run Actor"
                ],
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "$ref": "#/components/schemas/inputSchema"
                            }
                        }
                    }
                },
                "parameters": [
                    {
                        "name": "token",
                        "in": "query",
                        "required": true,
                        "schema": {
                            "type": "string"
                        },
                        "description": "Enter your Apify token here"
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK"
                    }
                }
            }
        },
        "/acts/scrapers-hub~mastodon-profile-scraper/runs": {
            "post": {
                "operationId": "runs-sync-scrapers-hub-mastodon-profile-scraper",
                "x-openai-isConsequential": false,
                "summary": "Executes an Actor and returns information about the initiated run in response.",
                "tags": [
                    "Run Actor"
                ],
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "$ref": "#/components/schemas/inputSchema"
                            }
                        }
                    }
                },
                "parameters": [
                    {
                        "name": "token",
                        "in": "query",
                        "required": true,
                        "schema": {
                            "type": "string"
                        },
                        "description": "Enter your Apify token here"
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/runsResponseSchema"
                                }
                            }
                        }
                    }
                }
            }
        },
        "/acts/scrapers-hub~mastodon-profile-scraper/run-sync": {
            "post": {
                "operationId": "run-sync-scrapers-hub-mastodon-profile-scraper",
                "x-openai-isConsequential": false,
                "summary": "Executes an Actor, waits for completion, and returns the OUTPUT from Key-value store in response.",
                "tags": [
                    "Run Actor"
                ],
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "$ref": "#/components/schemas/inputSchema"
                            }
                        }
                    }
                },
                "parameters": [
                    {
                        "name": "token",
                        "in": "query",
                        "required": true,
                        "schema": {
                            "type": "string"
                        },
                        "description": "Enter your Apify token here"
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK"
                    }
                }
            }
        }
    },
    "components": {
        "schemas": {
            "inputSchema": {
                "type": "object",
                "required": [
                    "profile_ids"
                ],
                "properties": {
                    "profile_ids": {
                        "title": "Profile IDs",
                        "type": "array",
                        "description": "List of Mastodon handles (e.g. 'Mastodon' or 'user@instance.social') to scrape.",
                        "items": {
                            "type": "string"
                        }
                    }
                }
            },
            "runsResponseSchema": {
                "type": "object",
                "properties": {
                    "data": {
                        "type": "object",
                        "properties": {
                            "id": {
                                "type": "string"
                            },
                            "actId": {
                                "type": "string"
                            },
                            "userId": {
                                "type": "string"
                            },
                            "startedAt": {
                                "type": "string",
                                "format": "date-time",
                                "example": "2025-01-08T00:00:00.000Z"
                            },
                            "finishedAt": {
                                "type": "string",
                                "format": "date-time",
                                "example": "2025-01-08T00:00:00.000Z"
                            },
                            "status": {
                                "type": "string",
                                "example": "READY"
                            },
                            "meta": {
                                "type": "object",
                                "properties": {
                                    "origin": {
                                        "type": "string",
                                        "example": "API"
                                    },
                                    "userAgent": {
                                        "type": "string"
                                    }
                                }
                            },
                            "stats": {
                                "type": "object",
                                "properties": {
                                    "inputBodyLen": {
                                        "type": "integer",
                                        "example": 2000
                                    },
                                    "rebootCount": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "restartCount": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "resurrectCount": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "computeUnits": {
                                        "type": "integer",
                                        "example": 0
                                    }
                                }
                            },
                            "options": {
                                "type": "object",
                                "properties": {
                                    "build": {
                                        "type": "string",
                                        "example": "latest"
                                    },
                                    "timeoutSecs": {
                                        "type": "integer",
                                        "example": 300
                                    },
                                    "memoryMbytes": {
                                        "type": "integer",
                                        "example": 1024
                                    },
                                    "diskMbytes": {
                                        "type": "integer",
                                        "example": 2048
                                    }
                                }
                            },
                            "buildId": {
                                "type": "string"
                            },
                            "defaultKeyValueStoreId": {
                                "type": "string"
                            },
                            "defaultDatasetId": {
                                "type": "string"
                            },
                            "defaultRequestQueueId": {
                                "type": "string"
                            },
                            "buildNumber": {
                                "type": "string",
                                "example": "1.0.0"
                            },
                            "containerUrl": {
                                "type": "string"
                            },
                            "usage": {
                                "type": "object",
                                "properties": {
                                    "ACTOR_COMPUTE_UNITS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATASET_READS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATASET_WRITES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "KEY_VALUE_STORE_READS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "KEY_VALUE_STORE_WRITES": {
                                        "type": "integer",
                                        "example": 1
                                    },
                                    "KEY_VALUE_STORE_LISTS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "REQUEST_QUEUE_READS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "REQUEST_QUEUE_WRITES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATA_TRANSFER_INTERNAL_GBYTES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATA_TRANSFER_EXTERNAL_GBYTES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "PROXY_RESIDENTIAL_TRANSFER_GBYTES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "PROXY_SERPS": {
                                        "type": "integer",
                                        "example": 0
                                    }
                                }
                            },
                            "usageTotalUsd": {
                                "type": "number",
                                "example": 0.00005
                            },
                            "usageUsd": {
                                "type": "object",
                                "properties": {
                                    "ACTOR_COMPUTE_UNITS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATASET_READS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATASET_WRITES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "KEY_VALUE_STORE_READS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "KEY_VALUE_STORE_WRITES": {
                                        "type": "number",
                                        "example": 0.00005
                                    },
                                    "KEY_VALUE_STORE_LISTS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "REQUEST_QUEUE_READS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "REQUEST_QUEUE_WRITES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATA_TRANSFER_INTERNAL_GBYTES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATA_TRANSFER_EXTERNAL_GBYTES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "PROXY_RESIDENTIAL_TRANSFER_GBYTES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "PROXY_SERPS": {
                                        "type": "integer",
                                        "example": 0
                                    }
                                }
                            }
                        }
                    }
                }
            }
        }
    }
}
```
