Skip to content

Twitter/X Scraping with twscrape

Lets the agent write code that pulls tweets, profiles and followers from Twitter/X via a rotating pool of accounts

Stars
23,127
Licence
MIT
Files
4 files

What it does

This skill teaches the agent how to use twscrape, a Python library that collects public data from Twitter/X (searches, user profiles, followers, tweet replies, trends) by calling Twitter's internal GraphQL web API. It explains how to add logged-in accounts, rotate between them to handle rate limits, and set proxies, so the agent can write working scraping scripts or run the twscrape command-line tool for you.

Great for

  • Developers building social media monitoring or analytics tools who need Twitter/X data
  • Data analysts collecting tweets or follower lists for research at scale
  • People looking for an alternative to the official paid Twitter API for scraping

Skip it if

  • Anyone wanting official, policy-compliant access: this scrapes an unofficial interface and can break when Twitter changes it or get accounts suspended
  • Collecting private data or other people's personal information without a lawful basis, since the skill is built for bulk collection of profiles and followers
  • Users without Python who just want a simple one-off lookup; setup requires Python, pip and real Twitter/X login accounts

Try asking

  • “Write a Python script that searches Twitter/X for 'climate policy' and saves the latest 200 tweets to a CSV”
  • “Get the follower list and profile info for a given Twitter username using twscrape”
  • “Set up twscrape with three of my accounts and a proxy, then show me how to check account status”
  • “Fetch replies and retweeters for a specific tweet ID and summarize the reactions”
Step-by-step guide: how to use Twitter/X Scraping with twscrapeInstall, first run, examples, tips and FAQs

Install in 3 steps

  1. 1

    Download the skill

    The ZIP contains the 4 original files, the MIT licence and an attribution note.

    twscrape.zip
  2. 2

    Add it to your agent

    Claude Code (all projects)

    mkdir -p ~/.claude/skills && unzip twscrape.zip -d ~/.claude/skills/

    Claude Code / Agent SDK (this project only)

    mkdir -p .claude/skills && unzip twscrape.zip -d .claude/skills/

    Claude apps (web/desktop): Settings → Capabilities → Skills → Upload skill, and choose the ZIP.

  3. 3

    Ask for the task

    No special command needed — the agent reads the skill's description and loads it when your request matches. Try one of the prompts above.

Get better results

  • Use cookie-based account login rather than password login, which the skill describes as more stable; keep cookies and credentials out of shared code.
  • Start with small limit values (for example 20) to test before running large collections, to reduce rate-limit and account-ban risk.
  • Review the generated script before running it, and confirm you have a lawful basis and Twitter/X terms-compatible use for the data you collect.

What's inside

  • references/examples.md
  • references/index.md
  • references/installation.md
  • SKILL.md

Redistributed unmodified from 2025Emma/vibe-coding-cn under the MIT licence. The assessment was drafted with AI from the skill's files on 2026-10-29. Skills can instruct your agent to run code — read SKILL.md and any scripts before installing.