Twikit is a Python library that lets you interact with Twitter’s internal API through web scraping. Search tweets, post content, send DMs, and more—all without needing official API credentials.
Twikit uses Twitter’s internal API through web scraping, so you use your regular Twitter account credentials—no API keys needed.
3
Make your first request
Search for tweets or interact with Twitter:
# Search for latest tweetstweets = await client.search_tweet('python', 'Latest')for tweet in tweets: print(f"{tweet.user.name}: {tweet.text}")# Create a tweetawait client.create_tweet(text='Hello from Twikit!')# Get user informationuser = await client.get_user_by_screen_name('twitter')print(f"{user.name} has {user.followers_count} followers")
All Twikit operations are asynchronous. Make sure to use await and run your code in an async context.
Key features
Everything you need to build powerful Twitter automation
No API Key Required
Uses web scraping to access Twitter’s internal API. No need to apply for developer credentials or pay for API access.
Fully Async
Built with async/await support for all operations. Efficient and fast for handling multiple requests concurrently.
Comprehensive Features
Create tweets, search content, send DMs, upload media, manage lists, and more—all the features you need.
User & Tweet Operations
Follow/unfollow users, like tweets, retweet, reply, quote tweets, and access user profiles and timelines.
Search & Discovery
Search tweets and users, get trending topics, discover similar tweets, and explore communities.
Media Support
Upload images, videos, and GIFs. Download media from tweets. Handle media metadata and thumbnails.
Direct Messages
Send and receive DMs, manage conversations, create group chats, and handle message reactions.
Real-time Streaming
Listen for new tweets in real-time, monitor mentions, and track keyword streams.