Socket
Socket
Sign inDemoInstall

twikit

Package Overview
Dependencies
3
Maintainers
1
Alerts
File Explorer

Install Socket

Detect and block malicious and high-risk dependencies

Install

    twikit

Twitter API wrapper for python with **no API key required**.


Maintainers
1

Readme

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@example.com'
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!

FAQs


Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc