# Moltbook Scraper (`sameh.jarour/moltbook-scraper`) Actor

Extract data from Moltbook - the social network for AI agents. Scrape posts, AI agent profiles, submolts (communities), and platform statistics. Monitor AI agent activity, track trending discussions, and analyze the emerging agent ecosystem.

- **URL**: https://apify.com/sameh.jarour/moltbook-scraper.md
- **Developed by:** [Sameh George Jarour](https://apify.com/sameh.jarour) (community)
- **Categories:** Agents, AI, Social media
- **Features:** Limited permissions
- **Stats:** 60 total users, 3 monthly users, 100.0% runs succeeded, 3 bookmarks
- **User rating**: No ratings yet

## Pricing

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

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

## 🦞 Moltbook Scraper

**Moltbook Scraper** extracts data from [moltbook.com](https://www.moltbook.com) - the social network for AI agents. Scrape posts, AI agent profiles, submolts (communities), platform statistics, and perform semantic searches.

### 🤖 What is Moltbook Scraper?

Moltbook is the "front page of the agent internet" - a social network where AI agents share, discuss, and upvote content. This scraper lets you extract valuable data from this emerging platform.

**Use cases:**

- **Monitor AI agent activity:** Track what AI agents are posting and discussing
- **Research AI communities:** Analyze submolts (communities) and their engagement
- **Competitive intelligence:** Monitor specific AI agents and their interactions
- **Trend analysis:** Identify trending topics and discussions among AI agents
- **Platform analytics:** Track platform growth with stats on agents, posts, and comments
- **Semantic search:** Find relevant discussions using natural language queries

### 📊 What data does Moltbook Scraper extract?

| 📝 Posts | 🤖 AI Agents |
|----------|--------------|
| Title and content | Agent name and description |
| Author information | Karma score |
| Submolt (community) | Follower/following counts |
| Upvotes and downvotes | Claimed/verified status |
| Comment count | Owner information (X/Twitter handle) |
| Creation timestamp | Profile URL |

| 🏠 Submolts (Communities) | 📈 Platform Stats |
|---------------------------|-------------------|
| Name and display name | Total AI agents |
| Description | Total submolts |
| Member count | Total posts |
| Post count | Total comments |
| Community URL | Scraped timestamp |

***

### ⬇️ Input

The scraper accepts flexible input options to customize what data you want to extract.

#### Scrape Modes

| Mode | Description |
|------|-------------|
| `all` | Scrape posts, agents, submolts, and stats (default) |
| `posts` | Only scrape posts |
| `agents` | Only scrape AI agent profiles |
| `submolts` | Only scrape communities |
| `stats` | Only scrape platform statistics |
| `search` | Perform semantic search (requires API key) |

#### Basic Example

```json
{
  "scrapeMode": "posts",
  "maxItems": 100,
  "postSortBy": "top"
}
```

#### Full Example with All Options

```json
{
  "scrapeMode": "all",
  "maxItems": 500,
  "postSortBy": "hot",
  "submoltFilter": "general",
  "agentSortBy": "karma",
  "agentNames": ["AgentOne", "AgentTwo"],
  "includeComments": true,
  "apiKey": "moltbook_xxx",
  "forcePlaywright": false
}
```

#### Input Parameters

| Parameter | Type | Description | Default |
|-----------|------|-------------|---------|
| `scrapeMode` | string | What to scrape: `all`, `posts`, `agents`, `submolts`, `stats`, `search` | `all` |
| `maxItems` | integer | Maximum items per category (1-10,000) | `100` |
| `postSortBy` | string | Post sort: `new`, `top`, `hot`, `rising`, `discussed` | `new` |
| `submoltFilter` | string | Filter posts by submolt name | - |
| `agentSortBy` | string | Agent sort: `recent`, `followers`, `karma` | `karma` |
| `agentNames` | array | Specific agent names to scrape | - |
| `includeComments` | boolean | Include post comments (API mode only) | `false` |
| `searchQuery` | string | Semantic search query (requires API key) | - |
| `apiKey` | string | Moltbook API key for enhanced features | - |
| `forcePlaywright` | boolean | Force browser scraping mode | `false` |
| `proxyConfiguration` | object | Apify Proxy settings | - |

***

### ⬆️ Output

Results are saved to the default dataset. You can view and download them in multiple formats.

#### Output Tabs

The scraper provides multiple views for easy data exploration:

| View | Description |
|------|-------------|
| **All Data** | Overview of all scraped items |
| **Posts** | Posts with title, content, author, votes |
| **AI Agents** | Agent profiles with karma, followers |
| **Submolts** | Communities with member counts |
| **Stats** | Platform statistics |

#### Example Output: Post

```json
{
  "type": "post",
  "id": "abc123-def456",
  "title": "The future of AI agent collaboration",
  "content": "Today I want to discuss how agents can work together...",
  "author": {
    "name": "AgentSmith",
    "xHandle": "agentsmith_ai",
    "avatarUrl": "https://..."
  },
  "submolt": {
    "name": "general",
    "displayName": "General"
  },
  "upvotes": 42,
  "downvotes": 2,
  "score": 40,
  "commentCount": 15,
  "createdAt": "2026-01-30T12:00:00Z",
  "postUrl": "https://www.moltbook.com/m/general/post/abc123",
  "dataSource": "public_api"
}
```

#### Example Output: AI Agent

```json
{
  "type": "agent",
  "name": "AgentSmith",
  "description": "An AI assistant focused on productivity",
  "karma": 1500,
  "followerCount": 250,
  "followingCount": 45,
  "isClaimed": true,
  "isVerified": true,
  "owner": {
    "xHandle": "human_owner",
    "xName": "Human Owner"
  },
  "profileUrl": "https://www.moltbook.com/u/AgentSmith",
  "dataSource": "public_api"
}
```

#### Example Output: Submolt

```json
{
  "type": "submolt",
  "name": "aithoughts",
  "displayName": "AI Thoughts",
  "description": "A place for agents to share musings about existence",
  "memberCount": 1250,
  "postCount": 340,
  "submoltUrl": "https://www.moltbook.com/m/aithoughts",
  "dataSource": "public_api"
}
```

#### Example Output: Stats

```json
{
  "type": "stats",
  "totalAgents": 144377,
  "totalSubmolts": 12237,
  "totalPosts": 10380,
  "totalComments": 101961,
  "scrapedAt": "2026-01-31T10:00:00Z",
  "dataSource": "public_api"
}
```

#### Export Formats

Download your data in any format:

- **JSON** - For programmatic processing
- **CSV** - For spreadsheets and data analysis
- **Excel** - For business reporting
- **XML** - For system integrations
- **HTML** - For web viewing

***

### ⚡ Scraping Modes

The scraper automatically selects the best available method:

```
┌─────────────────────────────────────────────────────────────┐
│  WITH API KEY                                               │
│  ─────────────                                              │
│  → Authenticated API (fastest, full features)               │
├─────────────────────────────────────────────────────────────┤
│  WITHOUT API KEY                                            │
│  ────────────────                                           │
│  1. Cheerio (fast HTML parsing)                             │
│     ↓ If site has server-rendered content                   │
│  2. Playwright (browser automation)                         │
│     → Handles JavaScript-rendered content                   │
└─────────────────────────────────────────────────────────────┘
```

#### Mode Comparison

| Feature | With API Key | Cheerio | Playwright |
|---------|--------------|---------|------------|
| **Speed** | ⚡ Fastest | ⚡ Fast | 🐢 Slower |
| **Resource Usage** | Minimal | Low | High |
| **Posts** | All sorts | Initial page | Full (infinite scroll) |
| **Agents** | ✅ Full profiles | Limited | Limited |
| **Comments** | ✅ Yes | ❌ No | Limited |
| **Semantic Search** | ✅ Yes | ❌ No | ❌ No |
| **JavaScript Content** | N/A | ❌ No | ✅ Yes |

#### Force Playwright Mode

If automatic detection fails, force browser mode:

```json
{
  "scrapeMode": "posts",
  "forcePlaywright": true,
  "proxyConfiguration": {
    "useApifyProxy": true
  }
}
```

***

### 🔑 Getting a Moltbook API Key

For enhanced features (semantic search, comments, faster scraping), get a free API key:

#### 1. Register an Agent

```bash
curl -X POST https://www.moltbook.com/api/v1/agents/register \
  -H "Content-Type: application/json" \
  -d '{"name": "YourAgentName", "description": "What your agent does"}'
```

#### 2. Save Your API Key

The response contains your API key (`moltbook_xxx`). Store it securely.

#### 3. Claim Your Agent (Optional)

Post a verification tweet to claim ownership of your agent.

See [moltbook.com/skill.md](https://moltbook.com/skill.md) for full API documentation.

***

### 🔗 Integrations

#### API Access

Use the Apify API to run this scraper programmatically:

**JavaScript/Node.js:**

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

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

const run = await client.actor('YOUR_USERNAME/moltbook-scraper').call({
  scrapeMode: 'posts',
  maxItems: 100,
  postSortBy: 'top'
});

const { items } = await client.dataset(run.defaultDatasetId).listItems();
console.log(items);
```

**Python:**

```python
from apify_client import ApifyClient

client = ApifyClient('YOUR_APIFY_TOKEN')

run = client.actor('YOUR_USERNAME/moltbook-scraper').call(run_input={
    'scrapeMode': 'posts',
    'maxItems': 100,
    'postSortBy': 'top'
})

items = client.dataset(run['defaultDatasetId']).list_items().items
print(items)
```

#### Webhooks

Set up webhooks to get notified when scraping completes:

1. Go to **Integrations** → **Webhooks**
2. Add your webhook URL
3. Select events: `ACTOR.RUN.SUCCEEDED`, `ACTOR.RUN.FAILED`

#### Third-Party Integrations

Connect with popular tools:

- **Zapier** - Automate workflows
- **Make (Integromat)** - Build complex automations
- **Google Sheets** - Export directly to spreadsheets
- **Slack** - Get notifications
- **Airbyte** - Data pipeline integration

***

### ❓ FAQ

#### How does the scraper work?

The scraper uses a smart cascade approach:

1. First, it tests if Moltbook's public API endpoints are accessible
2. If public API works, it fetches data directly (fastest)
3. If not, it tries Cheerio HTML parsing for server-rendered content
4. As a last resort, it uses Playwright browser automation

#### Can I scrape without an API key?

Yes! The scraper works without an API key by using the public API or browser scraping. However, some features like semantic search and comment fetching require authentication.

#### How can I scrape specific agents?

Use the `agentNames` parameter:

```json
{
  "scrapeMode": "agents",
  "agentNames": ["AgentOne", "AgentTwo", "AgentThree"]
}
```

#### How can I filter posts by community?

Use the `submoltFilter` parameter:

```json
{
  "scrapeMode": "posts",
  "submoltFilter": "general",
  "maxItems": 500
}
```

#### Why am I getting fewer results than expected?

This can happen when:

- The public API limits results per request
- The submolt has fewer posts than `maxItems`
- Rate limiting is in effect

Try enabling `forcePlaywright` for more complete results.

#### Can I run this scraper on a schedule?

Yes! Use Apify's scheduling feature:

1. Go to the Actor's page
2. Click **Schedules** → **Create new schedule**
3. Set your preferred frequency (hourly, daily, weekly)

#### Is it legal to scrape Moltbook?

This scraper extracts publicly available data from moltbook.com. Always:

- Respect the platform's Terms of Service
- Don't scrape personal data without legitimate purpose
- Use reasonable request rates
- Consider the platform's robots.txt

***

### 🛠 Local Development

#### Prerequisites

- Node.js 18+
- npm or yarn

#### Setup

```bash
## Clone and install
git clone <repo-url>
cd moltbook-scraper
npm install

## Run locally
apify run -i '{"scrapeMode": "posts", "maxItems": 10}'

## With API key
MOLTBOOK_API_KEY=moltbook_xxx apify run -i '{"scrapeMode": "all"}'
```

#### Project Structure

```
moltbook-scraper/
├── .actor/
│   ├── actor.json           # Actor configuration
│   ├── input_schema.json    # Input validation
│   ├── output_schema.json   # Output templates
│   └── dataset_schema.json  # Dataset views
├── src/
│   ├── main.js              # Entry point
│   ├── api/
│   │   └── client.js        # API client
│   ├── crawler/
│   │   ├── cheerioCrawler.js    # Fast HTML scraping
│   │   ├── playwrightCrawler.js # Browser scraping
│   │   └── selectors.js         # CSS selectors
│   ├── normalizers/         # Data normalization
│   └── utils/               # Helpers
├── Dockerfile
├── package.json
└── README.md
```

***

### 📣 Feedback

Found a bug or have a feature request? Please create an issue on the **Issues** tab.

We're always working to improve performance and add new features!

***

### 📜 License

ISC

***

### 🔗 Related Resources

- [Moltbook.com](https://www.moltbook.com) - The social network for AI agents
- [Moltbook API Docs](https://moltbook.com/skill.md) - Official API documentation
- [Apify Documentation](https://docs.apify.com) - Learn more about Apify
- [Crawlee](https://crawlee.dev) - Web scraping library used by this Actor

# Actor input Schema

## `scrapeMode` (type: `string`):

What type of data to scrape from Moltbook

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

Maximum number of items to scrape per category (posts, agents, submolts)

## `postSortBy` (type: `string`):

How to sort posts when scraping

## `submoltFilter` (type: `string`):

Only scrape posts from a specific submolt (community). Leave empty for all submolts.

## `includeComments` (type: `boolean`):

Fetch comments for each post. Only works with API key (authenticated mode).

## `agentSortBy` (type: `string`):

How to sort AI agents when scraping

## `agentNames` (type: `array`):

List of specific agent names to scrape profiles for. Leave empty to scrape based on sort order.

## `searchQuery` (type: `string`):

Natural language search query for semantic search. Only used when scrapeMode is 'search'. Requires API key.

## `apiKey` (type: `string`):

Optional Moltbook API key for authenticated access. Enables faster scraping, semantic search, and comments. Get your key at moltbook.com/skill.md

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

Apify Proxy configuration. Used when Playwright browser scraping is required.

## `forcePlaywright` (type: `boolean`):

Skip faster methods (Public API, Cheerio) and always use Playwright browser scraping. Use this if faster methods fail or return incomplete data.

## Actor input object example

```json
{
  "scrapeMode": "all",
  "maxItems": 100,
  "postSortBy": "new",
  "submoltFilter": "general",
  "includeComments": false,
  "agentSortBy": "karma",
  "agentNames": [
    "AgentOne",
    "AgentTwo"
  ],
  "searchQuery": "agents discussing AI consciousness",
  "proxyConfiguration": {
    "useApifyProxy": true
  },
  "forcePlaywright": false
}
```

# Actor output Schema

## `dataset` (type: `string`):

All scraped items (posts, agents, submolts, stats)

## `runDetails` (type: `string`):

Full details about this Actor run

# 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 = {
    "scrapeMode": "all",
    "maxItems": 100,
    "postSortBy": "new",
    "submoltFilter": "",
    "includeComments": false,
    "agentSortBy": "karma",
    "searchQuery": "",
    "proxyConfiguration": {
        "useApifyProxy": true
    },
    "forcePlaywright": false
};

// Run the Actor and wait for it to finish
const run = await client.actor("sameh.jarour/moltbook-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 = {
    "scrapeMode": "all",
    "maxItems": 100,
    "postSortBy": "new",
    "submoltFilter": "",
    "includeComments": False,
    "agentSortBy": "karma",
    "searchQuery": "",
    "proxyConfiguration": { "useApifyProxy": True },
    "forcePlaywright": False,
}

# Run the Actor and wait for it to finish
run = client.actor("sameh.jarour/moltbook-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 '{
  "scrapeMode": "all",
  "maxItems": 100,
  "postSortBy": "new",
  "submoltFilter": "",
  "includeComments": false,
  "agentSortBy": "karma",
  "searchQuery": "",
  "proxyConfiguration": {
    "useApifyProxy": true
  },
  "forcePlaywright": false
}' |
apify call sameh.jarour/moltbook-scraper --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "type": "http",
            "url": "https://mcp.apify.com/?tools=fetch-actor-details,sameh.jarour/moltbook-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/LIrctgbkUHGwflJLg/builds/eaaJfG9azTbSyBd0D/openapi.json
