Twikit is a Python library that talks to Twitter's internal APIs via scraping, so you can post, search, and similar actions without a developer API key. It exposes an async Client for login and operations
Overview
Twikit provides a Python interface for interacting with Twitter when you do not want or cannot use the official API key model. It acts as a simple Twitter API scraper that relies on scraping rather than licensed API credentials.
Through the Client class you can log in with username, email, or phone plus password, optionally use saved cookies or TOTP for two-factor auth, and then call async methods. Supported operations include creating tweets, searching tweets, reading trends, fetching user tweets, sending direct messages, and uploading media.
The client supports cookie save and load to skip repeat logins, proxy and language settings, and optional CAPTCHA solving when accounts need unlocking. Result objects include pagination helpers for continued search or timeline reads.
Key features
- No official API key required
- Async Client API
- Account login with cookie persistence
- Tweet search and posting
- Trend retrieval
- User tweet timelines
- Direct messages
- Media upload support
Use cases
- Automating tweet search in Python
- Bots posting without API keys
- Collecting trending topics
- Scripted account workflows with cookies