# X (Twitter) Conversation & Replies Scraper (`nexascout/nexascout-x-conversation-replies`) Actor

Fetch an X post and its public replies with the official X API. Export normalized thread data, authors, timestamps, engagement metrics, parent links, and conversation IDs. Bring your own X API Bearer Token.

- **URL**: https://apify.com/nexascout/nexascout-x-conversation-replies.md
- **Developed by:** [NexaScout](https://apify.com/nexascout) (community)
- **Categories:** Social media, Developer tools, Automation
- **Stats:** 1 total users, 0 monthly users, 0.0% runs succeeded, 1 bookmarks
- **User rating**: No ratings yet

## Pricing

from $2.00 / 1,000 x post or replies

This Actor is paid per event. You are not charged for the Apify platform usage, but only a fixed price for specific events.

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

## X (Twitter) Conversation & Replies Scraper

Fetch a public X post and its reply conversation through the official X API v2. Export normalized thread data for customer research, sentiment workflows, community analysis, support monitoring, and downstream agents.

### What this Actor does

- Accepts X post URLs or numeric post IDs.
- Fetches the root post.
- Searches public replies belonging to the same conversation.
- Preserves reply-parent IDs and conversation IDs when the API exposes them.
- Supports configurable reply caps, thread-depth handling, quote inclusion, and minimum engagement.
- Normalizes authors, timestamps, engagement metrics, and thread relationships.
- Uses your own X Developer Bearer Token.

### Bring your own X API token

Live X access uses a **BYOT (bring your own token)** model.

Enter your X Developer **Bearer Token** in the `bearerToken` field. Apify encrypts this secret input before storing the run input.

Important:

- X API usage is billed by X to the developer account that issued the token.
- Store users never use a NexaScout X credential.
- The Actor does not fall back to an owner-level X token.
- Live requests are locked to the official X API host.
- The token is not written to output.

### Quick start

Replace the example post URL with the conversation you want to analyze:

```json
{
  "posts": [
    "https://x.com/USERNAME/status/POST_ID"
  ],
  "bearerToken": "YOUR_X_BEARER_TOKEN",
  "searchMode": "recent",
  "maxRepliesPerPost": 25,
  "maxDepth": 3,
  "includeRoot": true,
  "includeQuotes": false
}
```

### Main inputs

#### `posts`

One or more X post URLs or numeric post IDs.

#### `bearerToken`

Your X Developer Bearer Token. Required for live X collection.

#### `searchMode`

- `recent` — uses X recent search for reply discovery.
- `all` — requests full-archive search. Your X developer project must have access to that endpoint.

#### Thread controls

- `maxRepliesPerPost` — maximum replies emitted per root post.
- `maxDepth` — maximum known thread depth to keep where depth is derivable.
- `includeRoot` — include the root post in output.
- `includeQuotes` — include quote posts where supported.
- `minEngagement` — filter low-engagement replies.

### Output

Each dataset row is a normalized root post or reply. Common fields include:

- `postId`
- `url`
- author fields
- `text`
- `createdAt`
- engagement metrics
- `conversationId`
- `inReplyToId`
- `threadDepth`
- quote/retweet indicators

The run also stores a `RUN_SUMMARY` record with processed roots, emitted items, retries, failures, and warnings.

### Good use cases

- Customer feedback threads
- Product launch reactions
- Support and feature-request discussions
- Brand mention conversations
- Viral post reply analysis
- Evidence collection for market research
- Feeding normalized conversations into sentiment or classification workflows

### Pricing

Apify Store charges for this Actor are separate from X API charges.

Your X Developer account is responsible for X API usage generated by your token. Check current X API pricing and limits before large conversation runs.

### Limitations

- Reply discovery is limited to data returned by the official X API.
- Older conversations may require full-archive search access.
- Thread depth is not guessed when the API does not expose enough parent information.
- Protected, deleted, unavailable, or otherwise inaccessible content is not returned.
- X rate limits and product limits apply.

This Actor is not affiliated with X Corp.

# Changelog

This Actor's version history is a separate document: https://apify.com/nexascout/nexascout-x-conversation-replies/changelog.md

# Actor input Schema

## `posts` (type: `array`):

X post URLs or numeric IDs.

## `bearerToken` (type: `string`):

Bring your own X Developer API Bearer Token for live X access. Apify encrypts this secret before storing run input. X API usage and charges apply to your own X Developer account. NexaScout does not use its X token for public/Store runs.

## `adapter` (type: `string`):

Use x-api for real X data. mock returns synthetic deterministic data and is intended only for testing.

## `searchMode` (type: `string`):

recent searches the recent window; all requests full archive.

## `adapterConfig` (type: `object`):

Advanced/testing settings only. For live x-api runs the endpoint is locked to the official X API. Never place credentials in this object; use the encrypted bearerToken field.

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

Reply cap per root.

## `maxDepth` (type: `integer`):

Applied where depth can be derived without guessing.

## `includeQuotes` (type: `boolean`):

Include quote posts.

## `includeRoot` (type: `boolean`):

Emit root post.

## `minEngagement` (type: `integer`):

likes+replies+reposts+quotes threshold.

## `interPostDelaySec` (type: `integer`):

Seconds between roots.

## `includeRaw` (type: `boolean`):

Attach raw X API payload.

## `maxRuntimeSec` (type: `integer`):

Runtime cap.

## `maxRetries` (type: `integer`):

Retries for 429/5xx.

## Actor input object example

```json
{
  "adapter": "x-api",
  "searchMode": "recent",
  "maxRepliesPerPost": 25,
  "maxDepth": 3,
  "includeQuotes": false,
  "includeRoot": true,
  "minEngagement": 0,
  "interPostDelaySec": 1,
  "includeRaw": false,
  "maxRuntimeSec": 600,
  "maxRetries": 2
}
```

# Actor output Schema

## `conversation` (type: `string`):

Normalized root posts and public replies.

## `runSummary` (type: `string`):

Processed roots, emitted items, retries, failures, and warnings.

# 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 = {};

// Run the Actor and wait for it to finish
const run = await client.actor("nexascout/nexascout-x-conversation-replies").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 = {}

# Run the Actor and wait for it to finish
run = client.actor("nexascout/nexascout-x-conversation-replies").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 '{}' |
apify call nexascout/nexascout-x-conversation-replies --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "type": "http",
            "url": "https://mcp.apify.com/?tools=fetch-actor-details,nexascout/nexascout-x-conversation-replies"
        }
    }
}
```

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/0ljRDiI4iCQ4fNJoc/builds/GA8Upo0LTaZTzWloR/openapi.json
