# Threads Scraper (`data_wiki/threads-scraper`) Actor

Collect public Threads posts, profiles, replies and keyword or hashtag search results: text, likes, reposts, followers and bio. No Threads or Instagram login needed. Great for social listening, brand monitoring, trend research and finding creators.

- **URL**: https://apify.com/data_wiki/threads-scraper.md
- **Developed by:** [Data WiKi](https://apify.com/data_wiki) (community)
- **Security:** Limited permissions
- **Stats:** 5 total users, 2 monthly users, 92.9% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

from $1.40 / 1,000 results

This Actor is paid per event and usage. You are charged both the fixed price for specific events and for Apify platform usage.
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 Threads Scraper?

Threads Scraper is an Apify Actor that collects public data from Meta's Threads without a login. Choose a mode, paste usernames, search terms or post links, and get profiles, posts and replies as rows with likes, reposts, quotes, media and hashtags. Rows reach your dataset while the run is still going.

- **Four modes in one form:** profile cards, a user's posts, keyword or hashtag search, and exact posts by link.
- **Replies as rows:** switch on one option and the replies under every collected post are stored too, in any mode.
- **Filters that cut cost:** keep posts by date window and minimum likes, and remove duplicates across all targets.
- **Bulk input:** one username, query or link per line, as many as you need.
- **Nothing to install:** use it in Apify Console, and export the dataset to JSON, CSV, Excel or XML.

Click **Try for free**, pick a mode, paste your targets and press **Start**.

### 📊 What data can you extract from Threads?

The dataset has two row types, set by the `type` field. A profile row describes an account. A post row describes one post, and a reply row is a post row with `isReply` set to true. Values Threads does not show stay `null`. The example values below are made up and only show the shape of the data.

| Field | Description | Example |
|---|---|---|
| `type` | Row type: `profile` or `post` | `post` |
| `username`, `fullName` | Handle and public display name | `example_user`, `Example User` |
| `isVerified` | Whether the account has a verified badge | `false` |
| `userId` | Numeric account identifier | `1000000001` |
| `url` | Public link to the profile or post | `https://www.threads.com/@example_user` |
| `scrapedAt` | When the row was collected (ISO 8601, UTC) | `2026-11-01T10:00:00.000Z` |
| `biography`, `bioLinks` | Profile rows: bio text and the links shown in it | `Coffee and code`, `["https://example.com"]` |
| `followerCount` | Profile rows: number of followers, which is your threads follower count | `1200` |
| `isPrivate` | Profile rows: true when posts are hidden from visitors | `false` |
| `profilePicUrl` | Profile rows: largest available profile picture | `https://example.com/pic.jpg` |
| `postId`, `code` | Numeric post identifier and the short code in its link | `1000000000000000001`, `Cx1AbCdEfGh` |
| `text` | Full post text | `Launch day at the studio` |
| `likeCount`, `replyCount`, `repostCount`, `quoteCount` | Engagement counters of the post | `42`, `7`, `3`, `1` |
| `mediaType`, `media` | `text`, `photo`, `video` or `carousel`, and the attachments with URL, size and audio flag | `photo` |
| `hashtags`, `topicTag` | Hashtags in the text plus the threads topic tag, the label Threads shows under the author | `["studio"]`, `null` |
| `mentions`, `urls` | Accounts tagged in the post and external links | `["example_friend"]`, `[]` |
| `isReply`, `isRepost`, `isQuote` | Whether the row is a reply, a repost or a quote | `false`, `false`, `false` |
| `repostedFrom`, `quotedPostUrl` | Original author of a repost and the link of a quoted post | `null`, `null` |
| `isPinned`, `replyControl` | Pinned-to-profile flag and who may reply | `false`, `everyone` |
| `timestamp`, `date` | Publication time as Unix seconds and as ISO 8601 | `1793000000`, `2026-10-26T07:33:20.000Z` |
| `searchQuery` | Search mode: the term that produced the post | `null` |
| `replyToPostId`, `replyToUsername` | Reply rows: the parent post and its author | `null`, `null` |

A profile row has 12 fields and a post row has 30; reply rows add `replyToPostId` and `replyToUsername`. The field names stay the same on every run, which is what you want from a threads data scraper.

### 💡 Use cases for Threads data

- **Social listening:** run search mode on a schedule for social listening on threads. Read `searchQuery`, `text`, `date` and `url` of every new post.
- **Brand watch:** search your brand name with `searchSort` set to `recent` to build a threads brand monitoring feed. Use `minLikes` to keep only posts that got attention.
- **Mention tracking:** search a product name to monitor threads mentions in post text. The `mentions` field shows which accounts people tag.
- **Creators and influencers:** compare `followerCount`, `isVerified` and `likeCount` for threads influencer research. To find threads creators on a topic, search a keyword and read the `username` of the best-performing posts.
- **Competitor analysis:** collect the posts of rival accounts in posts mode for threads competitor analysis, then compare engagement counters side by side.
- **Hashtags and trends:** query `#hashtags` with a date window for threads hashtag tracking. Repeat the run each week to follow the trend; that is threads trend tracking in practice.
- **Audience and replies:** switch on reply collection for threads reply analysis. The reply rows show what people answer under a post, which feeds threads audience research.
- **Sentiment and AI work:** pass the `text` field of posts and replies to your own model for threads sentiment analysis. The clean rows also work as a threads dataset for ai projects. The Actor collects the data and does not score it.

### 🛠️ How to scrape Threads posts

1. Create an Apify account and open **Threads Scraper** in the Apify Store.
2. Pick a **Scraping mode**: Profiles only, User posts, Search posts or Specific posts by URL.
3. Paste usernames, search keywords or post links, one per line.
4. Set **Max posts per user / query / URL**, and add a date window or a minimum like count if you need one.
5. Click **Start** and watch the log; each stored row is listed with its counters.
6. Open the **Output** tab, choose a view and download the data as JSON, CSV, Excel or XML.

Posts mode works as a threads user posts scraper for any public account. Profiles mode is a threads profile scraper that returns one card per account.

#### How to run a Threads search by keyword

Choose **Search posts** and add keywords such as `artificial intelligence` to **Search keywords or hashtags**. The mode acts as a threads search scraper for keywords and hashtags. Pick `Top` for relevance, `Recent` for the newest posts, or `Both` to merge the two lists without duplicates. A threads keyword search can return fewer posts than your limit.

#### How to scrape Threads profiles in bulk

Choose **Profiles only** and paste as many usernames or profile links as you like. Each account becomes one profile row with its public threads profile data. This suits a threads bulk profile lookup. Accepted forms are `example_user`, `@example_user` and `https://www.threads.com/@example_user`.

#### How to export Threads data to CSV

Open the Output tab after the run, choose a view such as Posts or Profiles, click Export and select CSV. The same menu offers JSON, Excel and XML, so no code is needed to export threads data to csv.

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

Pricing is pay per event. A profile card, a post and a reply each count as one result, and a row that your date, like or duplicate settings drop never reaches the dataset, so it costs nothing. Every run also pays one start event.

- **Result** (`main_result`): one event per row written to the dataset.
- **Actor start** (`apify-actor-start`): $0.00005 per run. The Actor is set to 1024 MB of memory, which is one start event.

Apify platform usage (compute) is billed on top of the events above.

| Plan tier | Price per 1,000 results (`main_result`) |
|---|---|
| Free | $2.00 (1,000 x $0.002) |
| Bronze | $1.80 (1,000 x $0.0018) |
| Silver | $1.60 (1,000 x $0.0016) |
| Gold and above | $1.40 (1,000 x $0.0014) |

Example: 5 usernames with 100 posts each, plus a profile row per user, is 505 rows. On the Free tier that is 505 x $0.002 = $1.01, and on Gold 505 x $0.0014 = $0.707, plus the start fee of $0.00005 and platform usage.

Set a maximum cost per run in the run options. If the run hits it, collection stops and everything stored so far stays in the dataset. Current rates are on the Pricing tab.

### ⬇️ Input

The only required field is **Scraping mode** (`mode`). Each mode reads only its own target list. Open the Input tab for every option.

> 💡 Keep **Max posts per user / query / URL** low for a first test run.

This example takes up to 20 posts of one user plus the profile card, with no reply collection:

```json
{
  "mode": "posts",
  "usernames": ["example_user"],
  "maxPosts": 20,
  "includeProfile": true,
  "includeReplyThread": false,
  "proxyConfiguration": { "useApifyProxy": false }
}
```

- `mode`: `profile`, `posts`, `search` or `postUrls`. The form default is `posts`.
- `usernames`: usernames, `@names` or profile links for the profile and posts modes.
- `searchQueries`: keywords for search mode; start a term with `#` to search a hashtag.
- `postUrls`: full post links, short codes or numeric post IDs for postUrls mode. This mode works as a threads post extractor for exact posts.
- `searchSort`: `top` (default), `recent` or `both`, used in search mode only.
- `maxPosts`: posts kept per username or query, from 1 to 200. The form default is 10. It does not apply to profile and postUrls modes, which return one row per target.
- `postedAfter`, `postedBefore`: a date such as `2026-10-01` or an RFC3339 timestamp. `postedAfter` is inclusive, `postedBefore` is exclusive. Together they select threads posts by date range.
- `minLikes`: skips posts with fewer likes, which gives a threads minimum likes filter. The default 0 keeps every post.
- `includeProfile`: posts mode only, adds one profile row per user. Default on.
- `includeReplies`: keeps the author's own replies and thread continuations. Default off.
- `includeReplyThread`: stores the replies under every collected post as separate rows. Default off; it needs extra requests, so runs take longer.
- `maxRepliesPerPost`: replies stored per post, from 1 to 200. The form default is 2.
- `dedupe`: stores each post or profile once across all targets. Default on.
- `proxyConfiguration`: off by default. If Threads blocks requests, the Actor retries and switches to a proxy by itself. You can also choose a proxy to start with.

In postUrls mode the Actor works as a threads post scraper for a fixed list of links, and it returns the post at each address. That gives you threads post url data without a search.

### ⬆️ Output

The scraped results are shown as a dataset in the **Storage** tab, and the Output tab groups them into five views: Overview, Posts, Profiles, Engagement and Media. The table view doesn't show **all the fields**. You can download any view as JSON, CSV, Excel or XML, and the API serves the same rows as threads json data. The Engagement view lists likes, replies, reposts and quotes, the threads engagement data of each post.

For the input above you get one profile row and then post rows (example values, not real data):

```json
{
  "type": "profile",
  "username": "example_user",
  "fullName": "Example User",
  "biography": "Coffee and code",
  "followerCount": 1200,
  "isVerified": false,
  "isPrivate": false,
  "profilePicUrl": "https://example.com/pic.jpg",
  "bioLinks": ["https://example.com"],
  "url": "https://www.threads.com/@example_user",
  "userId": "1000000001",
  "scrapedAt": "2026-11-01T10:00:00.000Z"
}
```

```json
{
  "type": "post",
  "postId": "1000000000000000001",
  "code": "Cx1AbCdEfGh",
  "username": "example_user",
  "fullName": "Example User",
  "isVerified": false,
  "userId": "1000000001",
  "text": "Launch day at the studio #studio @example_friend",
  "likeCount": 42,
  "replyCount": 7,
  "repostCount": 3,
  "quoteCount": 1,
  "mediaType": "photo",
  "media": [
    { "type": "photo", "url": "https://example.com/photo.jpg", "videoUrl": null, "width": 1080, "height": 1350, "hasAudio": null }
  ],
  "hashtags": ["studio"],
  "topicTag": null,
  "mentions": ["example_friend"],
  "urls": [],
  "isReply": false,
  "isRepost": false,
  "repostedFrom": null,
  "isQuote": false,
  "quotedPostUrl": null,
  "isPinned": false,
  "replyControl": "everyone",
  "timestamp": 1793000000,
  "date": "2026-10-26T07:33:20.000Z",
  "url": "https://www.threads.com/@example_user/post/Cx1AbCdEfGh",
  "searchQuery": null,
  "scrapedAt": "2026-11-01T10:00:00.000Z"
}
```

At the end of each run a JSON summary is saved under the key `SUMMARY` in the key-value store. It lists the rows stored, filtered and duplicate counts, failed targets with a short reason, request counts, the run time and the `stopReason`, which is `null` for a normal finish and `spend-limit` when your maximum cost per run was reached.

### ⚠️ Limitations and error handling

- Only public data is returned. Private profiles give a profile row with `isPrivate` set to true and no posts.
- `maxPosts` is capped at 200 per username or query, and `maxRepliesPerPost` at 200 per post.
- Search can return fewer posts than your limit, because Threads offers a limited set of results to a logged-out visitor. Use `searchSort` set to `both` to merge the Top and Recent lists.
- `maxPosts` has no effect in profile and postUrls modes.
- Counters such as `likeCount` are the values Threads shows at the time of the run.
- A target that cannot be read, for example a missing account or a post that is not public, is skipped. It is listed under `failedTargets` in the summary and shown in the log, and the other targets continue.
- If Threads keeps blocking requests, the run can end with few or no rows. Run again later or choose a proxy.
- The Actor reads at most 3 targets at the same time and pauses briefly between requests, so very long lists take time.

| Situation | What you see | What to do |
|---|---|---|
| Normal finish | `stopReason` is `null` | Nothing |
| Spend limit reached | `stopReason` is `spend-limit`, rows so far are kept | Raise the maximum cost per run and run again |
| No rows stored | Status message "No results" and `failedTargets` filled | Check usernames and links; private or missing accounts return nothing |
| Invalid mode or empty target list | The run fails with a short message | Fill the target field that matches your mode |

### 🔌 Integrating Threads Scraper with other apps

Besides the Console, a run can be started over HTTP: send your input JSON to `https://api.apify.com/v2/actors/data_wiki~threads-scraper/runs`, then read the rows from the run's dataset. The API tab of the Actor shows code snippets for JavaScript, Python and the command line.

- **Recurring runs:** an [Apify schedule](https://docs.apify.com/actors/running/schedules) can repeat a search query daily or weekly; add `postedAfter` so each run covers only newer posts.
- **Spreadsheets and automation tools:** the [Apify integrations](https://docs.apify.com/integrations) pass the dataset on to apps such as Google Sheets, Make or Zapier.
- **Webhooks:** call a web address of your own when a run ends, as described in [Apify webhooks](https://docs.apify.com/integrations/webhooks).
- **Code:** the [Apify API reference](https://docs.apify.com/api/v2) lists the calls for runs and datasets.
- **AI agents:** an agent connected to the [Apify MCP server](https://docs.apify.com/mcp) can look up this Actor and run it.

### 🔗 Other social media scrapers by data_wiki

These Actors come from the same account. Two of them also cover Threads, with a different focus. This Actor is an independent meta threads scraper and is not made or endorsed by Meta.

| Actor | What it extracts | When to use it |
|---|---|---|
| [Meta Threads Profile Scraper](https://apify.com/data_wiki/meta-threads-profile-scraper) | Threads profiles with a feed of posts, replies, reposts or media per profile | You start from profiles and want a feed per account; it has no keyword search and no post-link mode |
| [Threads Scraper - Posts, Profiles & Search](https://apify.com/data_wiki/threads-scraper-posts-profiles-search) | Six modes: user posts, reposts, replies, keyword search, find profiles by keyword and post by link, with 107 output fields | You need profile discovery by keyword, reposts or a wider field set |
| [Bluesky Scraper Enterprise Grade](https://apify.com/data_wiki/bluesky-scraper-enterprise-grade) | Public Bluesky posts, comments and profiles | Your audience is also on Bluesky |
| [Instagram comment extractor](https://apify.com/data_wiki/instagram-comment-scraper) | Public comments of Instagram posts and reels | You follow the same brand on Instagram, Meta's other app |
| [Find reels by hashtag](https://apify.com/data_wiki/instagram-hashtag-scraper) | Instagram reels found by hashtag or keyword | You run hashtag research on Instagram as well |
| [Spotify artist research data](https://apify.com/data_wiki/spotify-monthly-listener) | Public Spotify artist data: listeners, followers, rank, top tracks, tour dates | You follow an artist's public conversation on Threads and want their Spotify numbers |

For the source of the data see [Threads](https://www.threads.com).

### ⚖️ Is it legal to scrape Threads?

The Actor opens the same public pages any visitor can open and stores what they show. It does not log in, so private accounts stay out of reach. Posts and bios still name real people, which makes them personal data under rules such as GDPR and CCPA. Settle your lawful reason before you store or share them, follow Meta's terms for Threads, and ask a lawyer when in doubt. Further reading: [the legality of web scraping](https://blog.apify.com/is-web-scraping-legal/) and [ethical web scraping](https://blog.apify.com/what-is-ethical-web-scraping-and-how-do-you-do-it/).

### ❓ FAQ

#### Can I use Threads Scraper without a Threads login?

Yes. The Actor reads only what a logged-out visitor can see on Threads, so you need no Threads or Instagram account. That is why you can scrape threads without login for any public profile, post or search. Private accounts are not available.

#### How much does a run cost?

A run costs the $0.00005 start event plus one result per stored row, from $2.00 per 1,000 rows on the Free tier to $1.40 on Gold and above. Apify adds compute usage on top.

#### Is there a Threads API for this?

Threads Scraper is not an official Meta API. The Apify API starts runs and returns the dataset as JSON, so you can call it as a threads api scraper from your own code. See the Integrating section.

#### Which Threads Actor should I use?

It depends on your starting point. This Actor has four modes (profile, posts, search, postUrls) with replies available in every mode and date and like filters. The [profile-first Actor from the same account](https://apify.com/data_wiki/meta-threads-profile-scraper) takes profiles and returns a feed per profile, without search or post links. The [six-mode Actor in this account](https://apify.com/data_wiki/threads-scraper-posts-profiles-search) adds profile discovery by keyword, reposts and many more output fields. Compare their input forms and pick the one that matches your input.

#### How many posts can I get per username?

Up to 200 per username or search query. Set `maxPosts` to the number you need; the form default is 10. An account with fewer public posts returns fewer rows.

#### How do I scrape Threads replies?

Switch on **Collect replies under each post** and set **Max replies per post**. Reply rows carry `replyToPostId` and `replyToUsername`. The run then works as a threads replies scraper for the conversation under each post. Threads shows comments as replies, which makes this a threads comments scraper for any post you list.

#### Can I use Threads Scraper for hashtags?

Yes. Start a search term with `#`, for example `#machinelearning`, and set `searchSort` as you like. Plain keywords search the text of posts instead. A hashtag run is a normal search run with a hashtag query, so it also serves as a threads hashtag scraper.

#### Does it extract media files?

The `media` field holds the photo or video URLs with width, height and an audio flag, so you get threads media urls rather than downloaded files. The Actor reads the links only, so it is a threads media scraper and not a downloader.

#### What happens if Threads blocks the requests?

The Actor retries and switches to a proxy automatically, and the log says when it does. If a target still cannot be read, it is listed under `failedTargets` and the rows already stored are kept.

#### Can I use Threads Scraper through MCP?

Yes. An agent that is connected to `https://mcp.apify.com` can search for Threads Scraper, read its input form and run it with your usernames, queries or links.

### 💬 Your feedback

Found a bug or need another field? Open an issue on the Actor's Issues tab. Need a custom solution? Contact hello.datawiki@gmail.com.

# Changelog

This Actor's version history is a separate document: https://apify.com/data_wiki/threads-scraper/changelog.md

# Actor input Schema

## `mode` (type: `string`):

What to collect: profile cards only, a user's posts with engagement data, posts matching search keywords, or specific posts by URL.

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

Used in profile and posts modes. Add as many as you like, one per line. Accepts zuck, @zuck or https://www.threads.com/@zuck.

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

Used in search mode only. Plain keywords search post text, for example artificial intelligence. Start a term with # to search a hashtag, for example #machinelearning.

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

Used in postUrls mode only. Paste full post links such as https://www.threads.com/@zuck/post/DeZtp-TkQHh, one per line. Short codes and numeric post IDs are accepted too.

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

Search mode only. Top returns relevance-ranked posts, Recent returns the freshest posts first, Both collects the two lists and removes duplicates.

## `maxPosts` (type: `integer`):

Maximum number of posts stored for each username or search query (1 to 200).

## `postedAfter` (type: `string`):

Keep only posts published at or after this moment. Use YYYY-MM-DD or an RFC3339 timestamp, for example 2026-05-01 or 2026-05-01T00:00:00Z. Pagination stops once older posts are reached.

## `postedBefore` (type: `string`):

Keep only posts published before this moment (exclusive). Use YYYY-MM-DD or an RFC3339 timestamp, for example 2026-06-01 or 2026-06-01T00:00:00Z.

## `minLikes` (type: `integer`):

Skip posts with fewer likes than this number. 0 keeps every post.

## `includeProfile` (type: `boolean`):

Posts mode only. Also store one profile row per user with followers, bio, verified status and profile picture.

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

Keep posts that are replies or thread continuations written by the author. Off returns only original posts.

## `includeReplyThread` (type: `boolean`):

Also store the replies posted under every collected post as separate rows. Needs extra requests, so runs take longer.

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

Maximum number of replies stored for each post when Collect replies under each post is on (1 to 200).

## `dedupe` (type: `boolean`):

Store each post or profile only once, even when several usernames or search queries return the same item.

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

Requests go out without a proxy by default. If Threads blocks them, the Actor switches to an Apify datacenter proxy and then to a residential proxy on its own and keeps that setting for the rest of the run. Pick a proxy here to start with it right away.

## Actor input object example

```json
{
  "mode": "posts",
  "usernames": [
    "zuck"
  ],
  "searchSort": "top",
  "maxPosts": 10,
  "minLikes": 0,
  "includeProfile": true,
  "includeReplies": false,
  "includeReplyThread": false,
  "maxRepliesPerPost": 2,
  "dedupe": true,
  "proxyConfiguration": {
    "useApifyProxy": false
  }
}
```

# Actor output Schema

## `overview` (type: `string`):

Every profile, post and reply row with the most useful columns.

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

Post and reply rows with text, engagement, media and link data.

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

Profile rows with followers, bio, verified status and picture.

## `engagement` (type: `string`):

Likes, replies, reposts and quotes per post.

## `media` (type: `string`):

Photos, videos and carousels attached to posts.

## `summary` (type: `string`):

Counts of stored rows, failed targets, requests and proxy events as JSON.

# 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 = {
    "mode": "posts",
    "usernames": [
        "zuck"
    ],
    "maxPosts": 10,
    "proxyConfiguration": {
        "useApifyProxy": false
    }
};

// Run the Actor and wait for it to finish
const run = await client.actor("data_wiki/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 = {
    "mode": "posts",
    "usernames": ["zuck"],
    "maxPosts": 10,
    "proxyConfiguration": { "useApifyProxy": False },
}

# Run the Actor and wait for it to finish
run = client.actor("data_wiki/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 '{
  "mode": "posts",
  "usernames": [
    "zuck"
  ],
  "maxPosts": 10,
  "proxyConfiguration": {
    "useApifyProxy": false
  }
}' |
apify call data_wiki/threads-scraper --silent --output-dataset

```

## MCP server setup

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