Posts, searches & profiles

X (Twitter) Scraper

Search X for your brand, a competitor or a hashtag, or paste a profile, a list or a post. Every post comes back with its engagement, media and author, so you can see what took off and who started it.

On JMLP: 5 credits per result, from $0.13 per 1,000 results. No proxies or X account needed. Start with 500 free credits.

Ways to use this scraper.

Three examples to start from.

Monitor mentions of your brand

Search your brand and product names every morning, sorted by Latest, with yesterday as the start date. Read the posts with the most replies first, because that’s where a complaint or a question is building.

A daily mention log with a link to every post.

See which competitor posts land

Collect a competitor’s posts from the last three months and sort them by likes and views. A handful usually do most of the work, and they tend to share a format.

A shortlist of a competitor’s best posts, with the numbers next to each.

Read the replies to a launch

Paste the post that announced a launch into Conversation IDs and collect its replies. Tag them by topic, and within an hour you’ll know what people liked and what confused them.

A reply digest grouped by topic, each line linked to its post.

Your first run.

  1. Open the Actor on Apify and go to the Input tab. Switch to the JSON editor if you’d rather paste a configuration.
  2. Replace apify with your brand, a competitor or a hashtag. Keep it to one search term for the first run.
  3. Keep maxItems at 50 and sort by Latest. Check the text, created_at and author of a few posts before you add filters or more searches.
  4. Start the run and keep an eye on the log. If it comes back empty, check which targets and filters were read before you conclude there’s nothing there.
  5. Open Storage → Dataset and read a few records. Export CSV for a quick look in a spreadsheet, or JSON if you need the nested fields.
First-run configuration
{
  "searchTerms": ["apify"],
  "sort": "Latest",
  "maxItems": 50
}

Paste this into the Actor’s JSON input editor. Replace the example targets with yours before running.

Check the current input form on Apify

Ways to search.

Search terms and handles go through X’s search, so every filter applies. Links read a profile, a list or a post directly, and conversation IDs collect the replies to a post. You can mix all four in one run.

Search methodWhen to use itWhat changes
Keyword discoveryWhen to use itYou want to find relevant results before choosing specific targets.What changesFinds posts from any account. Operators and the filters narrow it down, and Latest reaches back as far as X’s search goes.
Account handlesWhen to use itYou have a competitor watchlist.What changesSearched as from:handle, so dates and filters apply and it can go back years. Slower than a profile link, because searches are what X limits most.
X linksWhen to use itYou already configured the search on the source website.What changesA profile link reads the account’s timeline, newest first and with its pinned post. A list link reads the list, and a post link returns that one post.
ConversationsWhen to use itYou know the exact entity you want to collect.What changesReturns the post and its replies, ranked the way the post’s page ranks them. Replies X hides behind Show more are not opened.

Worth knowing

A handle is a search: it reaches back years and takes every filter, but searches are what X limits most. A profile link reads the account’s own timeline instead, about eight times faster, newest first.

Compare the related scraper

What each input does.

In JSON, use the field names exactly as written below. In Apify’s form, add list items one at a time and keep numbers and true/false values as they are.

A default is what the Actor uses when you leave a setting out, and some settings have none. A prefill is an example Apify has already typed into the form, and it runs unless you change it. Check the prefilled targets and limits before you start; you always need at least one target of your own.

Targets and search inputs4
startUrls
ListForm prefill: ["https://x.com/apify","https://x.com/search?q=apify%20&src=typed_query","https://x.com/i/lists/78783491"]

X links, one per line: a profile (x.com/apify) for its posts, a profile’s Replies tab (x.com/apify/with_replies), a post, a search, a hashtag or a list (x.com/i/lists/...). twitter.com links and bare post IDs work too.

searchTerms
ListForm prefill: ["web scraping","scraping from:apify"]

What you would type into X’s search, one per line. X’s own operators work, such as from:, lang:, min_faves: or a phrase in quotes. Every filter below is added to each search.

