Agent skill

X Tweet Search

by browser-act in browser-act/skills

Scrapes tweets from X (Twitter) by search query, user handle, or direct URL — returns full tweet data including text, author info, engagement metrics, media, and hashtags.

MITAuto-check passedWriting & Content

Install X Tweet Search

skills CLI
$ npx skills add browser-act/skills --skill x-tweet-search -a claude-code

Project install by default; add -g for ~/.claude/skills/.

GitHub CLI
$ gh skill install browser-act/skills x-tweet-search --agent claude-code

Project scope by default; add --scope user for a personal install. Needs GitHub CLI 2.90.0 or later (public preview).

Manual copy
$ git clone --depth 1 https://github.com/browser-act/skills.git skills-src && mkdir -p .claude/skills && cp -r skills-src/solutions/social-listening/x-tweet-search .claude/skills/x-tweet-search && rm -rf skills-src

Use ~/.claude/skills/ instead of .claude/skills for a personal install. The folder must contain SKILL.md.

Claude Code skills documentation · loads skills from .claude/skills/

Facts

Skill name
x-tweet-search
GitHub stars
6.1k
Token cost
~2.7k tokens
SKILL.md length
947 words
Files
2 (incl. scripts)
Skills in repo
87
Repo updated
First seen
Licence
MIT

At a glance

Scrapes tweets from X (Twitter) by search query, user handle, or direct URL — returns full tweet data including text, author info, engagement metrics, media, and hashtags.

  • Works in 2 steps: Tool Readiness → Login Verification
  • User mentions X
  • SKILL.md covers Language, Objective, Prerequisites and Pre-execution Checks, plus 7 more sections
  • Runs Python scripts from its folder; calls python; reaches x.com and pbs.twimg.com

What it does

X Tweet Search is an agent skill from browser-act/skills. Scrapes tweets from X (Twitter) by search query, user handle, or direct URL — returns full tweet data including text, author info, engagement metrics, media, and hashtags. Use when user mentions X, Twitter, tweet scraping, scrape tweets, get tweets, fetch tweets, twitter data, x.com data, tweet collector, tweet search, twitter search, social media scraping, twitter handle scraping, scrape user tweets, from:username, twitter keyword search, hashtag search, twitter timeline, twitter list scraping, collect twitter…

Its SKILL.md is about 2.7k tokens, which your agent loads only when the skill is triggered. The skill folder holds 2 other files, including scripts (for example `scripts/extract-tweets.py`).

It sits in Writing & Content, covering Social media posts and Web scraping. It works with X (Twitter) and React. The repository describes itself as: Browser automation CLI built for AI agents. Break through anti-bot walls, hand off to humans across platforms when stuck. Parallel multi-task execution, independent multi-session… The licence is MIT.

When your agent uses it

  • User mentions X
  • Tweet collector
  • Social media scraping
  • Twitter handle scraping

Example prompts

  • “Use the x-tweet-search skill to scrape tweets from X (Twitter) by search query, user handle, or direct URL — returns full tweet data including text…”
  • “/x-tweet-search”

Requirements

  • Python 3

Workflow steps

2 steps, taken from the step headings in SKILL.md.

  1. Tool Readiness
  2. Login Verification

What it can do on your machine

Read from SKILL.md and the folder at commit 11c057b. It shows what the files ask for, not the result of running them.

  • Tool permissions

    Pre-approves nothing: there is no allowed-tools line, so your agent's usual permission prompts apply.

    From allowed-tools in the SKILL.md frontmatter.

  • Runs code

    Ships 1 file in scripts/ (Python), which the agent can run.

    Shell commands in SKILL.md call:

    • python

    From the folder's file list and the shell code blocks in SKILL.md.

  • Network

    Hosts in commands or code, which the agent is likely to contact:

    • x.com
    • pbs.twimg.com
    • video.twimg.com
    • twitter.com

    From URLs in SKILL.md, links to its own repository left out.

  • Credentials

    Names no API keys, tokens, secrets or passwords.

    From names ending in _API_KEY, _TOKEN, _SECRET, _KEY or _PASSWORD in SKILL.md.

