Skip to content
Skillpedia
Social media6.3k Β· #14321

x-tweet-search-by-query

What it does

This skill runs advanced X searches and returns the tweets that match your query. It is for researchers, marketers and journalists who want tweets on a topic within a set time period.

When to use it

  • βœ“When you want to find tweets about a topic within a date range.
  • βœ“When you need tweets that use a hashtag or a set of keywords.
  • βœ“When you want to collect a large set of tweets for analysis.

Skill link

https://github.com/browser-act/skills/blob/main/solutions/social-listening/x-tweet-search-by-query/SKILL.md

Copy it and paste it into your AI (Claude, ChatGPT or Cursor), asking it to follow the instructions.

How to use

The easiest way: copy the message and paste it into your AI. It reads the skill and follows the instructions.

Ready-to-paste message

Use this skill to help me: https://github.com/browser-act/skills/blob/main/solutions/social-listening/x-tweet-search-by-query/SKILL.md Read the SKILL.md file at that link and follow its instructions for my task.
Want your AI to find skills like this on its own?Install the free Skillpedia MCP: one line, and it searches 15,000+ skills before each task.Install in 1 minute β†’

Example of what to ask your AI

β€œFind tweets about solar panels posted between January and March this year, and show their text and like counts.”

5 new skills a week. 1 minute to read.

How it works

The skill enters your advanced search query in X and reads the matching tweets. It returns each tweet with its text, author profile, engagement counts, media, hashtags, mentions and a cursor for paging.

Technical content (original SKILL.md)

Original text by the author, straight from GitHub.

X β€” Tweet Search by Query

Advanced search query β†’ normalized list of tweets matching the query (with author, engagement, media, cursor).

Language

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

Objective

Collect tweets that match an X advanced-search query expression, returning structured per-tweet data and pagination cursors for unbounded bulk collection.

Prerequisites

  • Active X session in the browser (left sidebar shows logged-in avatar / @handle).
  • Network capture is enabled in the browser-act session.

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 @handle visible at the bottom β†’ logged in, continue
  • "Sign in" / "Log in" prompt visible β†’ not logged in, inform the user that an X login is required and assist 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 only reads tweet data rendered by the user's own X session, never bypassing authentication. Each search request is signed by X's own page JS; the Skill triggers it via URL navigation and reads structured GraphQL responses from network traffic. Python scripts under scripts/ only build URLs and parse responses β€” they do not call X directly. Run them through the bash tool.

Network Capture: search tweets via advanced query

All search parameters are encoded into X's native advanced search syntax via the URL builder, then injected through the page URL. The browser's own JS signs the GraphQL request; the response is read from network traffic and parsed locally.

Step 1 β€” build the search URL with all desired filters:

URL=$(python scripts/build-search-url.py '{raw_query}' --sort {sort} [--language {iso}] [--min-retweets {n}] [--min-faves {n}] [--min-replies {n}] [--since YYYY-MM-DD] [--until YYYY-MM-DD] [--author {handle}] [--in-reply-to {handle}] [--mentioning {handle}] [--only-verified] [--only-blue-verified] [--only-image] [--only-video] [--only-quote] [--exclude-retweets] [--exclude-replies] [--geocode LAT,LON,RADIUSmi] [--near 'PLACE'] [--within 15mi])

Parameters:

  • raw_query (positional): free-form X advanced search expression; all standard operators are supported and may already include any clause below. Operators added via flags are skipped if the same operator is already present in raw_query.
  • --sort: Latest (default) or Top. Maps to URL f=live and f=top, which select GraphQL product=Latest vs product=Top.
  • --language: ISO 639-1 code, appended as lang:CODE.
  • --min-retweets / --min-faves / --min-replies: integer thresholds, appended as min_retweets:N / min_faves:N / min_replies:N.
  • --since / --until: YYYY-MM-DD, appended as since: / until:.
  • --author: only tweets from this handle, appended as from:HANDLE.
  • --in-reply-to: only tweets replying to this handle, appended as to:HANDLE.
  • --mentioning: only tweets mentioning this handle, appended as @HANDLE.
  • --only-verified / --only-blue-verified: appended as filter:verified / filter:blue_verified.
  • --only-image / --only-video / --only-quote: appended as filter:images / filter:native_video / filter:quote.
  • --exclude-retweets / --exclude-replies: appended as -filter:retweets / -filter:replies.
  • --geocode: LAT,LON,RADIUSmi or LAT,LON,RADIUSkm, appended as geocode:LAT,LON,RADIUS.
  • --near / --within: appended as near:"PLACE" and within:VALUE.

Step 2 β€” navigate and capture the first page:

  1. network requests --clear
  2. navigate "$URL"
  3. wait stable --timeout 25000 (a timeout is normal on X; proceed even if it fires β€” the GraphQL response usually completes before the page reaches network-idle)
  4. network requests --type xhr,fetch --filter SearchTimeline β†’ take the latest entry's request_id
  5. network request <request_id> β†’ save full output to a file (e.g. tmp/x-search-page-1.txt)
  6. python scripts/parse-tweets.py --json-file tmp/x-search-page-1.txt --source search β†’ emit
FAQ

Can I search by date?

Yes, the description says advanced queries can use since and until date filters.

Do I need to be logged in?

Yes, the skill needs an active X session in your browser.

Can I collect many results?

Yes, the cursor lets you page through results for larger collections.

Details

Original description by the author

Searches X (Twitter) for tweets by free-form advanced query and returns a normalized tweet list with text, author profile, engagement counts, media, hashtags, mentions, and cursor for pagination. Use when user mentions X search, Twitter search, scrape tweets by keyword, search X by hashtag, search Twitter by hashtag, find tweets about a topic, search tweets by date range, since until search Twitter, advanced Twitter search, tweets with media, tweets with images, tweets with video, top tweets, latest tweets, X latest tab, X top tab, min_faves, min_retweets, min_replies, filter verified Twitter,

repo: browser-act/skills

Popularity

GitHub stars
6.3k
Ranking position
#14321
License
MIT
Updated
8/24/2026

Is this skill useful?

0

Sign in to vote.

Comments

  • …

More skills from this repository

Similar skills