Skip to main content

Number of GitHub stars GitHub commit activity Version Tweet Discord BuyMeACoffee

[日本語] [中文]

Twikit

A Simple Twitter API Scraper

You can use functions such as posting or searching for tweets without an API key using this library.

🔵 Discord

[!NOTE] Released twikit_grok an extension for using Grok AI with Twikit.
For more details, visit: https://github.com/d60/twikit_grok.

Features

No API Key Required

This library uses scraping and does not require an API key.

Free

This library is free to use.

Functionality

By using Twikit, you can access functionalities such as the following:

  • Create tweets

  • Search tweets

  • Retrieve trending topics

  • etc...

Installing

pip install twikitminifix

Quick Example

Define a client and log in to the account.

import asyncio
from twikitminifix import Client

USERNAME = 'example_user'
EMAIL = 'email@example.com'
PASSWORD = 'password0000'

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


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


asyncio.run(main())

Create a tweet with media attached.

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

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

Search the latest tweets based on a keyword

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

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

Retrieve user tweets

tweets = await client.get_user_tweets('123456', 'Tweets')

for tweet in tweets:
    print(tweet.text)

Send a dm

await client.send_dm('123456789', 'Hello')

Get trends

await client.get_trends('trending')

More Examples: examples

Contributing

If you encounter any bugs or issues, please report them on issues.

If you find this library useful, consider starring this repository⭐️

Metadata

Release files for twikitminifix 2.3.7

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for twikitminifix 2.3.7
File Size Uploaded
twikitminifix-2.3.7.tar.gz 69.7 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for twikitminifix 2.3.7
File Interpreter ABI Platform
twikitminifix-2.3.7-py3-none-any.whl Python 3 none any Details

Total release size: 153.3 kB

Release files / twikitminifix-2.3.7.tar.gz

Download URL twikitminifix-2.3.7.tar.gz
Size 69.7 kB
Tags Source
SHA-256 checksum
How to use checksums
2067aa46db4c11f07a9ac855b7f6ec7607c439dc87210fcaa8693345dd5a329d
BLAKE2b-256 checksum
How to use checksums
9ff786f169cb8defc321dbb05723305713a047585ea9ae9f97d0bd943aff1b32
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via pdm/2.25.9 CPython/3.11.0 Windows/10

Release files / twikitminifix-2.3.7-py3-none-any.whl

Download URL twikitminifix-2.3.7-py3-none-any.whl
Size 83.6 kB
Tags Python 3
SHA-256 checksum
How to use checksums
1bf4ac10e03fd7d2f0a42d6c0f1a8f1adc81a61982ba6e9eca9879be00e2ff94
BLAKE2b-256 checksum
How to use checksums
2add0ba6e3876ab2d1adde44060009f66cce527810e73de0c8a8f2e03e4119d7
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via pdm/2.25.9 CPython/3.11.0 Windows/10

Release history Release notifications | RSS feed

This release

2.3.7 This release

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page