twitterHandles
ListForm prefill: ["apify"]

Accounts whose posts you want, one per line, with or without @. Each is searched as from:handle, so Sort By, the date range and every filter apply, and the search can reach back years.

conversationIds
List

Posts whose replies you want: the post’s ID or link, one per line. You get the post and its replies in the order the post’s page shows them.

Markets, dates and filters21
sort
TextDefault: Latest

For searches and handles. Latest goes back in time, newest first. Top is X’s most relevant posts, a few hundred at most. Latest + Top runs both and drops the posts they share. A pasted search link keeps its own tab.

Suggested JSON values
Latest Top Latest + Top
tweetLanguage
Text

Only posts X detected in this language, as an ISO 639-1 code such as en, de or es.

Suggested JSON values
en es pt fr de it nl ja ko zh ar hi id tr ru uk pl th vi fa ur he el sv da no fi cs ro hu bg sr ca eu tl ms bn ta te mr gu kn ml pa ne si my km lo am ka hy is cy ht sw
onlyVerifiedUsers
True or false

Only posts by verified accounts.

onlyTwitterBlue
True or false

Only posts by accounts with X Premium, the blue check.

onlyImage
True or false

Only posts with an image.

onlyVideo
True or false

Only posts with a video.

onlyQuote
True or false

Only posts that quote another post.

author
Text

Only posts by this account, added to every search as from:. A handle, with or without @.

inReplyTo
Text

Only replies to this account, added as to:.

mentioning
Text

Only posts that mention this account, added as @handle.

geotaggedNear
Text

Only posts geotagged near this place, added as near:. Few posts carry a location, so expect small results.

withinRadius
Text

With Geotagged near, how far from the place, added as within:, such as 15km or 10mi.

geocode
Text

Only posts from within a radius of a point, added as geocode:latitude,longitude,radius, for example 37.7764685,-122.4172004,10km.

placeObjectId
Text

Only posts tagged with this X place, added as place:, such as 96683cc9126741d1.

minimumRetweets
Integer

Only posts with at least this many reposts, added as min_retweets:.

minimumFavorites
Integer

Only posts with at least this many likes, added as min_faves:.

minimumReplies
Integer

Only posts with at least this many replies, added as min_replies:.

start
Text

Only posts from this day on, as YYYY-MM-DD. A date with a time, such as 2025-01-31T09:00:00Z, is honoured to the second.

end
Text

Only posts up to and including this day, as YYYY-MM-DD. A date with a time is honoured to the second.

includeSearchTerms
True or falseDefault: false

Adds a search_term field to each post found by a search or a handle: the line it was found with. Useful when one run covers several searches.

includeReposts
True or falseDefault: false

For profile links, also return the account’s reposts. Without them a profile is read about eight times faster, because X serves an account’s own posts in bigger pages and at a higher rate.

Limits, details and proxies3
maxItems
IntegerForm prefill: 100

Stop after this many unique posts across every search, handle and link. It caps both runtime and cost, and is shared out so that each target gets its turn. Empty means every post found.

maxConcurrency
IntegerDefault: 20

How many searches, handles and links are read side by side, 1 to 20. Each takes its turn at the scraper’s X accounts, so the run’s cap is spread across all of them.

proxyConfiguration
ObjectDefault: {"useApifyProxy":true}Form prefill: {"useApifyProxy":true}

Only used by your own X accounts that have no proxy of their own: each keeps to one IP of this proxy. The scraper’s own accounts always use their fixed IPs. Apify’s datacenter proxy is the default and works.

Advanced settings and recovery3
resume
True or falseDefault: true

Saves progress about every 30 seconds so an Apify restart or migration can continue the current run. Leave it on for normal use.

continueFromLastRun
True or falseDefault: false

Continues unfinished work from the previous run with matching input. Earlier results remain in that run’s dataset. Keep false for a fresh collection or a recurring snapshot.

