# X (Twitter) Post, Engagement, Profile & HD Video Scraper (`wyle/x-tweet-detail-scraper`) Actor

Fetch public X (Twitter) posts, view/like/repost metrics, user profile cards, and direct HD MP4 video download links from tweet URLs or IDs cleanly with no login required.

- **URL**: https://apify.com/wyle/x-tweet-detail-scraper.md
- **Developed by:** [Willy Lengkong](https://apify.com/wyle) (community)
- **Categories:** Social media, News, Lead generation
- **Features:** Limited permissions
- **Stats:** 2 total users, 1 monthly users, 100.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

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

## X (Twitter) Post, Engagement, Profile & HD Video Scraper

Extract structured data from public X (Twitter) posts and creator profiles in seconds—including full engagement counters, direct 1080p MP4 video URLs, high-resolution images, parent/quoted tweet context, and author metadata. Built for fast, lightweight extraction without requiring an X account, cookies, or a browser.

### Modes

| Mode | Input | What you get |
|---|---|---|
| **Post Details & Media** | `tweets` (post URLs like `x.com/user/status/...`, `twitter.com/...`, or numeric Tweet IDs) | Full post text, all 6 engagement metrics, HD MP4 video variants, images, polls, link cards, Community Notes, and author summary |
| **Creator Profiles** | `profiles` or `@username` / profile URLs in `tweets` | Profile intelligence (`recordType: "profile"`) with follower/following counts, verification type, bio, website, join date, avatar, and banner |
| **Reply & Quote Context** | `includeParentTweet`, `includeQuotedTweet`, `flattenThreadContext` | Parent post for replies and quoted post details, either nested on the post or flattened into separate dataset rows |

### Supported Coverage

- **Input Formats**: `https://x.com/<user>/status/<id>`, `https://twitter.com/<user>/status/<id>`, numeric Tweet IDs (`2082577277246972300`), `@username` handles, and profile URLs (`https://x.com/OpenAI`).
- **Engagement Metrics**: `viewCount`, `likeCount`, `retweetCount`, `replyCount`, `quoteCount`, and `bookmarkCount`.
- **Video & Media Assets**: Direct `.mp4` streams up to `1920x1080` (`bestVideoUrl` + `videos[].variants` with resolution, bitrate, codec, and HLS `.m3u8`), thumbnails, duration, and high-res `images`.
- **Rich Context & Entities**: `hashtags`, `mentions`, `urls`, `poll`, `card`, `communityNote`, `parentTweet`, `quotedTweet`, and full `author` profile object.

### Output Options & Proxy Tips

- **Nested vs. Flattened Context**: By default (`flattenThreadContext: false`), parent and quoted tweets are embedded inside `parentTweet` and `quotedTweet`. Set `flattenThreadContext: true` to emit them as additional top-level rows (`recordType: "parent_tweet"` or `"quoted_tweet"`).
- **Historical View Counts**: Some older posts published before X introduced public impression tracking may return `viewCount: 0`.
- **Proxy Recommendations**: Standard runs work reliably with a direct connection and no X login or cookies. For large multi-hundred target batches, enabling Apify Proxy in `proxyConfiguration` helps keep throughput consistent.

### Use Cases

1. **HD Video Archiving & Media Workflows**: Resolve direct `1080p` `.mp4` video URLs (`bestVideoUrl`) and high-res images from post links in automation tools like n8n, Make, or Zapier.
2. **Campaign & Viral Post Tracking**: Monitor views, likes, reposts, replies, quotes, and bookmarks across brand, competitor, or influencer posts.
3. **Creator & Influencer Auditing**: Track follower counts, verification status (`individual`, `organization`, `government`), biographies, and profile links across X handles.
4. **AI & Market Sentiment Pipelines**: Feed clean post text, quoted context, and Community Notes into LLM analysis, newsroom monitoring, or financial research workflows.

### Input Parameters

| Parameter | Type | Default | Description |
|---|---|---|---|
| `tweets` | `array` | `["https://x.com/elonmusk/status/1585341984679469056", "https://x.com/OpenAI/status/2082577277246972300", "https://twitter.com/jack/status/20", "@OpenAI"]` | X/Twitter post URLs, numeric Tweet IDs, or creator `@usernames` / profile URLs. |
| `profiles` | `array` | `[]` | Optional list of X handles (`@NASA`) or profile URLs (`https://x.com/OpenAI`) to extract creator profile intelligence. |
| `includeParentTweet` | `boolean` | `true` | Automatically extract the parent tweet when a target post is a reply. |
| `includeQuotedTweet` | `boolean` | `true` | Extract full details, metrics, and media of any quoted tweet. |
| `flattenThreadContext` | `boolean` | `false` | Also push extracted parent or quoted tweets as separate top-level dataset rows (`recordType: "parent_tweet"` / `"quoted_tweet"`). |
| `proxyConfiguration` | `object` | `{"useApifyProxy": false}` | Optional Apify Proxy configuration. Direct connections work reliably without proxies for standard runs. |

### Sample Output

#### Post with Engagement Metrics (`recordType: "tweet"`)

```json
{
  "recordType": "tweet",
  "tweetId": "2082577277246972300",
  "url": "https://x.com/OpenAI/status/2082577277246972300",
  "authorUsername": "OpenAI",
  "authorFullName": "OpenAI",
  "authorVerified": true,
  "authorFollowers": 5518291,
  "text": "After deployment, we applied GPT-5.6 Sol to advance the frontier of efficiency by making itself more efficient to run. \n\nThe results:\n- 20% lower serving costs from production GPU kernel improvements.\n- 15%+ better token-generation efficiency from improved speculative decoding.",
  "cleanText": "After deployment, we applied GPT-5.6 Sol to advance the frontier of efficiency by making itself more efficient to run. \n\nThe results:\n- 20% lower serving costs from production GPU kernel improvements.\n- 15%+ better token-generation efficiency from improved speculative decoding.",
  "lang": "en",
  "viewCount": 5145906,
  "likeCount": 16983,
  "retweetCount": 877,
  "replyCount": 584,
  "quoteCount": 416,
  "bookmarkCount": 1947,
  "mediaType": "text",
  "images": [],
  "videos": [],
  "isReply": false,
  "isNoteTweet": false,
  "possiblySensitive": false,
  "hashtags": [],
  "mentions": [],
  "urls": [],
  "author": {
    "userId": "4398626122",
    "username": "OpenAI",
    "fullName": "OpenAI",
    "profileUrl": "https://x.com/OpenAI",
    "isVerified": true,
    "verificationType": "organization",
    "isProtected": false,
    "followerCount": 5518291,
    "followingCount": 4,
    "tweetCount": 0,
    "likesCount": 2597,
    "mediaCount": 765,
    "biography": "OpenAI’s mission is to ensure that artificial general intelligence benefits all of humanity. We’re hiring: http://openai.com/jobs",
    "website": "https://openai.com",
    "joinedAt": "2015-12-06T22:51:08+00:00",
    "avatarUrl": "https://pbs.twimg.com/profile_images/1885410181409820672/ztsaR0JW_200x200.jpg",
    "bannerUrl": "https://pbs.twimg.com/profile_banners/4398626122/1777662919"
  },
  "createdAt": "2026-07-29T21:21:29+00:00",
  "createdTimestamp": 1785360089,
  "scrapedAt": "2026-11-07T17:16:38.742334+00:00"
}
```

#### Video Post (`recordType: "tweet"`, `mediaType: "video"`)

```json
{
  "recordType": "tweet",
  "tweetId": "1585341984679469056",
  "url": "https://x.com/elonmusk/status/1585341984679469056",
  "authorUsername": "elonmusk",
  "authorFullName": "Elon Musk",
  "authorVerified": true,
  "authorFollowers": 241429248,
  "text": "Entering Twitter HQ – let that sink in!",
  "cleanText": "Entering Twitter HQ – let that sink in!",
  "lang": "en",
  "viewCount": 0,
  "likeCount": 1223251,
  "retweetCount": 154745,
  "replyCount": 58098,
  "quoteCount": 42879,
  "bookmarkCount": 14033,
  "mediaType": "video",
  "bestVideoUrl": "https://video.twimg.com/ext_tw_video/1585341912877146112/pu/vid/1920x1080/aeoVUvTgj4wHShhN.mp4?tag=14",
  "images": [],
  "videos": [
    {
      "videoId": "1585341912877146112",
      "url": "https://video.twimg.com/ext_tw_video/1585341912877146112/pu/vid/1920x1080/aeoVUvTgj4wHShhN.mp4?tag=14",
      "thumbnailUrl": "https://pbs.twimg.com/ext_tw_video_thumb/1585341912877146112/pu/img/DwJ7wlGIe9iryk6N.jpg",
      "durationSeconds": 9.301,
      "width": 1920,
      "height": 1080,
      "variants": [
        {
          "url": "https://video.twimg.com/ext_tw_video/1585341912877146112/pu/vid/480x270/6tarM2TjLH1Ahh90.mp4?tag=14",
          "bitrate": 256000,
          "contentType": "video/mp4",
          "resolution": "480x270",
          "codec": "h264"
        },
        {
          "url": "https://video.twimg.com/ext_tw_video/1585341912877146112/pu/vid/1280x720/cwj11yOgYZ05R_sY.mp4?tag=14",
          "bitrate": 2176000,
          "contentType": "video/mp4",
          "resolution": "1280x720",
          "codec": "h264"
        },
        {
          "url": "https://video.twimg.com/ext_tw_video/1585341912877146112/pu/vid/1920x1080/aeoVUvTgj4wHShhN.mp4?tag=14",
          "bitrate": 10368000,
          "contentType": "video/mp4",
          "resolution": "1920x1080",
          "codec": "h264"
        }
      ]
    }
  ],
  "isReply": false,
  "isNoteTweet": false,
  "possiblySensitive": false,
  "hashtags": [],
  "mentions": [],
  "urls": [],
  "author": {
    "userId": "44196397",
    "username": "elonmusk",
    "fullName": "Elon Musk",
    "profileUrl": "https://x.com/elonmusk",
    "isVerified": true,
    "verificationType": "individual",
    "badgeLabel": "X",
    "isProtected": false,
    "followerCount": 241429248,
    "followingCount": 1420,
    "tweetCount": 0,
    "likesCount": 257535,
    "mediaCount": 4764,
    "biography": "http://Terafab.AI",
    "joinedAt": "Tue Jun 02 20:12:29 +0000 2009",
    "avatarUrl": "https://pbs.twimg.com/profile_images/2103567689515954176/aR-Kjpp4_200x200.jpg",
    "bannerUrl": "https://pbs.twimg.com/profile_banners/44196397/1774145451"
  },
  "createdAt": "2022-10-26T18:45:58+00:00",
  "createdTimestamp": 1666809958,
  "scrapedAt": "2026-11-07T17:16:38.102722+00:00"
}
```

#### Creator Profile (`recordType: "profile"`)

```json
{
  "recordType": "profile",
  "tweetId": "4398626122",
  "url": "https://x.com/OpenAI",
  "authorUsername": "OpenAI",
  "authorFullName": "OpenAI",
  "authorVerified": true,
  "authorFollowers": 5518291,
  "text": "OpenAI’s mission is to ensure that artificial general intelligence benefits all of humanity. We’re hiring: http://openai.com/jobs",
  "cleanText": "OpenAI’s mission is to ensure that artificial general intelligence benefits all of humanity. We’re hiring: http://openai.com/jobs",
  "lang": "en",
  "viewCount": 765,
  "likeCount": 2597,
  "retweetCount": 0,
  "replyCount": 2234,
  "quoteCount": 0,
  "bookmarkCount": 0,
  "mediaType": "profile",
  "images": [
    "https://pbs.twimg.com/profile_images/1885410181409820672/ztsaR0JW_400x400.jpg",
    "https://pbs.twimg.com/profile_banners/4398626122/1777662919"
  ],
  "videos": [],
  "isReply": false,
  "isNoteTweet": false,
  "possiblySensitive": false,
  "hashtags": [],
  "mentions": [],
  "urls": [],
  "author": {
    "userId": "4398626122",
    "username": "OpenAI",
    "fullName": "OpenAI",
    "profileUrl": "https://x.com/OpenAI",
    "isVerified": true,
    "verificationType": "organization",
    "isProtected": false,
    "followerCount": 5518291,
    "followingCount": 4,
    "tweetCount": 2234,
    "likesCount": 2597,
    "mediaCount": 765,
    "biography": "OpenAI’s mission is to ensure that artificial general intelligence benefits all of humanity. We’re hiring: http://openai.com/jobs",
    "website": "https://openai.com",
    "joinedAt": "2015-12-06T22:51:08+00:00",
    "avatarUrl": "https://pbs.twimg.com/profile_images/1885410181409820672/ztsaR0JW_400x400.jpg",
    "bannerUrl": "https://pbs.twimg.com/profile_banners/4398626122/1777662919"
  },
  "createdAt": "2015-12-06T22:51:08+00:00",
  "scrapedAt": "2026-11-07T17:16:40.062171+00:00"
}
```

# Actor input Schema

## `tweets` (type: `array`):

Enter X/Twitter post URLs (e.g. https://x.com/elonmusk/status/1585341984679469056), numeric Tweet IDs (e.g. 2082577277246972300, 20), or Creator Profile URLs / @usernames (e.g. @OpenAI).

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

Optional list of X (Twitter) handles (e.g. @NASA, @MrBeast) or profile URLs (https://x.com/OpenAI) to extract full creator profile intelligence (followers, following, total tweets, verification badge, bio, banner & avatar).

## `includeParentTweet` (type: `boolean`):

When a target tweet is a reply to another tweet, automatically extract the parent tweet details and metrics.

## `includeQuotedTweet` (type: `boolean`):

When a target tweet quotes another post, extract full details, metrics, and media of the quoted tweet.

## `flattenThreadContext` (type: `boolean`):

When enabled, any parent tweet or quoted tweet is also pushed as its own top-level dataset row (recordType='parent_tweet' or 'quoted_tweet').

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

Optional Apify Proxy settings. Direct connections work reliably without proxies for standard runs; enable Apify Proxy for large batches.

## Actor input object example

```json
{
  "tweets": [
    "https://x.com/elonmusk/status/1585341984679469056",
    "https://x.com/OpenAI/status/2082577277246972300",
    "https://twitter.com/jack/status/20",
    "@OpenAI"
  ],
  "profiles": [],
  "includeParentTweet": true,
  "includeQuotedTweet": true,
  "flattenThreadContext": false,
  "proxyConfiguration": {
    "useApifyProxy": false
  }
}
```

# Actor output Schema

## `dataset` (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 = {
    "tweets": [
        "https://x.com/elonmusk/status/1585341984679469056",
        "https://x.com/OpenAI/status/2082577277246972300",
        "https://twitter.com/jack/status/20",
        "@OpenAI"
    ],
    "proxyConfiguration": {
        "useApifyProxy": false
    }
};

// Run the Actor and wait for it to finish
const run = await client.actor("wyle/x-tweet-detail-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 = {
    "tweets": [
        "https://x.com/elonmusk/status/1585341984679469056",
        "https://x.com/OpenAI/status/2082577277246972300",
        "https://twitter.com/jack/status/20",
        "@OpenAI",
    ],
    "proxyConfiguration": { "useApifyProxy": False },
}

# Run the Actor and wait for it to finish
run = client.actor("wyle/x-tweet-detail-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 '{
  "tweets": [
    "https://x.com/elonmusk/status/1585341984679469056",
    "https://x.com/OpenAI/status/2082577277246972300",
    "https://twitter.com/jack/status/20",
    "@OpenAI"
  ],
  "proxyConfiguration": {
    "useApifyProxy": false
  }
}' |
apify call wyle/x-tweet-detail-scraper --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "type": "http",
            "url": "https://mcp.apify.com/?tools=fetch-actor-details,wyle/x-tweet-detail-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/JdtqgYlma2VD8Svm4/builds/kKH8usC36eW7ptovV/openapi.json
