Tweepy

Python client library for the Twitter/X API v2 (and legacy v1.1), handling OAuth authentication, rate limit management, pagination, and streaming.

Evaluated Mar 07, 2026 (0d ago) v4.x
Homepage ↗ Repo ↗ Developer Tools python library twitter x social-media api-client oauth
⚙ Agent Friendliness
59
/ 100
Can an agent use this?
🔒 Security
84
/ 100
Is it safe for agents?
⚡ Reliability
76
/ 100
Does it work consistently?

Score Breakdown

⚙ Agent Friendliness

MCP Quality
--
Documentation
85
Error Messages
80
Auth Simplicity
65
Rate Limits
80

🔒 Security

TLS Enforcement
95
Auth Strength
85
Scope Granularity
80
Dep. Hygiene
82
Secret Handling
78

Credentials passed at instantiation risk accidental logging; recommend environment variable injection. OAuth scopes are defined at Twitter app level, not per-request.

⚡ Reliability

Uptime/SLA
70
Version Stability
82
Breaking Changes
72
Error Recovery
80
AF Security 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

REST API
No
GraphQL
No
gRPC
No
MCP Server
No
SDK
Yes
Webhooks
No

Authentication

Methods: oauth1a oauth2_bearer
OAuth: Yes Scopes: Yes

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

Model: open_source
Free tier: Yes
Requires CC: No

Tweepy is MIT licensed and free; costs come from Twitter/X API subscription tiers

Agent Metadata

Pagination
cursor
Idempotent
Partial
Retry Guidance
Documented

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

$99

Package Brief

Quick verdict, integration guide, cost projections, gotchas with workarounds, and alternatives comparison.

Delivered within 10 minutes

$3

Score Monitoring

Get alerted when this package's AF, security, or reliability scores change significantly. Stay ahead of regressions.

Continuous monitoring

$3/mo

Scores are editorial opinions as of 2026-03-07.

6470
Packages Evaluated
26150
Need Evaluation
173
Need Re-evaluation
Community Powered