# Meta threads scraper (`curious_coder/threads-scraper`) Actor

Scrape threads or posts from meta or instagram's new social media website "threads.net"

- **URL**: https://apify.com/curious\_coder/threads-scraper.md
- **Developed by:** [Curious Coder](https://apify.com/curious_coder) (community)
- **Categories:** Social media
- **Stats:** 1,157 total users, 4 monthly users, 94.4% runs succeeded, 39 bookmarks
- **User rating**: 3.07 out of 5 stars

## Pricing

$30.00/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/actors/running/actors-in-store.md#rental-actors

## What's an Apify Actor?

Actors are web data automations that power AI and operations. They run on the Apify platform to scrape websites, process data, connect APIs, and automate workflows.
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.

- **AI agents and MCP clients** — the [Apify MCP server](https://docs.apify.com/integrations/mcp.md) at `https://mcp.apify.com` (remote, streamable HTTP, OAuth on first use).
- **Agentic workflows and local Actor development** — [Agent Skills](https://apify.com/.well-known/agent-skills/index.json) with the [Apify CLI](https://docs.apify.com/cli/docs.md): `npm install -g apify-cli`, then `apify login`.
- **JavaScript/TypeScript projects** — the official [JS/TS client](https://docs.apify.com/api/client/js/docs.md): `npm install apify-client`.
- **Python projects** — the official [Python client](https://docs.apify.com/api/client/python/docs.md): `pip install apify-client`.
- **Any other language** — 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

### Threads scraper

This scraper helps you to scrape posts by a threads user

Here is the sample output of this actor:

```json
{
	"id": "3141737961795561608_314216",
	"reply_count": "27068",
	"user": {
		"profile_pic_url": "https://scontent.cdninstagram.com/v/t51.2885-19/357376107_1330597350674698_8884059223384672080_n.jpg?stp=dst-jpg_s150x150&_nc_ht=scontent.cdninstagram.com&_nc_cat=1&_nc_ohc=euIj8dtTGIkAX-vea85&edm=APs17CUBAAAA&ccb=7-5&oh=00_AfCOXYuDeJ_OxBW9ZYSdlTfCIXdP9NBqDoMVS5rk39mEHA&oe=64ACDDC0&_nc_sid=10d13b",
		"username": "zuck",
		"id": null,
		"is_verified": true,
		"pk": "314216"
	},
	"image_versions2": {
		"candidates": []
	},
	"original_width": 612,
	"original_height": 612,
	"video_versions": [],
	"carousel_media": null,
	"carousel_media_count": null,
	"pk": "3141737961795561608",
	"has_audio": null,
	"text_post_app_info": {
		"link_preview_attachment": null,
		"share_info": {
			"quoted_post": null,
			"reposted_post": null
		},
		"reply_to_author": null,
		"is_post_unavailable": false
	},
	"caption": {
		"text": "70 million sign ups on Threads as of this morning. Way beyond our expectations."
	},
	"taken_at": 1688744372,
	"like_count": 146411,
	"code": "CuZsgfWLyiI",
	"media_overlay_info": null
}

```

### Documentation for JSON Data

The given JSON data represents an threads post with various associated attributes. Below is a breakdown of the individual components and their descriptions:

### Main Object

- **id**: The unique identifier for the post.
  - *Type*: String
  - *Example*: "3141737961795561608\_314216"

- **reply\_count**: The total number of replies for this post.
  - *Type*: String
  - *Example*: "27068"

- **user**: The user who created the post. This contains several sub-fields:
  - **profile\_pic\_url**: The URL of the user's profile picture.
    - *Example*: A direct link to the image.
  - **username**: The username of the user.
    - *Example*: "zuck"
  - **id**: The unique identifier for the user. (Can be null)
  - **is\_verified**: A boolean value indicating if the user is verified.
  - **pk**: A unique key representing the user.
    - *Type*: String
    - *Example*: "314216"

- **image\_versions2**: An object that lists image versions available for the post.
  - **candidates**: An array containing different image versions.

- **original\_width**: The original width of the image or video.
  - *Type*: Integer
  - *Example*: 612

- **original\_height**: The original height of the image or video.
  - *Type*: Integer
  - *Example*: 612

- **video\_versions**: An array containing different versions of the video (if the post is a video).

- **carousel\_media**: Represents carousel media if the post contains multiple images or videos.

- **carousel\_media\_count**: The total number of media items in a carousel post.

- **pk**: Another unique key for the post.
  - *Type*: String
  - *Example*: "3141737961795561608"

- **has\_audio**: A boolean value indicating if the post (video) has audio.

- **text\_post\_app\_info**: Contains information related to the text of the post.
  - **link\_preview\_attachment**: Any link preview attached to the post.
  - **share\_info**: Information related to post sharing.
    - **quoted\_post**: If the post quotes another post.
    - **reposted\_post**: If the post is a repost from another user.
  - **reply\_to\_author**: Represents a reply to the post author.
  - **is\_post\_unavailable**: A boolean indicating if the post is unavailable.

- **caption**: Contains the caption of the post.
  - **text**: The text content of the caption.
    - *Example*: "70 million sign ups on Threads as of this morning. Way beyond our expectations."

- **taken\_at**: A timestamp indicating when the post was created (in Unix time format and can be converted to a human-readable date and time format.)
  - *Type*: Integer
  - *Example*: 1688744372

- **like\_count**: The total number of likes for the post.
  - *Type*: Integer
  - *Example*: 146411

- **code**: A unique code associated with the post.
  - *Type*: String
  - *Example*: "CuZsgfWLyiI"

- **media\_overlay\_info**: Contains information related to any media overlays on the post.

# Actor input Schema

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

No description

## `postsPerSource` (type: `integer`):

Limit the number posts scraped per given source (URL or @Username)

## Actor input object example

```json
{
  "urls": [
    "@zuck"
  ],
  "postsPerSource": 25
}
```

# 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 = {
    "urls": [
        "@zuck"
    ],
    "postsPerSource": 25
};

// Run the Actor and wait for it to finish
const run = await client.actor("curious_coder/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 = {
    "urls": ["@zuck"],
    "postsPerSource": 25,
}

# Run the Actor and wait for it to finish
run = client.actor("curious_coder/threads-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 '{
  "urls": [
    "@zuck"
  ],
  "postsPerSource": 25
}' |
apify call curious_coder/threads-scraper --silent --output-dataset

```

## MCP server setup

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