Twitter API Scraper | Without an API key | Twitter Internal API | Free | Twitter scraper | Twitter Bot

d60 d60 Last update: Apr 12, 2024

Number of GitHub stars GitHub commit activity Version Tweet Discord BuyMeACoffee

Twikit

simple API wrapper to interact with twitter's unofficial API.

You can log in to Twitter using your account username, email address and password and use most features on Twitter, such as posting and retrieving tweets, liking and following users.

If you have any questions, please ask on Discord.

Features

No API Key Required

This library uses the unofficial API, therefore does not require an API key.

Completely Free

This library is completely free to use.

Both Synchronous and Asynchronous Support

Whether you prefer synchronous or asynchronous programming,

Twikit supports both, providing flexibility for different use cases.

Functionality

This library allows you to perform various Twitter-related actions, including:

  • Create tweets

  • Search tweets

  • Retrieve trending topics

  • etc...

Installing

pip install twikit

Quick Example

Define a client and log in to the account.

from twikit import Client

USERNAME = 'example_user'
EMAIL = '[email protected]'
PASSWORD = 'password0000'

# Initialize client
client = Client('en-US')

# Login to the service with provided user credentials
client.login(
    auth_info_1=USERNAME ,
    auth_info_2=EMAIL,
    password=PASSWORD
)

Create a tweet with media attached.

# Upload media files and obtain media_ids
media_ids = [
    client.upload_media('media1.jpg'),
    client.upload_media('media2.jpg')
]

# Create a tweet with the provided text and attached media
client.create_tweet(
    text='Example Tweet',
    media_ids=media_ids
)

Search the latest tweets based on a keywords

tweets = client.search_tweet('python', 'Latest')

for tweet in tweets:
    print(
        tweet.user.name,
        tweet.text,
        tweet.created_at
    )

More Examples: examples

Contributing

I would like to hear your thoughts and suggestions.

If you have any features you'd like to see added or encounter any issues,

please let me know in the issues section.

Additionally, if you find this library useful, I would appreciate it if you would star this repository or share this library⭐! Thank you very much!

Tags:

Subscribe to our newsletter