# Threads Scraper: Profile Posts, Replies, Threads Posts Scraper (`agenttoolworks/threads-scraper`) Actor

Threads scraper at $1.50 per 1,000 posts, no start fee: the posts of public profiles, a post by URL with the replies under it, and keyword search, with text, date, likes, replies, reposts and media links. No login, no cookies. Profile rows with followers and bio are free, like failed sources.

- **URL**: https://apify.com/agenttoolworks/threads-scraper.md
- **Developed by:** [AgentToolWorks](https://apify.com/agenttoolworks) (community)
- **Categories:** Social media, Marketing, Automation
- **Features:** Limited permissions
- **Stats:** 14 total users, 6 monthly users, 96.2% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

from $1.20 / 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

### What is this Threads scraper?

This Actor is a **Threads scraper** for profiles, posts and keywords in one run: type handles, paste post URLs or type search terms, and get one row per post with its **text, date, author, likes, replies, reposts, quotes, mentions, links and media**. It reads the posts of any public profile, a single post with the **replies under it**, and the first results of a **keyword search**, plus a free row per profile with **followers and bio**. No Threads or Instagram account, no cookies, no login.

**In short**

- **What you get**: one row per post or reply, with the text, the posting date, the author and whether they are verified, like, reply, repost and quote counts, the handles and links in the text, every image and video with its size, the topic and the post's URL. One free row per profile with follower count, bio, links and avatar.
- **What it costs**: **$1.50 per 1,000 posts** on Apify's Free and Starter plans ($1.35 on Scale, $1.20 on Business), **no start fee**. Pay per post delivered. **Free**: profile rows, profiles and posts that do not exist, sources Threads refused (each row says why), and duplicates.
- **Why this one** (measured in this Actor's own cloud runs on 2026-11-10; Store figures read the same day):
  - **Price**: $1.50 per 1,000 posts and nothing per run, against $2.50 per 1,000 results plus $0.02 per run start on the Free plan for futurizerush/meta-threads-scraper, the most used Threads scraper on the Store (2,195 users in 30 days).
  - **Profiles, replies and search in one Actor, one price**: the same $1.50 per 1,000 whether the row is a profile's post, a reply under a post or a search result.
  - **The profile row is free**: followers, bio and links come with the posts, at no charge.
  - **No browser**: plain HTTP requests in 256 MB of memory. 430 posts of two profiles in 98 s, 301 rows under one post in 68 s, 105 posts for five searches in 37 s; no request refused in 70 (runs hh3DEngH0uabFN8r6, 8gYyRSEyRMJgFmk3k, JR19qCm2PSMihZ3LZ, 9KXhWJasgPNsMPEkk).
  - **A short result is never silent**: when Threads ends a list early or refuses a page, the run says `partial`, keeps what it read, and gives the reason per source.

Read the limits before you run it: about 200 posts per profile and about 20 posts per search query, because that is what Threads shows a visitor without an account. Not affiliated with Meta, Threads or Instagram.

### What data can you extract from Threads?

One row per post. Where Threads sends nothing, the field is `null` (or an empty list), never guessed.

| Post | Engagement | Author and context |
|---|---|---|
| Post ID, short code, URL | Likes (`likeCount`) | Author handle, ID, display name, verified or not |
| Text, and whether Threads marks it as edited | Replies (`replyCount`) | Whether the post is a reply, and to whom (`replyToUsername`) |
| Posting date (`createdAt`, UTC) | Reposts (`repostCount`) and quotes (`quoteCount`) | Whether it is pinned on the profile |
| Handles mentioned in the text (`mentions`) and links written in it (`textLinks`) | Threads' reshare counter (`reshareCount`), as sent | Topic tag (`topic`) and language, where Threads gives them |
| Media type (`text`, `image`, `video`, `carousel`), every image and video with its width and height (`media`), and the same links as a flat list (`mediaUrls`) | | The link card's URL (`linkUrl`) and the quoted post's URL (`quotedPostUrl`) |
| | | Where the row came from: the profile, post URL or query (`source`, `sourceType`) and its position in that list |

Profile rows (free, one per profile): handle, user ID, display name, biography, follower count, verified, private or not, the links of the bio and the avatar URL.

### What can you use Threads data for?

- **Social listening and brand monitoring**: the posts of the accounts you follow and the replies under the posts that matter, with engagement counts.
- **Competitor and creator research**: what a profile posts, how often, and what gets likes, replies and reposts.
- **Audience reactions**: every reply under an announcement, a launch or a news post, in one table.
- **Trend spotting**: what Threads shows for a keyword today, across a list of keywords.
- **Datasets for analysis and AI agents**: one predictable JSON row per post.

### How to scrape Threads

1. Click **Try for free** (or **Start**) on this page and sign in to Apify.
2. Type **Profiles** (`natgeo`, `@nasa` or a profile URL), paste **Post URLs**, or type **Search queries**. You can mix the three in one run.
3. Set **Posts per profile** (default 50) and, for post URLs, **Replies per post** (default 0: the post alone). You pay per post delivered, so start small to look at the data.
4. Click **Start**. When the run finishes, open the **Output** tab, pick the **Posts** or **Profiles** view, and export as JSON, CSV, Excel or XML, or read it through the API.

### Input

| Field | What it does |
|---|---|
| `profiles` | Handles (`natgeo`, `@natgeo`) or profile URLs (`https://www.threads.com/@natgeo`), one per line. Each gives one free profile row and the profile's own posts, newest first. A post URL typed here is read as a post, with a note. |
| `postUrls` | Post addresses (`https://www.threads.com/@nasa/post/DfXMJ-DAoYu`), one per line. Each gives the post and, when `maxRepliesPerPost` is above 0, the replies under it. |
| `searchQueries` | Keywords, one per line, up to 200 characters each. Each gives the posts Threads shows a logged-out visitor for that search: about 20, and no further page. |
| `maxPostsPerProfile` | Posts to read per profile, newest first (default 50, 1 to 10,000). Threads ends a profile's list at about 200 posts for a visitor without an account, whatever you ask for. |
| `maxRepliesPerPost` | Replies to read per post URL (default 0, up to 5,000), replies to replies included, in the order Threads lists them. |
| `maxItems` | Optional cap on posts for the whole run. Leave empty for no cap besides your spending limit. |

Up to 1,000 profiles, post URLs and searches per run, counted together. An input the Actor cannot read (a handle with a space, an address that is not a Threads post) stops the run before anything is charged, and the message says which line to fix.

Example: the newest 50 posts of one profile (the prefilled input).

```json
{
  "profiles": ["natgeo"]
}
```

Example: two profiles as deep as Threads lets a visitor go (the run whose row is shown below).

```json
{
  "profiles": ["nasa", "natgeo"],
  "maxPostsPerProfile": 1000
}
```

Example: one post and up to 100 replies under it.

```json
{
  "postUrls": ["https://www.threads.com/@nasa/post/DfXMJ-DAoYu"],
  "maxRepliesPerPost": 100
}
```

Example: five keyword searches in one run.

```json
{
  "searchQueries": ["coffee", "ai agents", "world cup", "bitcoin", "marathon training"]
}
```

### Output

The dataset holds one row per post, with ready-made views in Apify Console and in the API:

- **Posts**: author, text, date, likes, replies, reposts, quotes, media type, mentions, whether it is a reply and to whom, URL, and the source that found it.
- **Profiles**: handle, name, followers, verified, private, bio, links, URL.
- **All fields**: every field of every row.

**No duplicates**: a post found twice in a run (by a profile and by a search, for example) is stored and charged once.

A row from a cloud run of this Actor (`nasa` and `natgeo`, run hh3DEngH0uabFN8r6, 2026-11-10; the two media links and the link card's tracking parameter shortened here with `...`):

```json
{
  "rowType": "post",
  "status": "ok",
  "statusReason": null,
  "source": "nasa",
  "sourceType": "profile",
  "scrapedAt": "2026-11-10T14:49:38.761Z",
  "position": 7,
  "postId": "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",
  "authorUsername": "nasa",
  "authorId": "28829152388",
  "authorFullName": "NASA",
  "authorVerified": true,
  "likeCount": 4464,
  "replyCount": 127,
  "repostCount": 245,
  "quoteCount": 35,
  "reshareCount": 51,
  "isReply": false,
  "replyToUsername": null,
  "isPinned": false,
  "mediaType": "video",
  "mediaUrls": ["https://scontent-bos5-1.cdninstagram.com/o1/v/t16/f2/m84/AQOct9S8Ms_sQPPGaIdkFb6QITwPTABI2..."],
  "media": [
    { "type": "video", "url": "https://scontent-bos5-1.cdninstagram.com/o1/v/t16/f2/m84/AQOct9S8Ms_sQPPGaIdkFb6QITwPTABI2...", "width": 1920, "height": 1080 }
  ],
  "mentions": [],
  "textLinks": ["https://www.nasa.gov/live/"],
  "isEdited": false,
  "linkUrl": "https://l.threads.com/?u=https%3A%2F%2Fwww.nasa.gov%2Flive%2F&e=...",
  "topic": "Space Threads",
  "language": "en",
  "quotedPostUrl": null
}
```

The free profile row of the same run (avatar link shortened):

```json
{
  "rowType": "profile",
  "status": "ok",
  "statusReason": null,
  "source": "nasa",
  "sourceType": "profile",
  "scrapedAt": "2026-11-10T14:49:38.761Z",
  "url": "https://www.threads.com/@nasa",
  "username": "nasa",
  "userId": "28829152388",
  "fullName": "NASA",
  "biography": "Making the seemingly impossible, possible. ✨",
  "followerCount": 12794263,
  "verified": true,
  "isPrivate": false,
  "links": [],
  "avatarUrl": "https://scontent-bos5-1.cdninstagram.com/v/t51.82787-19/669747085_18089786557960389_922072622069351626_n.jpg?..."
}
```

Media and avatar links are Threads' own signed links and expire: download what you need soon after the run. The Actor returns the links and never fetches the files.

A reply has the same fields as a post, with `isReply` true and `replyToUsername` set. A source that gave nothing (a profile that does not exist, a deleted post, a page Threads refused) gives one free row with `status` `not_found` or `failed` and the reason in `statusReason`.

#### Run summary

The run's key-value store holds a `SUMMARY` record: the run's status (`succeeded`, `partial` with the reasons, or `failed`), the posts charged and the free rows, the duplicates not stored, the requests made, and one entry per source with its status (`ok`, `partial`, `not_found` or `failed`), the posts read, whether Threads ended the list (`endOfList`) and the reason the list stopped where it did.

### Limits worth knowing before you run it

- **About 200 posts per profile.** Without an account, Threads ends a profile's list after about 200 posts: 208 on the profile read to the end of its list (nasa, run hh3DEngH0uabFN8r6, 1,000 asked). You get the newest posts, not the profile's whole history. One profile, one day: the exact number may differ per profile.
- **About 20 posts per search query.** Threads shows a logged-out visitor one set of results and no further page: 18 to 24 posts per query across five queries (run JR19qCm2PSMihZ3LZ). The Actor does not pretend to go deeper. For depth, use profiles and post URLs.
- **No view counts.** Threads does not send a post's view count to a visitor without an account, so there is no such field.
- **What `partial` means.** A source is `partial` when its list stopped before its end and before what you asked for, because Threads answered an error on a next page, refused it, or did not answer it. The run is `partial` when at least one source is, when a source failed or was not found, or when the run stopped before reading every source (its time limit, your spending limit or `maxItems`). In run hh3DEngH0uabFN8r6, Threads answered a server error on the 11th page of natgeo: the 222 posts read until then were delivered and charged, the source was marked `partial` with Threads' answer as the reason, and so was the run. A profile that ends at Threads' ceiling of about 200 posts when you asked for more also makes the run `partial`, with that reason. Nothing is lost silently, and you only pay for the rows delivered.
- **Replies**: 301 rows were read under one post without reaching the end of its list (run 8gYyRSEyRMJgFmk3k). How far a very long reply list goes is not measured.
- **Private profiles** show no posts to a logged-out visitor.
- **Not in this version**: a profile's replies, reposts and media tabs, account search, tag search, and change monitoring between runs.
- **One source at a time**, with a pause between requests: 350 posts of 7 profiles (50 each) took 128 s (run 9KXhWJasgPNsMPEkk). Many small profiles take longer than one deep one.
- **A refusal is final for that source.** When Threads refuses a request, the run keeps what it read, says so in the row and the `SUMMARY`, and does not try to get around the refusal. It never logs in and never answers a challenge. Five failed sources in a row stop the run. A request that gets no answer at all (a timeout) is sent once more, then given up.
- **Measured over one day.** The figures on this page come from runs of 2026-11-10 on Apify's datacenter proxy. Threads can change what it shows a logged-out visitor at any time; when it does, the run says what it could not read.
- **The run stops itself before its timeout**: a minute before, it starts nothing new, stores what it read, and ends with `SUMMARY` saying what was not covered. Only the rows in the dataset are charged.
- **If Apify moves the run to another server**, the run carries on where it was: no post is stored or charged twice.

### How it compares (Apify Store, read 2026-11-10)

The Threads scrapers with the most users on the Store. Prices on the Free plan and 30-day figures as each Actor's public Store record showed them on 2026-11-10 (`https://api.apify.com/v2/acts/<user>~<name>`). "Success" is the share of runs that succeeded in 30 days. We did not run these Actors, and what each returns was not compared on the same input. Some of them advertise deeper keyword search than this Actor's 20 posts per query; we do not know how they reach it.

| | What it sells | Price on the Free plan, per 1,000 | Success, 30 days | Users, 30 days |
|---|---|---|---|---|
| futurizerush/meta-threads-scraper | results | $2.50, plus $0.02 per run start | 97.46% | 2,195 |
| apify/threads-profile-api-scraper | profiles | $5.00 | 99.70% | 709 |
| watcher.data/search-threads-by-keywords | search results | $8.00 | 99.10% | 592 |
| automation-lab/threads-scraper | posts | $5.00 (down to $1.20 on its top plan tier) | 99.05% | 478 |
| igview-owner/threads-search-scraper | search results | $20.00 ($5.00 on paid plans) | 97.10% | 454 |
| futurizerush/threads-replies-scraper | replies | $2.50 | 96.92% | 362 |
| **This Actor** | posts, replies and search results; profiles free | **$1.50**, no start fee | new | new |

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

Pay per event, no subscription, platform usage and proxies included. One event:

| Event | Price |
|---|---|
| Post (a delivered post or reply row) | **$1.50 per 1,000** ($0.0015 each) on Free and Starter; $1.35 on Scale; $1.20 on Business |
| Profile row | free |
| Profile or post not found, source failed, duplicate | free |
| Run start | free |

Apify plans and price tiers: Free, Starter (Bronze), Scale (Silver), Business (Gold), per [apify.com/pricing](https://apify.com/pricing).

Examples:

- **The prefilled run** (50 posts of one profile, plus its free profile row): $0.075.
- **The 200 newest posts of 10 profiles**: at most $3.00.
- **One post with 300 replies** (301 rows): about $0.45.
- **Five keyword searches** (105 posts in our run): about $0.16.
- **Apify's free plan** includes $5 of monthly usage ([apify.com/pricing](https://apify.com/pricing)), enough for about **3,300 posts** a month.

Set a maximum cost per run in the run options and the Actor stops cleanly when it is reached: it stores no post it could not charge.

### Use the Actor through the Apify API

Run it and get the rows in one HTTP call (replace `YOUR_APIFY_TOKEN`, from **Settings > API & Integrations** in Apify Console):

```bash
curl -X POST "https://api.apify.com/v2/acts/agenttoolworks~threads-scraper/run-sync-get-dataset-items?token=YOUR_APIFY_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{"profiles": ["nasa"], "maxPostsPerProfile": 20}'
```

Node.js, with the official [`apify-client`](https://docs.apify.com/api/client/js/):

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

const client = new ApifyClient({ token: process.env.APIFY_TOKEN });
const run = await client.actor('agenttoolworks/threads-scraper').call({
    profiles: ['nasa', 'natgeo'],
    maxPostsPerProfile: 100,
});
const { items } = await client.dataset(run.defaultDatasetId).listItems();
const posts = items.filter((r) => r.rowType === 'post' && r.status === 'ok');
console.log(posts.map((p) => [p.authorUsername, p.createdAt, p.likeCount, p.text]));
```

Python, with the official [`apify-client`](https://docs.apify.com/api/client/python/):

```python
from apify_client import ApifyClient

client = ApifyClient("YOUR_APIFY_TOKEN")
run = client.actor("agenttoolworks/threads-scraper").call(
    run_input={"postUrls": ["https://www.threads.com/@nasa/post/DfXMJ-DAoYu"], "maxRepliesPerPost": 100}
)
for row in client.dataset(run["defaultDatasetId"]).iterate_items():
    print(row["authorUsername"], row["likeCount"], row["text"])
```

The **API** tab on this page has ready-made snippets for every language and endpoint.

### FAQ

#### Do I need a Threads or Instagram account?

No. The Actor reads what Threads shows a visitor who is not logged in. It uses no account, no cookies from a signed-in session and no API key, and it never logs in.

#### How many posts can I get from one profile?

About 200, the newest ones: that is where Threads ends a profile's list for a visitor without an account (208 on the profile we read to the end). Ask for 1,000 and you get what Threads gives, with the reason in the run summary, and you pay only for the posts delivered.

#### Can I get the replies under a post?

Yes: paste the post's URL and set **Replies per post**. Replies to replies are included, in the order Threads lists them. In our run, 300 replies asked under one post gave 301 rows (the post and its replies) in 68 s.

#### Can I search Threads by keyword?

Yes, with a limit you should know: about 20 posts per query, the set Threads shows a logged-out visitor, with no further page. Several queries in one run each give their own set.

#### Does it return view counts?

No. Threads does not send view counts to a visitor without an account. Likes, replies, reposts and quotes are in every row.

#### Does it return followers and bio?

Yes, in a free row per profile: follower count, biography, links, verified and private flags.

#### Why did my run end `partial`?

Because a list stopped before what you asked for, and the run tells you rather than hiding it: Threads' ceiling of about 200 posts on a profile, an error Threads answered on a next page, or the run's time limit. The `SUMMARY` record gives the reason per source. Every row in the dataset is good, and only those rows are charged.

#### Does it download images and videos?

No. It returns their links, with width and height. The links are signed by Threads and expire, so fetch the files you need soon after the run.

#### Can I use it with Make, Zapier, n8n or Google Sheets?

Yes, through Apify's integrations: the dataset works with every Apify integration, and a webhook can fire when a run finishes. Save your input as a task and schedule it.

#### Can AI agents use it through MCP?

Yes. Apify's hosted MCP server exposes Store Actors to MCP clients such as Claude or Cursor: `https://mcp.apify.com?tools=agenttoolworks/threads-scraper`.

#### Is it legal to scrape Threads?

The Actor reads only public posts and profiles, the ones Threads serves to a visitor who is not logged in, without an account and without answering any challenge. Meta's terms and Threads' robots.txt prohibit automated collection without Meta's written permission, and how you use the data is your responsibility. **Posts, handles and bios are personal data when they belong to a person**: you are the controller of what you do with them. In the EU, the GDPR requires a lawful basis, informing the people concerned where it applies (Article 14), and respecting objections. This Actor is not affiliated with Meta, Threads or Instagram.

#### Something is missing or broken?

Open an issue in the **Issues** tab: we read every one.

If this Actor was useful to you, please leave a review on its **Reviews** tab.

### Other Actors by AgentToolWorks

- [Facebook Ad Library Scraper](https://apify.com/agenttoolworks/ad-library-scraper): ads from the Meta, Google and Microsoft ad libraries in one table.
- [Google Ads Transparency Scraper](https://apify.com/agenttoolworks/google-ads-transparency-scraper): every Google ad of a brand or website, with text, reach and targeting.
- [Google Trends Scraper](https://apify.com/agenttoolworks/google-trends-scraper): interest over time, by region and related queries for terms and comparisons, plus each country's Trending now list.
- [Google Maps Scraper](https://apify.com/agenttoolworks/google-maps-places-scraper): every place inside a city's real boundary, with phone, website, rating, review count, opening hours and emails.
- [LinkedIn Jobs Scraper and Indeed Scraper](https://apify.com/agenttoolworks/linkedin-indeed-jobs-scraper): public job listings of both boards in one row format.
- [Job Scraper for Greenhouse, Lever, Ashby & Workable (JobsRadar)](https://apify.com/agenttoolworks/jobsradar-multi-board-job-search): open roles from the public boards of seven applicant tracking systems, deduplicated into one list.
- [Shopify & WooCommerce Scraper and Price Tracker](https://apify.com/agenttoolworks/shopify-woocommerce-scraper): every product of any Shopify or WooCommerce store, with variants, barcodes and stock, plus price and stock change tracking.
- [AliExpress Scraper: Products, Prices and Shipping per Country](https://apify.com/agenttoolworks/aliexpress-scraper): AliExpress products by keyword, category or product URL, with every SKU's price and stock and the shipping cost to each country you list.

### Learn more

- [What this Threads scraper returns, with a real row, its limits and its price](https://agenttoolworks.com/scrapers/threads-scraper)

If this Actor saved you time, a short review on its Store page helps other buyers find it.

Built by [AgentToolWorks](https://agenttoolworks.com). Not affiliated with Meta, Threads or Instagram.

# Actor input Schema

## `profiles` (type: `array`):

Threads handles (natgeo or @natgeo) or profile URLs (https://www.threads.com/@natgeo), one per line. Each gives one free profile row (followers, bio, links) and the profile's own posts, newest first.

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

Addresses of single posts (https://www.threads.com/@natgeo/post/DAbCdEfGhIj), one per line. Each gives the post, and the replies under it when Replies per post is above 0.

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

Keywords, one per line. Threads shows a visitor who is not logged in about 20 posts per search and no further page, so each query returns that first set only.

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

How many of each profile's posts to read, newest first.

## `maxRepliesPerPost` (type: `integer`):

For each post URL, how many replies to read (replies to replies included, as Threads lists them). 0 reads the post alone.

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

Stop the whole run after this many posts. Leave empty for no cap besides your spending limit.

## Actor input object example

```json
{
  "profiles": [
    "natgeo",
    "https://www.threads.com/@nasa"
  ],
  "postUrls": [
    "https://www.threads.com/@natgeo/post/DAbCdEfGhIj"
  ],
  "searchQueries": [
    "coffee"
  ],
  "maxPostsPerProfile": 50,
  "maxRepliesPerPost": 0
}
```

# Actor output Schema

## `posts` (type: `string`):

No description

## `profiles` (type: `string`):

No description

## `all` (type: `string`):

No description

## `summary` (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 = {
    "profiles": [
        "natgeo"
    ]
};

// Run the Actor and wait for it to finish
const run = await client.actor("agenttoolworks/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 = { "profiles": ["natgeo"] }

# Run the Actor and wait for it to finish
run = client.actor("agenttoolworks/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 '{
  "profiles": [
    "natgeo"
  ]
}' |
apify call agenttoolworks/threads-scraper --silent --output-dataset

```

## MCP server setup

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