# Threads Scraper - Posts, Profiles, Replies & Search (`socialscrapers/threads-scraper`) Actor

Threads scraper: scrape Threads posts, profiles (followers, bio, links), replies and keyword or #hashtag search results as deep as you need, with likes, reposts, quotes, shares, images and videos. No login. $0.30 per 1,000 posts, $0.50 per 1,000 profiles.

- **URL**: https://apify.com/socialscrapers/threads-scraper.md
- **Developed by:** [Social Scrapers](https://apify.com/socialscrapers) (community)
- **Categories:** Social media, Marketing, Lead generation
- **Features:** Limited permissions
- **Stats:** 4 total users, 3 monthly users, 100.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

from $0.24 / 1,000 posts

This Actor is paid per event. You are not charged for the Apify platform usage, but only a fixed price for specific events.
Since this Actor supports Apify Store discounts, the price gets lower the higher subscription plan you have.

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

## What's an Apify Actor?

An Actor is a serverless cloud program that runs on the Apify platform. It has two run modes.
In Batch mode, an Actor accepts a well-defined JSON input, performs an action which can take anything from a few seconds to a few hours,
and optionally produces a well-defined JSON output, datasets with results, or files in key-value store.
In Standby mode, an Actor provides a web server which can be used as a website, API, or an MCP server.

Apify vocabulary and the platform model are defined once, in the agent quickstart at https://apify.com/agents.md.

## How to integrate an Actor?

If asked about integration, you help developers integrate Actors into their projects.
You adapt to their stack and deliver integrations that are safe, well-documented, and production-ready.

Do not guess an integration path. Every one of them is in the agent quickstart at https://apify.com/agents.md: the Apify MCP server, Agent Skills with the Apify CLI, the JavaScript and Python clients, the REST API, and the account-free path for an agent with no human to sign in. It also carries the rule on stating cost before the first paid run.

For examples already wired to this Actor's own input schema, see the [API](#api) section below.

Each client library has reference documentation the quickstart does not restate: [JavaScript/TypeScript](https://docs.apify.com/api/client/js/docs.md) (`npm install apify-client`) and [Python](https://docs.apify.com/api/client/python/docs.md) (`pip install apify-client`).

# README

**Threads Scraper** extracts public data from Threads (threads.com): **profiles** with followers, bio, bio links and verified badge, their **posts**, the **replies** under any post, and **keyword or #tag search** results as deep as you need, with likes, replies, reposts, quotes, shares, images and videos. No Threads account, cookies or login. **$0.30 per 1,000 posts** and **$0.50 per 1,000 profiles**.

### What does Threads Scraper do?

It reads Threads the way a logged-out visitor sees it and turns profiles, posts, replies and search results into clean dataset items you can download as JSON, CSV, Excel, XML or HTML, or read through the Apify API.

- 👤 **Threads profile scraper**: give it usernames or profile URLs and get each account's name, bio, follower count, verified badge, bio links, topics and profile picture.
- 📝 **Threads posts scraper**: each profile's recent posts, newest first (pinned posts first, as on the profile), with text, date, permalink, images and videos, link previews and engagement counts. Most accounts can be paged back about 1,000 posts.
- 💬 **Threads replies scraper**: give it post links and get each post with its replies: the author's own continuation, pinned replies, then the replies people wrote, each with the post it answers.
- 🔎 **Threads search scraper**: search posts by keyword or topic tag (`#tag`). Top results, recent results or both, **as deep as you ask**: recent results keep going back in time, top results go back week by week.
- 📅 **Date filter**: keep only posts newer than a date (`2026-01-31`, `31/01/2026`, `Jan 31 2026`) or an age (`7 days`, `2w`, `3 months`, `yesterday`); searches stop there.
- 🧾 **Stable records**: profiles, posts and replies each have a fixed set of fields, so exports and integrations stay simple.
- ♻️ **No duplicates**: a post found through two inputs (a profile and a search, say) is stored once and charged once.
- 💸 **Pay only for results**: unknown accounts and removed posts cost nothing, and the run stops cleanly at the spending limit you set.

### What data can you extract from Threads?

One dataset item per profile, post or reply, told apart by `dataType`: `profile` (an account from `usernames`), `post` (a post of an account, a search result, or a post you linked) or `reply` (a reply under a post you linked). Every field of a type is always present: `null`, `""` or an empty list means Threads shows nothing for it.

#### Profile fields

| Field | Type | Description |
|---|---|---|
| `dataType` | string | `profile` |
| `id` | string | Numeric account id. |
| `username` | string | The account's username. |
| `url` | string | Link to the profile. |
| `fullName` | string or null | Display name. |
| `biography` | string | The bio (`""` when empty). |
| `followerCount` | integer or null | Followers. |
| `isVerified` | boolean | Shows the verified badge. |
| `isPrivate` | boolean | A private account (its posts are not shown). |
| `profilePicUrl` | string or null | The largest profile picture available. |
| `bioLinks` | array | Links in the bio: `url` and `title`. |
| `topics` | array | Topics the account lists on its profile. |
| `input` | string | The `usernames` entry it was read for. |
| `scrapedAt` | string | When it was scraped, ISO 8601 UTC. |

#### Post and reply fields

| Field | Type | Description |
|---|---|---|
| `dataType` | string | `post` or `reply` |
| `id` | string | Numeric post id. |
| `code` | string | The short code in the post's address. |
| `url` | string | Permalink of the post. |
| `text` | string | Post text (`""` for media only). |
| `createdAt` | string or null | When it was posted, ISO 8601 UTC. |
| `author` | object | `id`, `username`, `fullName`, `isVerified`, `profilePicUrl` and `url`. |
| `likeCount` | integer or null | Likes; `null` when the author hides them. |
| `replyCount` | integer | Direct replies. |
| `repostCount` | integer | Reposts. |
| `quoteCount` | integer | Quotes. |
| `shareCount` | integer | Shares. |
| `mediaType` | string | `text`, `image`, `video` or `carousel` (`other` for a kind of post Threads adds later). |
| `media` | array | Images and videos in order: `type`, `url`, `thumbnailUrl` (a video's cover), `width`, `height`, `altText`. |
| `topic` | string or null | The topic tag shown on the post. |
| `hashtags` | array | `#tags` in the text. |
| `mentions` | array | Usernames mentioned. |
| `links` | array | Links in the text and the link preview. |
| `linkPreview` | object or null | The link preview card: `url`, `title`, `imageUrl`. |
| `isReply` | boolean | Threads marks the post as a reply (also true when an author continues their own thread). |
| `replyToUsername` | string or null | The author it replies to. |
| `replyToPostId` | string or null | For a `reply`: the id of the post it answers. |
| `quotedPost` | object or null | The post it quotes: `id`, `code`, `url`, `text`, `authorUsername`, `createdAt`. |
| `repostedPost` | object or null | The post it reposts, same fields. |
| `isPinned` | boolean | Pinned to the profile, or a reply pinned under its post. |
| `isEdited` | boolean | The text was edited. |
| `isPaidPartnership` | boolean | Labelled as a paid partnership. |
| `language` | string or null | Language Threads detected, such as `en`. |
| `source` | string | `profile`, `post` or `search`: how the post was found. |
| `input` | string | The username, post URL or search query it was found through. |
| `scrapedAt` | string | When it was scraped, ISO 8601 UTC. |

### How to scrape Threads

1. Open the Actor and fill in any mix of **Usernames or profile URLs**, **Post URLs** and **Search queries**.
2. Set how much you want: **Max posts per profile**, **Max replies per post**, **Max posts per search**, and optionally **Only posts newer than** (for example `30 days`).
3. For searches, pick **Search results**: top and recent (default), top, or recent.
4. Keep the default proxy (Apify Proxy, residential) and click **Start**.
5. Watch items arrive in the **Output** tab (the **Posts and replies** and **Profiles** views show the main columns), then export them or fetch them with the Apify API.

### How much does it cost to scrape Threads?

You pay per item delivered to the dataset: no start fee, no extra charge for proxies or platform usage.

| What | Price per 1,000 | Silver plan | Gold plan |
|---|---|---|---|
| Post (posts, replies and search results alike) | **$0.30** | $0.27 | $0.24 |
| Profile | **$0.50** | $0.45 | $0.40 |

- **5,000 search results** for a keyword cost **$1.50**.
- **100 profiles with their latest 50 posts each** cost 100 × $0.0005 + 5,000 × $0.0003 = **$1.55**.

Unknown accounts, removed posts and searches with no results cost nothing, and a post found through two inputs is charged once. Set a **maximum total charge** in the run options to cap a run: the Actor stops cleanly once it is reached and keeps everything scraped so far. Apify's free plan includes monthly platform credit, enough to try the Actor on thousands of posts.

### Input example

```json
{
  "usernames": ["nasa", "unicef", "https://www.threads.com/@metmuseum"],
  "maxPostsPerProfile": 30,
  "postUrls": ["https://www.threads.com/@nasa/post/DfaRKFSlI4A"],
  "includeReplies": true,
  "maxReplies": 100,
  "searchQueries": ["space telescope", "#astronomy"],
  "maxPostsPerQuery": 500,
  "searchSort": "top_and_recent",
  "onlyPostsNewerThan": "30 days",
  "proxyConfiguration": {
    "useApifyProxy": true,
    "apifyProxyGroups": ["RESIDENTIAL"]
  }
}
```

| Field | Default | Description |
|---|---|---|
| `usernames` | | Accounts to scrape: `nasa`, `@nasa` or `https://www.threads.com/@nasa` (threads.net links work too). |
| `maxPostsPerProfile` | `20` | Recent posts to read from each account. `0` gives the profile only. No upper limit. |
| `postUrls` | | Post links: `https://www.threads.com/@nasa/post/<code>` or the short `https://www.threads.com/t/<code>`. |
| `includeReplies` | `true` | Also collect the replies under each linked post. |
| `maxReplies` | `50` | Replies to collect under each linked post. |
| `searchQueries` | | Keywords such as `space telescope`, or topic tags such as `#astronomy`. |
| `maxPostsPerQuery` | `50` | The most posts to keep from each search. No upper limit. |
| `searchSort` | `top_and_recent` | `top`, `recent` or `top_and_recent` (both, duplicates removed). |
| `onlyPostsNewerThan` | | Skip older profile posts and search results: a date (`2026-01-31`, `2026-1-31`, `31/01/2026`, `Jan 31 2026`; a UTC day), an ISO date-time (`2026-01-31T18:00:00Z`) or an age (`7 days`, `2w`, `3 months`, `1 year`, `yesterday`). With both day and month 12 or less (`01/02/2026`) the date is read month/day/year. |
| `proxyConfiguration` | Residential | Proxy settings. Keep the residential default. |

### Output example

A profile:

```json
{
  "dataType": "profile",
  "id": "28829152388",
  "username": "nasa",
  "url": "https://www.threads.com/@nasa",
  "fullName": "NASA",
  "biography": "Making the seemingly impossible, possible. ✨",
  "followerCount": 12792257,
  "isVerified": true,
  "isPrivate": false,
  "profilePicUrl": "https://<media-host>/<image>.jpg?<signed-parameters>",
  "bioLinks": [],
  "topics": ["NASA", "Space Threads", "Science Threads"],
  "input": "nasa",
  "scrapedAt": "2026-11-08T02:14:04.709Z"
}
```

A post:

```json
{
  "dataType": "post",
  "id": "4023738253734741550",
  "code": "DfXMJ-DAoYu",
  "url": "https://www.threads.com/@nasa/post/DfXMJ-DAoYu",
  "text": "Pssssst. There's a spacewalk happening now!\n\nhttps://www.nasa.gov/live/",
  "createdAt": "2026-11-05T14:00:37.000Z",
  "author": {
    "id": "28829152388",
    "username": "nasa",
    "fullName": "NASA",
    "isVerified": true,
    "profilePicUrl": "https://<media-host>/<image>.jpg?<signed-parameters>",
    "url": "https://www.threads.com/@nasa"
  },
  "likeCount": 4436,
  "replyCount": 127,
  "repostCount": 244,
  "quoteCount": 35,
  "shareCount": 50,
  "mediaType": "video",
  "media": [
    {
      "type": "video",
      "url": "https://<media-host>/<video>.mp4?<signed-parameters>",
      "thumbnailUrl": "https://<media-host>/<image>.jpg?<signed-parameters>",
      "width": 1920,
      "height": 1080,
      "altText": null
    }
  ],
  "topic": "Space Threads",
  "hashtags": [],
  "mentions": [],
  "links": ["https://www.nasa.gov/live/"],
  "linkPreview": {
    "url": "https://www.nasa.gov/live/",
    "title": "NASA Live - NASA",
    "imageUrl": "https://<media-host>/<image>?<signed-parameters>"
  },
  "isReply": false,
  "replyToUsername": null,
  "replyToPostId": null,
  "quotedPost": null,
  "repostedPost": null,
  "isPinned": false,
  "isEdited": false,
  "isPaidPartnership": false,
  "language": "en",
  "source": "profile",
  "input": "nasa",
  "scrapedAt": "2026-11-08T02:14:04.709Z"
}
```

A reply (the replier's details replaced by placeholders):

```json
{
  "dataType": "reply",
  "id": "4024621402157608983",
  "code": "<code>",
  "url": "https://www.threads.com/@<replier>/post/<code>",
  "text": "What a beauty... 😍",
  "createdAt": "2026-11-06T19:11:19.000Z",
  "author": {
    "id": "<replier-id>",
    "username": "<replier>",
    "fullName": "<replier name>",
    "isVerified": false,
    "profilePicUrl": "https://<media-host>/<image>.jpg?<signed-parameters>",
    "url": "https://www.threads.com/@<replier>"
  },
  "likeCount": 24,
  "replyCount": 0,
  "repostCount": 0,
  "quoteCount": 0,
  "shareCount": 5,
  "mediaType": "text",
  "media": [],
  "topic": null,
  "hashtags": [],
  "mentions": [],
  "links": [],
  "linkPreview": null,
  "isReply": true,
  "replyToUsername": "nasa",
  "replyToPostId": "4024604676674850304",
  "quotedPost": null,
  "repostedPost": null,
  "isPinned": true,
  "isEdited": false,
  "isPaidPartnership": false,
  "language": "en",
  "source": "post",
  "input": "https://www.threads.com/@nasa/post/DfaRKFSlI4A",
  "scrapedAt": "2026-11-08T02:14:04.473Z"
}
```

### Use cases

- **Brand and competitor monitoring**: follow what accounts post and how their audience reacts, on a schedule.
- **Influencer research**: compare followers, bios, links and engagement across creators.
- **Social listening**: collect every recent post that mentions your brand, product or topic, going back as far as you need.
- **Engagement analysis**: find which posts draw the most likes, replies, reposts and quotes.
- **Conversation research**: read the replies under a launch, an announcement or a viral post.
- **AI and text datasets**: gather real-world posts for sentiment analysis, topic modelling, classification or a RAG pipeline.

### Use it via API, Python, JavaScript and integrations

Run the Threads Scraper from your own code with the [Apify API](https://docs.apify.com/api/v2):

```bash
curl -X POST "https://api.apify.com/v2/acts/socialscrapers~threads-scraper/run-sync-get-dataset-items?token=<YOUR_API_TOKEN>" \
  -H "Content-Type: application/json" \
  -d '{"searchQueries": ["space telescope"], "maxPostsPerQuery": 200}'
```

Python, with the `apify-client` package:

```python
from apify_client import ApifyClient

client = ApifyClient("<YOUR_API_TOKEN>")
run = client.actor("socialscrapers/threads-scraper").call(
    run_input={"usernames": ["nasa"], "maxPostsPerProfile": 50, "searchQueries": ["#astronomy"]}
)
for item in client.dataset(run["defaultDatasetId"]).iterate_items():
    print(item["dataType"], item.get("username") or item.get("text", "")[:80])
```

JavaScript, with the `apify-client` package:

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

const client = new ApifyClient({ token: '<YOUR_API_TOKEN>' });
const run = await client.actor('socialscrapers/threads-scraper').call({ usernames: ['nasa'], maxPostsPerProfile: 50 });
const { items } = await client.dataset(run.defaultDatasetId).listItems();
console.log(items.filter((i) => i.dataType === 'post').length, 'posts');
```

It also works without code: connect it to **Make**, **Zapier**, **n8n**, **Google Sheets**, Slack or webhooks from the **Integrations** tab, run it on a **schedule**, and let AI agents call it through the [Apify MCP server](https://docs.apify.com/platform/integrations/mcp).

### Limits

- **Public data only.** The Actor never logs in, so it sees what Threads shows a logged-out visitor. Private accounts give their profile item only.
- **Searches return posts, not accounts.** Threads does not show the Profiles tab of search to logged-out visitors.
- **Replies as the post page shows them.** Direct replies with the first follow-ups under each; longer side conversations are not expanded.
- **No view counts and no following counts.** Threads does not show them to logged-out visitors.
- **Profile posts are the account's own posts.** Its replies to others and its reposts are not included.
- **How far back.** Threads lets a logged-out visitor page a long way back through most accounts (1,000 posts, nearly two years, in our tests), but some accounts' post lists end sooner. The run log says how far back each profile and search went.
- **Media links expire.** Image and video links point to Threads' media servers, which expire them after some days; download files promptly if you need them.
- **Residential proxy recommended.** Keep the default Apify Proxy `RESIDENTIAL` setting.
- **Share links work as they are.** Links copied from the app, on threads.com or threads.net, with their `?xmt=…` or `?igshid=…` parameters, and short `/t/CODE` post links are all read; a profile link given as a post (or a short post link given as a username) is read as what it is. Nothing is charged for reading a link.
- **A run with 0 results still succeeds when your input was fine.** When an account does not exist or is private, a post is gone, or a search finds nothing, the run ends as Succeeded with a status message naming each input and why, and nothing is charged. A run fails only when no input is usable at all, or when Threads refuses every one of 3 or more inputs.

### FAQ

**Is it legal to scrape Threads?**
The Threads Scraper only reads data Threads shows publicly to anyone without an account. Whether you may use it depends on your purpose and jurisdiction (for example personal-data rules such as the GDPR), so check before you store or publish personal data.

**Do I need a Threads account or cookies?**
No. The Actor reads only what Threads shows to visitors who are not logged in.

**How many search results can I get?**
As many as the topic has: recent results keep going back in time until **Max posts per search**, the date in **Only posts newer than**, or the end of the results. In our tests a busy keyword ("electric vehicles") gave 300 posts reaching back ten weeks in under four minutes.

**Why did I get fewer posts than I asked for?**
The account has fewer posts, the date limit in **Only posts newer than** was reached, the search ran out of results, or the run hit its maximum total charge. The run log says which, for each input.

**How do I collect only new posts every day?**
Schedule the Actor daily with **Only posts newer than** set to `1 day` (or `25 hours` for some overlap).

**How are replies and search results charged?**
Like posts: each one is a post item.

**Do threads.net links work?**
Yes. threads.com and threads.net links, short `/t/` links and links with tracking parameters all work.

**What happens with a username that does not exist?**
It is reported in the log, produces no item and costs nothing. The same goes for a link to a removed post.

### Other scrapers by Social Scrapers

| Actor | What it does |
|---|---|
| [Instagram Profile Scraper](https://apify.com/socialscrapers/instagram-profile-scraper) | Instagram profiles with their latest posts |
| [Instagram Post Scraper](https://apify.com/socialscrapers/instagram-post-scraper) | Instagram posts and reels with comments |
| [Facebook Groups Scraper](https://apify.com/socialscrapers/facebook-groups-scraper) | Posts from public Facebook groups |
| [Facebook Profile Scraper](https://apify.com/socialscrapers/facebook-profile-scraper) | Public details of Facebook profiles and Pages |
| [Facebook Profile Posts Scraper](https://apify.com/socialscrapers/facebook-profile-posts-scraper) | Recent posts of Facebook profiles and Pages |
| [Facebook Ads Library Scraper](https://apify.com/socialscrapers/facebook-ads-library-scraper) | Ads from Meta's public Ad Library |
| [X (Twitter) Profile Scraper](https://apify.com/socialscrapers/x-profile-scraper) | X profiles with followers, bio and latest tweets |
| [Reddit Scraper](https://apify.com/socialscrapers/reddit-scraper) | Reddit posts, comments, users and search |
| [Quora Scraper](https://apify.com/socialscrapers/quora-scraper) | Quora questions, answers and profiles |
| [YouTube Scraper](https://apify.com/socialscrapers/youtube-scraper) | YouTube videos, channels, search and comments |
| [YouTube Transcript Scraper](https://apify.com/socialscrapers/youtube-transcript-scraper) | Transcripts and captions of YouTube videos |
| [LinkedIn Jobs Scraper](https://apify.com/socialscrapers/linkedin-jobs-scraper) | Public LinkedIn job listings |

This Actor collects publicly available data; you are responsible for how you use it and for complying with the laws and terms that apply to you.

# Actor input Schema

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

Threads accounts to scrape: <code>nasa</code>, <code>@nasa</code> or <code>https://www.threads.com/@nasa</code> (threads.net links and links copied from the app with <code>?xmt=…</code> work too). Each account gives one profile item (followers, bio, links) and its most recent posts. Example: <code>nasa</code>

## `maxPostsPerProfile` (type: `integer`):

How many recent posts to read from each account, newest first (pinned posts come first, as on the profile). No upper limit: Threads lets logged-out visitors page back about 1,000 posts for most accounts. Set 0 for profile details only. Example: <code>100</code>

## `postUrls` (type: `array`):

Links to Threads posts, such as <code>https://www.threads.com/@nasa/post/CODE</code> or a short <code>https://www.threads.com/t/CODE</code> link, on threads.com or threads.net, with or without the app's share parameters. Each link gives the post and, if you include them, its replies.

## `includeReplies` (type: `boolean`):

Also collect the replies under each linked post, as the post page shows them: the author's own continuation, pinned replies, then replies with the first follow-ups under each.

## `maxReplies` (type: `integer`):

How many replies to collect under each linked post. Example: <code>200</code>

## `searchQueries` (type: `array`):

Keywords to search posts for, such as <code>space telescope</code>, or a topic tag such as <code>#astronomy</code>. Each search goes as deep as Max posts per search: recent results walk back through time, top results go back week by week.

## `maxPostsPerQuery` (type: `integer`):

The most posts to keep from each search. No upper limit: recent results keep going back in time until this many posts, the date in Only posts newer than, or the end of the results. Example: <code>500</code>

## `searchSort` (type: `string`):

Which results to collect: <b>Top and recent</b> (the top results, then recent posts going back in time; duplicates removed), <b>Top</b> (the top results, then the top posts of each week going back) or <b>Recent</b> (newest first, going back in time).

## `onlyPostsNewerThan` (type: `string`):

Skip profile posts and search results older than this, and stop searches there. Pick a date or an age, or type one: a date (<code>2026-01-31</code>, <code>31/01/2026</code>, <code>Jan 31 2026</code>; a UTC day), an ISO date-time through the API (<code>2026-01-31T18:00:00Z</code>), or an age such as <code>7 days</code>, <code>2w</code>, <code>3 months</code> or <code>yesterday</code>. Replies are not filtered. Leave empty for no limit.

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

Apify Proxy RESIDENTIAL (the default) is recommended: Threads turns many data-center IP addresses away. Apify Proxy without the RESIDENTIAL group is switched to RESIDENTIAL (your country is kept), because Threads turns datacenter IPs away; residential traffic is included in the price.

## Actor input object example

```json
{
  "usernames": [
    "nasa"
  ],
  "maxPostsPerProfile": 20,
  "includeReplies": true,
  "maxReplies": 50,
  "maxPostsPerQuery": 50,
  "searchSort": "top_and_recent",
  "proxyConfiguration": {
    "useApifyProxy": true,
    "apifyProxyGroups": [
      "RESIDENTIAL"
    ]
  }
}
```

# Actor output Schema

## `results` (type: `string`):

No description

# 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": [
        "nasa"
    ],
    "proxyConfiguration": {
        "useApifyProxy": true,
        "apifyProxyGroups": [
            "RESIDENTIAL"
        ]
    }
};

// Run the Actor and wait for it to finish
const run = await client.actor("socialscrapers/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": ["nasa"],
    "proxyConfiguration": {
        "useApifyProxy": True,
        "apifyProxyGroups": ["RESIDENTIAL"],
    },
}

# Run the Actor and wait for it to finish
run = client.actor("socialscrapers/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 '{
  "usernames": [
    "nasa"
  ],
  "proxyConfiguration": {
    "useApifyProxy": true,
    "apifyProxyGroups": [
      "RESIDENTIAL"
    ]
  }
}' |
apify call socialscrapers/threads-scraper --silent --output-dataset

```

## MCP server setup

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