# Meta Threads Scraper (`kawsar/meta-threads-scraper`) Actor

Meta Threads scraper that extracts posts, profiles, and replies from threads.net using direct network requests, so you get structured JSON data for social listening, competitor research, and content analysis without browser automation.

- **URL**: https://apify.com/kawsar/meta-threads-scraper.md
- **Developed by:** [Kawsar](https://apify.com/kawsar) (community)
- **Categories:** Developer tools, Lead generation, Social media
- **Stats:** 2 total users, 0 monthly users, 100.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

$19.99/month + usage

To use this Actor, you pay a monthly rental fee to the developer. The rent is subtracted from your prepaid usage every month after the free trial period.You also pay for the Apify platform usage, which gets cheaper the higher Apify subscription plan you have.

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

## 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

## Meta Threads Scraper

I built this Apify actor to pull public data straight from Meta's Threads. It uses a headless browser (Playwright) to gracefully handle Meta's API protections, extracting the raw data they embed directly into the page. You just give it a username or a post URL, and it hands back clean, structured JSON you can actually use.

It handles three main things:
- **Posts**: grabbing a user's timeline
- **Profiles**: getting account details like follower counts and bios
- **Replies**: pulling comments on a specific post

### Input

| Parameter | Type | Default | Description |
|-----------|------|---------|-------------|
| `usernames` | array | - | Threads usernames to scrape (leave out the @ symbol). |
| `urls` | array | - | Exact Profile or post URLs from threads.net. |
| `scrapeType` | string | `"posts"` | What you want to collect: `posts`, `profile`, or `replies`. |
| `maxItems` | integer | `100` | Maximum items to grab per username or URL. |
| `timeoutSecs` | integer | `300` | When the actor should give up (in seconds). |
| `requestTimeoutSecs` | integer | `30` | How long to wait for a single page load. |
| `proxyConfiguration` | object | Datacenter | Proxy settings to avoid getting blocked. |

#### Example input

```json
{
    "usernames": ["zuck", "instagram"],
    "scrapeType": "posts",
    "maxItems": 50,
    "proxyConfiguration": { "useApifyProxy": true }
}
````

If you prefer URLs, just pass them directly:

```json
{
    "urls": ["https://www.threads.net/@zuck"],
    "scrapeType": "profile"
}
```

### Output

The actor stores everything in a dataset. A typical post looks like this:

```json
{
    "postId": "3141737961795561608",
    "postUrl": "https://www.threads.net/t/CuZsgfWLyiI",
    "postText": "70 million sign ups on Threads as of this morning. Way beyond our expectations.",
    "username": "zuck",
    "userId": "314216",
    "userVerified": true,
    "userProfilePic": "https://scontent.cdninstagram.com/...",
    "likeCount": 146411,
    "replyCount": 27068,
    "repostCount": 0,
    "publishedAt": "2023-07-07T13:39:32+00:00",
    "imageUrls": [],
    "videoUrls": [],
    "hasAudio": null,
    "postCode": "CuZsgfWLyiI",
    "mediaWidth": 612,
    "mediaHeight": 612,
    "isRepost": false,
    "isQuote": false,
    "scrapedAt": "2025-03-14T17:30:00+00:00"
}
```

When you scrape in `profile` mode, you'll get account-level fields instead, like `displayName`, `bio`, `followerCount`, and `isPrivate`.

### How it works under the hood

Threads changes its layout and API protections pretty often. Right now, the actor works by loading the public page using Playwright and extracting the React/Relay server-side rendered (SSR) JSON directly from the page scripts. This means we don't have to fight their dynamic API tokens, and we still get the exact data the native web app uses.

### A few tips

- Start small. Use a low `maxItems` value (like 10-20) to make sure everything works before running massive scrapes.
- If you start seeing blocks or timeouts, switch to Residential proxies. Meta can be pretty aggressive with rate-limiting datacenter IPs.
- The `profile` scrape type is the fastest option since it only needs to load one page per user.

### Support & Contact

For fast support, custom requests, bug reports, or just to say hi, feel free to reach out directly:

- **LinkedIn**: [kawsarlog](https://www.linkedin.com/in/kawsarlog/)
- **Telegram**: [@kawsarlog](https://t.me/kawsarlog)

I'm regularly building new scrapers and automation tools, so connect with me if you want to see what I'm working on next.

# Actor input Schema

## `usernames` (type: `array`):

List of Threads usernames to scrape (without the @ symbol). Example: zuck, instagram

## `urls` (type: `array`):

Direct profile or post URLs from threads.net. Example: https://www.threads.net/@zuck

## `scrapeType` (type: `string`):

Choose what data to collect: posts (user's threads), profile (user info only), or replies (replies to a specific post).

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

Maximum number of items (posts or replies) to collect per username or URL. Set lower to save compute credits.

## `timeoutSecs` (type: `integer`):

Overall actor timeout in seconds. The actor will stop after this time, even if not all data has been collected.

## `requestTimeoutSecs` (type: `integer`):

Timeout for each individual HTTP request in seconds.

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

Select proxies to use for requests. Helps avoid IP blocking and rate limits. Datacenter proxies are fastest; Residential proxies are harder to detect.

## Actor input object example

```json
{
  "usernames": [
    "zuck",
    "instagram"
  ],
  "urls": [
    "https://www.threads.net/@zuck",
    "https://www.threads.net/t/CuZsgfWLyiI"
  ],
  "scrapeType": "posts",
  "maxItems": 100,
  "timeoutSecs": 300,
  "requestTimeoutSecs": 30,
  "proxyConfiguration": {
    "useApifyProxy": true
  }
}
```

# 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 = {
    "usernames": [
        "zuck"
    ],
    "urls": [
        "https://www.threads.net/@zuck"
    ],
    "maxItems": 100,
    "proxyConfiguration": {
        "useApifyProxy": true
    }
};

// Run the Actor and wait for it to finish
const run = await client.actor("kawsar/meta-threads-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 = {
    "usernames": ["zuck"],
    "urls": ["https://www.threads.net/@zuck"],
    "maxItems": 100,
    "proxyConfiguration": { "useApifyProxy": True },
}

# Run the Actor and wait for it to finish
run = client.actor("kawsar/meta-threads-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 '{
  "usernames": [
    "zuck"
  ],
  "urls": [
    "https://www.threads.net/@zuck"
  ],
  "maxItems": 100,
  "proxyConfiguration": {
    "useApifyProxy": true
  }
}' |
apify call kawsar/meta-threads-scraper --silent --output-dataset

```

## MCP server setup

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

```

## OpenAPI specification

```json
{
    "openapi": "3.0.1",
    "info": {
        "title": "Meta Threads Scraper",
        "description": "Meta Threads scraper that extracts posts, profiles, and replies from threads.net using direct network requests, so you get structured JSON data for social listening, competitor research, and content analysis without browser automation.",
        "version": "0.0",
        "x-build-id": "NR84Fez9NMoomavZM"
    },
    "servers": [
        {
            "url": "https://api.apify.com/v2"
        }
    ],
    "paths": {
        "/acts/kawsar~meta-threads-scraper/run-sync-get-dataset-items": {
            "post": {
                "operationId": "run-sync-get-dataset-items-kawsar-meta-threads-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/kawsar~meta-threads-scraper/runs": {
            "post": {
                "operationId": "runs-sync-kawsar-meta-threads-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/kawsar~meta-threads-scraper/run-sync": {
            "post": {
                "operationId": "run-sync-kawsar-meta-threads-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",
                "properties": {
                    "usernames": {
                        "title": "Usernames",
                        "type": "array",
                        "description": "List of Threads usernames to scrape (without the @ symbol). Example: zuck, instagram",
                        "items": {
                            "type": "string"
                        }
                    },
                    "urls": {
                        "title": "URLs",
                        "type": "array",
                        "description": "Direct profile or post URLs from threads.net. Example: https://www.threads.net/@zuck",
                        "items": {
                            "type": "string"
                        }
                    },
                    "scrapeType": {
                        "title": "Scrape type",
                        "enum": [
                            "posts",
                            "profile",
                            "replies"
                        ],
                        "type": "string",
                        "description": "Choose what data to collect: posts (user's threads), profile (user info only), or replies (replies to a specific post).",
                        "default": "posts"
                    },
                    "maxItems": {
                        "title": "Max items",
                        "minimum": 1,
                        "maximum": 1000,
                        "type": "integer",
                        "description": "Maximum number of items (posts or replies) to collect per username or URL. Set lower to save compute credits.",
                        "default": 100
                    },
                    "timeoutSecs": {
                        "title": "Timeout (seconds)",
                        "minimum": 30,
                        "maximum": 3600,
                        "type": "integer",
                        "description": "Overall actor timeout in seconds. The actor will stop after this time, even if not all data has been collected.",
                        "default": 300
                    },
                    "requestTimeoutSecs": {
                        "title": "Request timeout (seconds)",
                        "minimum": 5,
                        "maximum": 120,
                        "type": "integer",
                        "description": "Timeout for each individual HTTP request in seconds.",
                        "default": 30
                    },
                    "proxyConfiguration": {
                        "title": "Proxy configuration",
                        "type": "object",
                        "description": "Select proxies to use for requests. Helps avoid IP blocking and rate limits. Datacenter proxies are fastest; Residential proxies are harder to detect."
                    }
                }
            },
            "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
                                    }
                                }
                            }
                        }
                    }
                }
            }
        }
    }
}
```
