Tweepy
Python client library for the Twitter/X API v2 (and legacy v1.1), handling OAuth authentication, rate limit management, pagination, and streaming.
Score Breakdown
⚙ Agent Friendliness
🔒 Security
Credentials passed at instantiation risk accidental logging; recommend environment variable injection. OAuth scopes are defined at Twitter app level, not per-request.
⚡ Reliability
Best When
You need a battle-tested, well-maintained Python wrapper around the Twitter/X API v2 with built-in pagination, streaming, and OAuth handling.
Avoid When
You only need simple one-off HTTP calls to the Twitter API and don't want to manage OAuth token lifecycle or install a dependency.
Use Cases
- • Fetching recent tweets or user timelines for sentiment analysis or monitoring pipelines
- • Posting tweets, threads, or replies programmatically from an agent workflow
- • Streaming live tweets matching keywords or hashtags for real-time event detection
- • Looking up user profiles, follower graphs, or engagement metrics for social analytics
- • Searching historical tweets with full-archive search for trend research and datasets
Not For
- • Direct message scraping at scale — Twitter API v2 has strict DM rate limits and restricted access tiers
- • Anonymous or unauthenticated Twitter access — all endpoints require OAuth credentials tied to a Twitter developer app
- • High-volume commercial data extraction — Twitter's ToS and API tier limits make bulk collection expensive and restricted
Interface
Authentication
Requires a Twitter Developer App with API keys. OAuth 1.0a User Context for read/write on behalf of users; OAuth 2.0 App-Only Bearer Token for read-only public data. Credentials stored in environment variables or passed at client instantiation.
Pricing
Tweepy is MIT licensed and free; costs come from Twitter/X API subscription tiers
Agent Metadata
Known Gotchas
- ⚠ wait_on_rate_limit=True silently sleeps the thread — agents need async alternatives or explicit rate limit handling to avoid blocking
- ⚠ Twitter API v2 expansions (author_id, attachments) must be explicitly requested or related objects are missing from responses
- ⚠ OAuth 1.0a token refresh is not automatic — agents must handle token expiry and re-authentication flows manually
- ⚠ Duplicate tweet errors (403) look identical to permission errors, making retry logic difficult to implement correctly
- ⚠ Paginator returns a generator that exhausts on first iteration — agents must collect results or risk missing data on second pass
Alternatives
Full Evaluation Report
Comprehensive deep-dive: security analysis, reliability audit, agent experience review, cost modeling, competitive positioning, and improvement roadmap for Tweepy.
AI-powered analysis · PDF + markdown · Delivered within 30 minutes
Package Brief
Quick verdict, integration guide, cost projections, gotchas with workarounds, and alternatives comparison.
Delivered within 10 minutes
Score Monitoring
Get alerted when this package's AF, security, or reliability scores change significantly. Stay ahead of regressions.
Continuous monitoring
Scores are editorial opinions as of 2026-03-07.