X / Twitter Posts Scraper — Profile & Post URLs

Export public X/Twitter posts from profile or post URLs, with text, authors, engagement counts, and media links. Download JSON or CSV. Search queries are not supported.

Data fields

FieldTypeDescription
idstringValue exported as id.
urlstringValue exported as url.
twitterUrlstringValue exported as twitterUrl.
textstringValue exported as text.
createdAtstring | nullValue exported as createdAt.
langstring | nullValue exported as lang.
replyCountinteger | nullValue exported as replyCount.
repostCountinteger | nullValue exported as repostCount.

Input preview

startUrlsStart URLs *
maxItemsMaximum items

API and agents

This actor can be run through Apify API, datasets, webhooks, schedules, and the official Apify MCP server.

Ready-to-run examples

Open a saved Apify example, adjust the input, and run the actor in your own Apify account.

View all examples

How this actor works

See example inputs, outputs, API usage, and practical limits before running this actor on Apify.

Open Apify page

Export public X (Twitter) posts from supplied profile or individual post URLs. Get post text, author details, visible engagement counts, media links, and source metadata for research or monitoring.

Public profile and post URLs only: X search queries and search-result URLs are not supported. No protected or login-only content is included.

Quick start

{
  "startUrls": [
    {
      "url": "https://x.com/elonmusk"
    }
  ],
  "maxItems": 5
}

Output dataset

Illustrative shortened post record; the example text, author, and counts are not live evidence.

{
  "id": "2093127984701989032",
  "url": "https://x.com/example/status/2093127984701989032",
  "text": "Example public post text",
  "createdAt": "2026-08-28T00:06:14.000Z",
  "likeCount": 40194,
  "repostCount": 3852,
  "author": { "username": "example", "name": "Example Author" },
  "sourceType": "profile"
}
Field Description
id, url, twitterUrl, text Stable post identity, canonical links, and public post text.
createdAt, lang Publication timestamp and language when the public response provides them.
replyCount, repostCount, likeCount, quoteCount, bookmarkCount, viewCount Visible engagement metrics; unavailable values are null.
isReply, isRetweet, isQuote Post relationship flags where publicly detectable.
mediaUrls Unique public media URLs attached to a post.
author Public author ID, username, display name, profile URL/image, follow counts, and verification flags when available.
sourceUrl, sourceType, paginationCursor, scrapedAt, partialSourceFailure Requested source, source mode, collection time, and partial-run indicator. paginationCursor records the public cursor used for a continued profile page, or is null for the first page/status URLs.

Input settings

Setting JSON key Type / default What it does
Start URLs startUrls array / not set Public X / Twitter tweet profile or status URLs for social listening, tweet monitoring, and content research. Search URLs are not supported because X requires login for search.
Maximum items maxItems integer / 10 Maximum public X / Twitter tweets to save from supported anonymous profile pages (1–100). The Actor follows bounded public timeline cursors while they advance. Minimum 1; maximum 100.

Why use this X tweet scraper?

  • Export public post text, canonical links, author details, visible engagement, and media URLs.
  • Start from public profile URLs or direct /status/<id> links.
  • Keep requested source URLs and collection timestamps alongside every saved record.
  • Deduplicate posts across multiple supplied sources in one run.

Use cases

A Twitter tweet scraper workflow can monitor posts from a public company, creator, or community account. An X profile scraper workflow can turn a supplied public account URL into a compact, reusable post dataset.

  • Monitor posts from a public company, creator, or community account.
  • Build a research dataset for content analysis or reporting.
  • Preserve public post references for editorial review.
  • Send normalized public post data to spreadsheets, databases, or automation workflows.

Tips

  • Supply one or more direct public profile or post URLs in startUrls.
  • Use direct status URLs when you need a single public post.
  • X search URLs and query strings are not supported in this version because a stable anonymous result route is not available.
  • Review partialSourceFailure and the RUN_SUMMARY record when a multi-source run has mixed results.

Who is it for?

This Actor is for social media teams, researchers, analysts, and automation builders who need a repeatable export of public X posts from known profiles or status links. It is not a search engine and does not collect protected or login-only posts.

Start on Apify

  1. Open X Tweet Scraper in the Apify Store and click Try for free.
  2. Add one or more public profile or direct status URLs under Start URLs.
  3. Set a low maxItems first, then run the Actor and export the default dataset as JSON or CSV.

API usage

Use your Apify API token through the APIFY_TOKEN environment variable. Node.js and Python examples wait for the run and read its first dataset page; paginate the dataset for larger exports.

Node.js

import { ApifyClient } from 'apify-client';
const client = new ApifyClient({ token: process.env.APIFY_TOKEN });
const run = await client.actor('fetch_cat/tweet-scraper').call({
  "startUrls": [
    {
      "url": "https://x.com/elonmusk"
    }
  ],
  "maxItems": 5
});
const { items } = await client.dataset(run.defaultDatasetId).listItems();
console.log(items);

Python

import json
import os
from apify_client import ApifyClient

client = ApifyClient(os.environ["APIFY_TOKEN"])
run_input = json.loads('''{
  "startUrls": [
    {
      "url": "https://x.com/elonmusk"
    }
  ],
  "maxItems": 5
}''')
run = client.actor("fetch_cat/tweet-scraper").call(run_input=run_input)
print(client.dataset(run["defaultDatasetId"]).list_items().items)

cURL

Save the quickstart JSON as input.json. This request starts a run asynchronously; use its returned run ID to check completion and its defaultDatasetId to retrieve results.

curl -X POST "https://api.apify.com/v2/acts/fetch_cat~tweet-scraper/runs" \
  -H "Authorization: Bearer $APIFY_TOKEN" \
  -H "Content-Type: application/json" \
  --data-binary @input.json

MCP and AI agents

Use the official Apify MCP server, not a separate custom server. The focused URL below selects this Actor. Authenticate with Apify when your client prompts you; configuration syntax and OAuth support depend on the client.

Claude Code

claude mcp add --transport http apify "https://mcp.apify.com?tools=fetch_cat/tweet-scraper"

HTTP-capable MCP client configuration

{
  "mcpServers": {
    "apify": {
      "url": "https://mcp.apify.com?tools=fetch_cat/tweet-scraper"
    }
  }
}

Example prompt: "Export up to five posts from this public X profile URL. Show post text, dates, engagement, and source links; flag partial results."

Use the same input keys as the input table. Review the returned source URLs and any error or availability fields before using results in an automated summary.

Support

If a run fails or output looks wrong, open an issue from the Actor page. Include the Apify run ID or run URL, non-sensitive input JSON, expected output, actual output, and one reproducible public URL (or the exact search input). Do not share tokens, cookies, passwords, or private data.

Common questions

Questions and answers reused from the canonical actor README.

Can I scrape X search results?

No. This version supports public profile and direct status URLs only. It rejects search URLs rather than returning a login page or unrelated records.

Can I use the Actor via API or MCP?

Yes. Submit the same input through the Apify API, retrieve the default dataset, or enable this Actor in an Apify MCP tool selection.

What happens if one source fails?

Completed posts are retained. Check partialSourceFailure and RUN_SUMMARY to identify a source that was private, deleted, rate-limited, or no longer publicly available.

Is this for public data only?

Yes. Do not use it to access protected content, bypass access controls, or collect data in violation of applicable laws or platform terms.