ownAccounts
Text

Optional. To read X with your own accounts instead of ours: one account per line, its auth_token and ct0 cookies from x.com as auth_token:ct0, optionally followed by :http://user:pass@host:port for a proxy of its own. The run then uses yours alone. Stored encrypted.

This reference follows the Actor’s published input fields. Check the live form before changing a production workflow. Check the current input form on Apify.

Three setups to copy.

Each one is a separate run. Swap in your own targets, countries and dates, start small, and widen it only once the first results look right.

Log a week of brand mentions

Collect the last week’s English posts that mention a brand or an exact phrase, newest first, and keep the search each post came from.

Log a week of brand mentions
{
  "searchTerms": ["apify", "\"apify actor\""],
  "sort": "Latest",
  "start": "2026-11-24",
  "tweetLanguage": "en",
  "maxItems": 200,
  "includeSearchTerms": true
}

Find a competitor’s best posts of a quarter

Collect one account’s Top posts from three months with at least 10 likes, then sort them by views to see which formats worked.

Find a competitor’s best posts of a quarter
{
  "twitterHandles": ["apify"],
  "sort": "Top",
  "start": "2026-09-01",
  "end": "2026-11-30",
  "minimumFavorites": 10,
  "maxItems": 100
}

Read every reply to an announcement

Collect a post and up to 300 of its replies from its link, then tag them by topic.

Read every reply to an announcement
{
  "conversationIds": ["https://x.com/apify/status/2127776126235750881"],
  "maxItems": 300
}

After the first run.

Expect one row per post with its text, created_at, likes, reposts, replies, quotes, bookmarks and views, its media, links, hashtags and mentions, the author, and the post it quotes or reposts. The run summary lists the filters it added to each search.

  1. Look at the dataset and the run’s SUMMARY record. Did you hit your cap? Were any inputs skipped? Open a few source links to make sure the records are what you think they are.
  2. Whatever you save, keep the original IDs and add collected_at and run_id. CSV is fine for flat columns; keep the JSON when arrays or nested details matter.
  3. Once a configuration works, save it as an Apify Task and schedule it. Leave continueFromLastRun false for repeated snapshots, and deduplicate by source ID without throwing away the dates you saw each record.
  4. In Make or n8n, trigger on a successful run, fetch the dataset and map the fields into Sheets or your warehouse. Looker Studio works best from a reporting table, and dbt is the place to flatten and test the warehouse models.
  5. The same JSON works with Apify’s API. With Claude and the Apify MCP server, name this Actor, have Claude check the live schema first, and give it explicit targets, markets and limits.

Resume is not a fresh snapshot

resume protects the current run if Apify restarts it. continueFromLastRun picks up an earlier run with the same configuration, and the earlier records stay in the earlier dataset, so you combine the two to get everything. If that run hit its cap, raise the cap before continuing. For a picture of what changed today, start fresh.

Follow the Sheets, Claude, Looker and BigQuery setup guides
Run this Actor from the API

Save one configuration above as input.json. Set APIFY_TOKEN to your Apify API token in your terminal, then send the file as the request body.

Start the run
curl --fail-with-body --request POST \
  --url "https://api.apify.com/v2/actors/jmlp~x-twitter-scraper/runs" \
  --header "Authorization: Bearer $APIFY_TOKEN" \
  --header "Content-Type: application/json" \
  --data-binary @input.json

The response contains a run ID and defaultDatasetId, not finished results. Wait for the run to succeed, set DATASET_ID to that dataset ID, then fetch its items. For large datasets, use limit and offset to page through the export.

Fetch the dataset
curl --fail-with-body \
  --url "https://api.apify.com/v2/datasets/$DATASET_ID/items?format=json" \
  --header "Authorization: Bearer $APIFY_TOKEN"

Apify’s run and export API reference
Dataset export options

If something looks off.

