Skip to main content

Twitter API Scraper Without API Keys

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.

Quick start

Get up and running with Twikit in minutes

1

Install Twikit

Install the library using pip:
pip install twikit
Requires Python 3.8 or higher.
2

Initialize the client

Create a client instance and authenticate with your Twitter credentials:
import asyncio
from twikit import Client

USERNAME = 'your_username'
EMAIL = '[email protected]'
PASSWORD = 'your_password'

client = Client('en-US')

async def main():
    await client.login(
        auth_info_1=USERNAME,
        auth_info_2=EMAIL,
        password=PASSWORD
    )

asyncio.run(main())
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 tweets
tweets = await client.search_tweet('python', 'Latest')

for tweet in tweets:
    print(f"{tweet.user.name}: {tweet.text}")

# Create a tweet
await client.create_tweet(text='Hello from Twikit!')

# Get user information
user = 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.

Advanced Configuration

Proxy support, CAPTCHA solving, cookie management, and rate limit handling built-in.

Code examples

Real-world examples to help you get started quickly

Create and Post Tweets

Learn how to create tweets with text, media, polls, and schedule them for later posting.

Search Tweets

Search for tweets by keyword, filter by type, and paginate through results efficiently.

Download Media

Download images, videos, and GIFs from tweets to your local filesystem.

Auto-Reply Bot

Build an automated bot that monitors mentions and replies to users automatically.

Stream Tweets

Listen for new tweets in real-time and process them as they arrive.

Ready to get started?

Install Twikit and start building powerful Twitter automation in minutes. No API keys required.

Build docs developers (and LLMs) love