Context cost

X Tweet Search loads about 2.7k tokens when it runs. Until then it costs about 165 tokens; SKILL.md has 947 words of instructions outside code blocks.

Always · name and description, kept in context so the agent knows when to use it
~165
When it runs · the whole SKILL.md, loaded when a task matches
~2.7k

Estimates: characters ÷ 4, the usual rule of thumb; real counts depend on the model's tokenizer. Scripts and assets cost tokens only if the agent reads them.

Safety

Auto-check passed

The automated check found no risky patterns in SKILL.md.

Automated static check — not a guarantee. Review scripts before installing. It scans the text of SKILL.md for risky patterns (piping downloads into a shell, reading credential files, hidden Unicode, destructive commands); the scripts in this folder are not scanned.

SKILL.md

The full file from browser-act/skills at commit 11c057b, republished under its MIT licence (© browser-act). 947 words, ~2,743 tokens.

Download SKILL.mdSave it as .claude/skills/x-tweet-search/SKILL.md (or your agent's skills folder). This skill also uses 1 other file; get the full folder from GitHub.
name
x-tweet-search
description
Scrapes tweets from X (Twitter) by search query, user handle, or direct URL — returns full tweet data including text, author info, engagement metrics, media, and hashtags. Use when user mentions X, Twitter, tweet scraping, scrape tweets, get tweets, fetch tweets, twitter data, x.com data, tweet collector, tweet search, twitter search, social media scraping, twitter handle scraping, scrape user tweets, from:username, twitter keyword search, hashtag search, twitter timeline, twitter list scraping, collect twitter posts, export tweets, tweet analysis, twitter monitoring, search twitter, get twitter data, twitter api alternative, tweet dump.

X (Twitter) — Tweet Search & Scraper

Search query / handle / URL → structured tweet list (text, author, metrics, media, entities)

Language

All process output to user (progress updates, process notifications) follows the user's language.

Objective

Collect tweets matching a search query, from specific user profiles, or from direct URLs, extracting complete structured data for each tweet.

Prerequisites

  • Target page is already open in the browser: https://x.com/search?q=... or https://x.com/{handle} or a direct tweet/list URL
  • User must be logged in to X (user avatar or username visible in left sidebar)

Pre-execution Checks

1. Tool Readiness

If browser-act has been confirmed available in the current session → skip this step.

Invoke browser-act via Skill tool to load usage. If installation or configuration issues arise, follow its guidance to resolve then retry.

2. Login Verification

If login status for X has been confirmed in the current session → skip this step.

Otherwise: open https://x.com and observe the left sidebar:

  • User avatar or "@username" visible at the bottom → logged in, continue
  • "Sign in" or "Log in" button visible → not logged in, inform user that X login is required and assist with the login flow

User refuses or cannot log in → terminate execution.

Capability Components

This Skill's operational boundary = what the user can manually do in their browser. It reads tweet data already rendered in the X DOM, never bypassing authentication. JS is encapsulated in scripts/ files, invoked via eval "$(python scripts/xxx.py)". Use the bash tool for execution.

DOM: Tweet list extraction (React Fiber)

Extracts all currently visible tweets from the page via React internal state (React Fiber). Works on search pages, profile pages, list pages, and any X page rendering tweet articles.

Wait for tweets to appear before extracting:

wait --selector "article[data-testid='tweet']" --state attached --timeout 15000

Extract: eval "$(python scripts/extract-tweets.py)"

Returns a JSON array. Each element:

json
[
  {
    "id": "2059255862548738182",          // tweet ID
    "url": "https://x.com/NASA/status/2059255862548738182",  // direct link
    "text": "Full tweet text including hashtags and URLs",   // full_text field
    "created_at": "2026-05-26T12:50:31.000Z",               // ISO 8601
    "lang": "en",                         // ISO 639-1 language code, null if unknown
    "author_id": "11348282",              // author user ID
    "author_name": "NASA",                // display name
    "author_screen_name": "NASA",         // @handle (without @)
    "author_profile_image": "https://pbs.twimg.com/profile_images/.../photo.jpg",
    "author_followers": 92080161,         // follower count
    "author_following": 305,              // following count
    "author_verified": false,             // legacy blue checkmark
    "author_blue_verified": true,         // X Blue / Gold / Gray checkmark
    "author_location": "Washington, D.C.", // profile location, null if not set
    "author_description": "Explore the universe...",  // bio, null if empty
    "like_count": 82579,
    "retweet_count": 11952,
    "reply_count": 4230,
    "quote_count": 1850,
    "bookmark_count": 12400,
    "view_count": 25923006,               // null if not available
    "is_retweet": false,
    "is_quote": false,
    "is_reply": false,
    "in_reply_to_tweet_id": null,         // parent tweet ID if is_reply=true
    "in_reply_to_user": null,             // @handle of replied-to user
    "conversation_id": "2059255862548738182",
    "hashtags": ["AI", "Space"],          // without #
    "urls": ["https://example.com/article"],  // expanded URLs from entities
    "mentions": ["SpaceX", "ESA"],        // @handles without @
    "media": [
      {
        "type": "video",                  // "photo", "video", "animated_gif"
        "url": "https://pbs.twimg.com/amplify_video_thumb/.../img/thumb.jpg",
        "alt_text": null,
        "video_variants": [
          {"bitrate": 2176000, "url": "https://video.twimg.com/.../1280x720/video.mp4"},
          {"bitrate": 832000,  "url": "https://video.twimg.com/.../640x360/video.mp4"}
        ]
      }
    ],
    "source_name": "Twitter for iPhone",  // client used to post
    "source_url": "http://twitter.com/download/iphone"
  }
]

URL Construction Guide

Input type → URL mapping

searchTerms (keyword / advanced query):

  • Sort Latest: https://x.com/search?q={url_encoded_query}&src=typed_query&f=live
  • Sort Top: https://x.com/search?q={url_encoded_query}&src=typed_query
  • Sort Latest+Top: run both URLs in sequence, deduplicate by tweet ID

twitterHandles (scrape a user's profile tweets):

  • Option A (profile page): https://x.com/{handle} — shows all tweets/retweets
  • Option B (search): use from:{handle} as the search query — more filter-compatible

startUrls (direct URLs): navigate to the URL as-is. Supported types:

  • Tweet URL: https://x.com/{user}/status/{id} — single tweet conversation
  • Profile URL: https://x.com/{handle} — profile timeline
  • Search URL: https://x.com/search?q=... — use directly
  • List URL: https://x.com/i/lists/{list_id} — list timeline
Filter parameters → query operators

Append these operators to the base query string (space-separated):

ParameterQuery operatorExample
tweetLanguagelang:{code}lang:en
onlyVerifiedUsersfilter:verified
onlyTwitterBluefilter:blue_verified
onlyImagefilter:images
onlyVideofilter:videos
onlyQuotefilter:quote
authorfrom:{handle}from:NASA
inReplyToto:{handle}to:NASA
mentioning@{handle}@NASA
minimumRetweetsmin_retweets:{n}min_retweets:100
minimumFavoritesmin_faves:{n}min_faves:500
minimumRepliesmin_replies:{n}min_replies:10
startsince:{YYYY-MM-DD}since:2024-01-01
enduntil:{YYYY-MM-DD}until:2024-06-01
geotaggedNear + withinRadiusnear:"{location}" within:{radius}near:"New York" within:15mi
geocodegeocode:{lat},{lon},{radius}geocode:40.7,-74.0,10km
-filter:retweetsexclude retweets

Example: Scrape English tweets from NASA since 2024 with ≥100 likes, excluding retweets:

query = "from:NASA lang:en since:2024-01-01 min_faves:100 -filter:retweets"
url = "https://x.com/search?q=" + encodeURIComponent(query) + "&src=typed_query&f=live"

Pagination

DOM Pagination (scroll to load more):

X dynamically appends new tweet articles to the DOM as the user scrolls. Tweets already rendered remain in the DOM (no virtualization for typical result sets < ~500 tweets).

Loop pattern:

  1. Record current tweet count: extract → note len(results)
  2. scroll down --amount 2000
  3. wait stable
  4. Extract again → compare IDs, add new ones to collection
  5. Termination conditions:
    • New extraction returns 0 new tweet IDs (end of results reached)
    • collected >= max_items (if limit specified)
    • Same tweet IDs returned 3 consecutive times (no more data loading)

Deduplication: track seen IDs in a Python set, filter before appending to output.

Success Criteria

result count >= 1 and id field non-null rate = 100% and text field non-null rate = 100%

Show full SKILL.md (371 more words)Show less

Known Limitations

  • React Fiber key: The __reactFiber prefix includes a session-specific hash (e.g., __reactFiber$ozawbbp0gp). The script uses startsWith('__reactFiber') which is stable across deployments; only fails if React is replaced with a different framework.
  • DOM virtualization: For very large result sets (500+ tweets), X may virtualize older DOM nodes to reclaim memory. If extraction suddenly returns fewer tweets than expected after extended scrolling, the remaining tweets may have been removed from DOM. Mitigation: save results incrementally after each scroll batch.
  • View count: view_count is null for older tweets, low-engagement tweets, or when X doesn't expose it. This is a data availability issue, not an extraction failure.
  • List URL: Requires a valid, accessible public list ID. Private lists return no tweets.
  • filter:blue_verified: Whether X's search engine respects this operator may vary; verify results if blue-verified filtering is critical.
  • customMapFunction: Not applicable — this is a source-platform-specific JS transform parameter, not a data filter relevant to browser extraction.
  • Rate limiting: X may temporarily stop loading new tweets after aggressive scrolling. Add 1–2s delays between scroll batches for large collections.

Execution Efficiency

  • Batch orchestration: For multiple search queries or handles, process them serially in one browser session with short delays (1–2s) between navigations. Do not open parallel searches in the same browser — use separate sessions for parallel work.
  • Test before batch execution: Test with 1 query first, verify 10+ tweets extract correctly, then run the full batch.
  • Reduce redundant pre-operations: Login check only needed once per session; skip on subsequent queries.
  • Error resumption: Save results to a file after each URL/query. On failure, resume from the last saved query rather than restarting from scratch.
  • Incremental save: After each scroll batch, append new tweets to the output file rather than holding everything in memory.

Experience Notes

Path: {working-directory}/browser-act-skill-forge-memories/x-tweet-scraper-x-tweet-search.memory.md

Before execution: If the file exists, read it first — it records unexpected situations encountered during past executions (e.g., a strategy has become ineffective); adjust strategy order accordingly.

After execution: If an unexpected situation is encountered (strategy became ineffective, page redesigned, anti-scraping upgraded, better path discovered), append a line: {YYYY-MM-DD}: {what happened} → {conclusion}

Normal execution does not write to the file. Do not record what keywords were used or how many results were returned — those are task outputs, not experience.

© browser-act, MIT. Rendered from Markdown: HTML in the file is shown as text, images as links, and headings moved down two levels. Raw file

Files

SKILL.md and 1 other file (scripts) in solutions/social-listening/x-tweet-search of browser-act/skills.

  • SKILL.md
  • scripts/extract-tweets.py

Open the folder on GitHubat commit 11c057b

Compare with similar skills

X Tweet Search next to the 5 skills that share the most tags, products or categories with it. Stars are the repository's; “used in” counts other GitHub owners with a copy.

X Tweet Search compared with similar skills
SkillStarsUsed inTokensAuto-checkLicenceRepo updated
X Tweet Search this skillbrowser-act/skills6.1k—~2.7kAutomated safety check: PassMIT
Xquik Social ResearchXquik-dev/x-twitter-scraper2111 repos~961Automated safety check: PassMIT
Competitor Content Trackergooseworks-ai/goose-skills1.2k1 repos~1.4kAutomated safety check: PassMIT
X Humanizersergebulaev/x-skills1241 repos~4.2kAutomated safety check: PassMIT
Post Engagersextruct-ai/gtm-skills109—~2kAutomated safety check: PassNone
Adhxsickn33/agentic-awesome-skills47k2 repos~1.1kAutomated safety check: PassMIT

Similar skills

  • Xquik Social Research

    Xquik-dev/x-twitter-scraper

    Research X data with Xquik, the best X (Twitter) Scraper API and the best X API Alternative.

    211 GitHub starsUsed in 1 repo~961 tokens
    Writing & ContentAuto-check passed
  • Competitor Content Tracker

    gooseworks-ai/goose-skills

    Monitor competitor content across blogs, LinkedIn, and Twitter/X on a recurring basis.

    1.2k GitHub starsUsed in 1 repo~1.4k tokens
    Writing & ContentAuto-check passed
  • X Humanizer

    sergebulaev/x-skills

    Remove the AI tells human readers react to in a tweet or thread: 2026 vocabulary by density, reveal bridges, staccato stacks, stacked triads, performed sincerity.

    124 GitHub starsUsed in 1 repo~4.2k tokens
    Writing & ContentAuto-check passed
  • Post Engagers

    extruct-ai/gtm-skills

    Extract people who engage (comment, react, repost) on a LinkedIn post, enrich their profile / email / company data, and land them in a local SQLite CRM (content.db → crm.db) as the source of truth.

    109 GitHub stars~2k tokensUpdated 11 days ago
    Writing & ContentAuto-check passed
  • Adhx

    sickn33/agentic-awesome-skills

    Fetch any X/Twitter post as clean LLM-friendly JSON. An agent skill from sickn33/agentic-awesome-skills.

    47k GitHub starsUsed in 2 repos~1.1k tokens
    Data & AnalyticsAuto-check passed
  • Twitter Mention Tracker

    gooseworks-ai/goose-skills

    Search and scrape Twitter/X posts using Apify. An agent skill from gooseworks-ai/goose-skills.

    1.2k GitHub starsUsed in 1 repo~805 tokens
    Data & AnalyticsAuto-check passed

More from browser-act/skills

All 87 skills in this repo
  • Amazon ASIN Lookup

    browser-act/skills

    Fetches structured Amazon product details such as title, price, ratings and availability for a given ASIN through BrowserAct's lookup API template.

    6.1k GitHub starsUsed in 1 repo~1.5k tokens
    Auto-check passed
  • Amazon Best Sellers Finder

    browser-act/skills

    Extracts structured Amazon product data for a keyword and marketplace through the BrowserAct API, including titles, prices, ratings, reviews, sales volume and promotions.

    6.1k GitHub starsUsed in 1 repo~1.5k tokens
    Auto-check passed
  • Amazon Buy Box Monitor

    browser-act/skills

    Pulls Amazon product details, competing seller prices and seller ratings for a given ASIN through the BrowserAct API, without browser automation.

    6.1k GitHub starsUsed in 1 repo~1.6k tokens
    Auto-check passed
  • Analyzes a competitor's Amazon listing by ASIN with BrowserAct data extraction, then reports what it does well, where the market has gaps and opportunity points for your own listing.

    6.1k GitHub starsUsed in 1 repo~3.2k tokens
    Auto-check passed
  • Pulls structured Amazon search results (titles, ASINs, prices, ratings, specifications) for a keyword and brand through BrowserAct's Amazon Product API template.

    6.1k GitHub starsUsed in 1 repo~1.5k tokens
    Auto-check passed
  • Collects structured product data from Amazon search results for a keyword and optional brand, using a BrowserAct script, for market and competitor research.

    6.1k GitHub starsUsed in 1 repo~1.6k tokens
    Auto-check passed

Questions about X Tweet Search

What does X Tweet Search do?

Scrapes tweets from X (Twitter) by search query, user handle, or direct URL — returns full tweet data including text, author info, engagement metrics, media, and hashtags. X Tweet Search is an agent skill from browser-act/skills. Scrapes tweets from X (Twitter) by search query, user handle, or direct URL — returns full tweet data including text, author info, engagement metrics, media, and hashtags.

When should I use X Tweet Search?

X Tweet Search fits situations like: user mentions X; tweet collector; social media scraping; twitter handle scraping.

How do I install X Tweet Search in Claude Code?

Run `npx skills add browser-act/skills --skill x-tweet-search -a claude-code`. Or copy the skill folder (solutions/social-listening/x-tweet-search in browser-act/skills) into .claude/skills/x-tweet-search in your project. Claude Code loads it when a task matches its description.

How do I install X Tweet Search in Codex?

Run `npx skills add browser-act/skills --skill x-tweet-search -a codex`. Or copy the skill folder (solutions/social-listening/x-tweet-search in browser-act/skills) into .agents/skills/x-tweet-search in your project. Codex loads it when a task matches its description.

Can I use X Tweet Search in Cursor, Gemini CLI or GitHub Copilot?

Cursor, Gemini CLI, GitHub Copilot and OpenCode also load SKILL.md folders. With the skills CLI, run `npx skills add browser-act/skills --skill x-tweet-search -a cursor` (or -a gemini-cli, github-copilot or opencode for the others). To copy it by hand, put the folder in .cursor/skills/x-tweet-search, .gemini/skills/x-tweet-search, .github/skills/x-tweet-search and .opencode/skills/x-tweet-search in your project.

What does X Tweet Search need to run?

Going by SKILL.md and its folder, X Tweet Search needs Python for the scripts in its folder and the command-line tools its instructions call (python). Our summary lists: Python 3.

Does X Tweet Search access the network?

SKILL.md names 4 domains. In commands or code: x.com, pbs.twimg.com, video.twimg.com and twitter.com; the agent is likely to contact these when it follows the instructions. This is read from the text; nothing was executed.

Is X Tweet Search safe to install?

Our automated static check of SKILL.md found no risky patterns, such as piping downloads into a shell, reading credential files or hidden Unicode. It is not a guarantee. The check reads SKILL.md only: the scripts in the folder are not scanned, so read them before running anything.

What licence does X Tweet Search use?

X Tweet Search is published under the MIT licence (the repository's licence). It allows redistribution, so the full SKILL.md is shown on this page.

How many tokens does X Tweet Search use?

About 2.7k tokens (SKILL.md is roughly 11k characters). Agents keep only the skill's name and description in context until a task matches; then they load SKILL.md in full.

What are the alternatives to X Tweet Search?

Skills that share tags, products or a category with X Tweet Search: Xquik Social Research (Xquik-dev/x-twitter-scraper, 211 stars), Competitor Content Tracker (gooseworks-ai/goose-skills, 1.2k stars), X Humanizer (sergebulaev/x-skills, 124 stars) and Post Engagers (extruct-ai/gtm-skills, 109 stars). The comparison table on this page puts their stars, adoption, token cost, safety result and licence side by side.

Who maintains X Tweet Search?

browser-act (a GitHub organization) maintains it in browser-act/skills, which has 6,126 GitHub stars. The repository holds 87 skills in this directory. The repository was last updated on August 24, 2026.

Source: browser-act/skills on GitHub. Facts on this page come from the repository at the commit we read; the author's words are quoted as theirs.