Change one setting at a time and keep the cap small. The run summary usually tells you what went wrong.

The run says it is waiting for X’s rate limit.

Each account the scraper signs in with may read only so much every 15 minutes, and searches are limited most. The run waits for the window to reset and carries on. If it would time out first, it ends normally and Continue from last run picks up where it stopped. Profile and list links read many times faster.

I got fewer posts than I see on X.

X’s search leaves some posts out, especially from new or low-quality accounts, and Top returns a few hundred at most. Use Latest for completeness, check that a filter isn’t narrowing more than you meant, and for one account’s newest posts paste its profile link.

The run says my own X accounts couldn’t be read or were refused.

Each line needs the account’s auth_token and ct0 cookies as auth_token:ct0. Copy them again from x.com while signed in: they change when you sign out. The run never falls back to our accounts, so it stops and says what to fix. Leave the field empty to use ours.

The run succeeded but returned nothing

Succeeded only means the Actor finished, not that the source sent anything back. Look at SUMMARY.inputProblem, SUMMARY.problem and the log for missing targets, unsupported filters or refused requests, then try one target you know has data, with fewer filters.

Fewer records than expected

Usually it’s a limit: the global cap, a per-search or per-page cap, or what the platform covers. Deduplication also removes records that several searches found, and a site’s headline count can include records its public pages never show. Check for unfinished jobs before you call the dataset complete.

Use the results in your tools.

Google Sheets

Add id, created_at, author, text, like_count, repost_count and view_count, plus columns for topic and sentiment. Sort by replies each morning to see what needs an answer.

Read the setup

Claude + MCP

Ask Claude to group the posts by topic and quote the url of each example. Remind it that likes and views measure reach, not agreement.

Read the setup

Looker Studio

Chart posts per day and engagement by author, with filters for language and search term. Show the collection time, because the counts keep moving.

Read the setup

BigQuery + dbt

Key posts by id with the collection time, keep media and mentions in child tables, and store each run’s counts so you can follow a post as it spreads.

Read the setup
Copy a prompt for Claude
Prompt for Claude + Apify MCP
Inspect jmlp/x-twitter-scraper, then collect up to 200 Latest posts from the last 7 days that mention "apify". Group them by topic, quote the url of each example, and list the five posts with the most replies. Treat likes and views as reach, not agreement, and do not guess at who the authors are.

The fields you’ll get.

Keep the collection time and original IDs with your records. You’ll need them to check where a result came from or compare it with a later run.

Before you draw conclusions

X’s search is a sample, not an archive, and it leaves some posts out, especially from new or low-quality accounts. Likes and views keep moving after you collect them, so compare runs taken at the same point in a post’s life. Each account the scraper signs in with may read only so much every 15 minutes, so a big search can pause and wait.

id / url / created_at
The post’s ID, its page on x.com and when it was posted.
text / lang
The full text, long posts included, and its language.
like_count / repost_count / reply_count / view_count
Engagement as X showed it when the post was collected.
author
Username, name, bio, followers and verification of the account that posted.
media / urls / hashtags / mentions
Photos and videos with their best MP4, links, hashtags and mentioned accounts.
quoted_post / reposted_post / in_reply_to_id
The post it quotes or reposts in full, and the one it replies to.

Common questions.

Do I need an X account or an API key?

No. The scraper signs in to X with accounts of its own, each on a fixed IP. You need an Apify account to run it there, or a JMLP account to run it on app.jmlp.dev.

Can I use my own X accounts?

Yes. Paste each account’s auth_token and ct0 cookies into Your own X accounts, one account per line, and the run uses yours alone. On app.jmlp.dev you save them once on the scraper’s page, and those runs go through your own proxies. The price per post is the same.

Source and current product details: JMLP’s X (Twitter) Actor on Apify.

Need a scraper or a pipeline built for you?

Send me the sites you’re interested in and the question behind them. I’ll tell you whether scraping is the right way to answer it, and what it would take.