Twitter Keywords Scraper avatar

Twitter Keywords Scraper

Pricing

from $1.00 / 1,000 results

Go to Apify Store
Twitter Keywords Scraper

Twitter Keywords Scraper

Extract tweets from Twitter/X based on keywords. Scrapes tweet text, usernames, engagement metrics, media, and timestamps for multiple search terms.

Pricing

from $1.00 / 1,000 results

Rating

5.0

(26)

Developer

Crawler Bros

Crawler Bros

Maintained by Community

Actor stats

22

Bookmarked

75

Total users

8

Monthly active users

5 days ago

Last modified

Share

Search Twitter / X by keyword or hashtag and pull tweets with full engagement metrics, media, hashtags, mentions, and author info. The simplest way to track keywords on X without using the official API.

Need date ranges, language filters, engagement thresholds, or conversation-thread scraping? Use Twitter Keywords Scraper Pro for the full advanced filter set.

Twitter session cookies are required — see Authentication below.

What you get

For each tweet the scraper returns:

FieldDescription
tweet_idTweet ID
tweet_urlDirect tweet URL
keywordSearch keyword that found this tweet
textFull tweet text (with hashtags / mentions intact)
author_nameAuthor display name
author_usernameAuthor handle (without @)
timestampISO 8601 timestamp the tweet was posted
replies_countReply count
retweets_countRetweet count
likes_countLike count
bookmarks_countBookmark count
views_countView count
media_urlsArray of media objects — `{ type: image
hashtagsArray of hashtags used (without #)
mentionsArray of mentioned users (without @)
urlsExternal URLs in the tweet
scraped_atISO 8601 UTC timestamp of extraction

Empty fields are dropped so the dataset stays clean.

Input

ParameterTypeDefaultDescription
keywordsArrayrequiredKeywords, phrases, or hashtags to search. Each runs as a separate search.
maxTweetsInteger20Max tweets per keyword (1-1000).
searchTypeEnumTopTop (most relevant) or Latest (chronological).
cookiesStringrequiredTwitter/X session cookies in JSON format. See Authentication.

Example input — minimal

{
"keywords": ["artificial intelligence"],
"maxTweets": 50,
"cookies": "[{\"name\":\"auth_token\",\"value\":\"YOUR_TOKEN\",\"domain\":\".x.com\"}]"
}

Example input — multiple keywords

{
"keywords": ["#AI", "machine learning", "ChatGPT"],
"maxTweets": 100,
"searchType": "Latest",
"cookies": "[...]"
}

Example output

{
"tweet_id": "1881234567890123456",
"tweet_url": "https://x.com/elonmusk/status/1881234567890123456",
"keyword": "artificial intelligence",
"text": "AI will change everything in the next 10 years.",
"author_name": "Elon Musk",
"author_username": "elonmusk",
"timestamp": "2026-04-20T14:32:00.000Z",
"replies_count": 1200,
"retweets_count": 8500,
"likes_count": 42000,
"bookmarks_count": 3100,
"views_count": 9800000,
"hashtags": [],
"mentions": [],
"urls": [],
"media_urls": [],
"scraped_at": "2026-05-05T13:42:18Z"
}

Authentication

Twitter/X locks search results behind a login wall. The cookies input is a JSON array of your browser cookies for x.com.

How to export your cookies

  1. Log into x.com in Chrome or Firefox.
  2. Install the Cookie-Editor extension.
  3. Click the extension icon → Export → Export as JSON.
  4. Paste the JSON array into the cookies input field.

auth_token and ct0 are the two cookies that must be present. Cookies typically last 30-60 days before they need refreshing.

[
{ "name": "auth_token", "value": "YOUR_AUTH_TOKEN", "domain": ".x.com", "path": "/", "httpOnly": true, "secure": true },
{ "name": "ct0", "value": "YOUR_CT0_VALUE", "domain": ".x.com", "path": "/", "httpOnly": false, "secure": true }
]

Keep your cookies private — they grant access to your X account.

Use cases

  • Brand monitoring — Track real-time mentions of your brand or product.
  • Competitive research — Monitor competitor keywords and hashtags.
  • Trend analysis — Capture viral content as it emerges.
  • Hashtag campaign tracking — Measure reach for branded campaign hashtags.
  • News monitoring — Pull tweets about breaking news topics.

FAQ

Why are cookies required? Twitter/X locks search results behind a login wall. Without valid cookies, search returns either nothing or a curated old-tweets feed.

My results look stale or limited — what's wrong? Either your cookies have expired or you're hitting a rate limit. Re-export fresh cookies and retry. If results stay limited, lower maxTweets and run multiple passes.

Top vs Latest — which should I use? Use Top for high-engagement, evergreen content. Use Latest for real-time chronological monitoring (news, breaking events, brand mentions).

What's the maximum I can scrape per keyword? Up to 1000 tweets per keyword per run, capped by Twitter's search index depth.

What if every search returns zero tweets? The actor emits a single sentinel record with type: "twitter_keywords_blocked" and a clear reason (e.g. expired_cookies) so the run exits cleanly with a non-empty dataset and you know what to fix.

Will my account get banned? The actor uses random delays and human-like behavior. Risk is low for typical usage. Use a dedicated account if you're running large workloads.

Do I need a proxy? No. Proxy is off by default. Enable it only if you encounter persistent IP-based blocks from your hosting region.

How current is the data? Live — every run queries Twitter/X at request time. Schedule the actor for hourly or daily refreshes.

Need advanced filters (date range, language, engagement thresholds, conversation threads)? Use Twitter Keywords Scraper Pro — same data shape, extended input options.

Limitations

  • Twitter/X search index depth varies; very old tweets may not be retrievable.
  • Protected (private) accounts are excluded unless you authenticate with cookies from a follower.
  • Cookies expire — refresh every ~30-60 days.
  • Engagement counts for very old tweets may differ slightly from the official API.