Skip to content

Version 2.1.0

Compare
Choose a tag to compare
@d60 d60 released this 25 Jul 17:56
· 8 commits to main since this release

Version 2.1.0

New Features

  • Added twikit.guest module, which allows operations such as retrieving users, tweets, and user tweets without logging in. You can refer to examples/guest.py for usage examples.

  • Added Client.get_user_highlights_tweets.

Guest client quickstart

import asyncio

from twikit.guest import GuestClient

client = GuestClient()


async def main():
    # Activate the client by generating a guest token.
    await client.activate()

    # Get user by screen name
    user = await client.get_user_by_screen_name('elonmusk')
    print(user)
    # Get user by ID
    user = await client.get_user_by_id('44196397')
    print(user)


    user_tweets = await client.get_user_tweets('44196397')
    print(user_tweets)

    tweet = await client.get_tweet_by_id('1519480761749016577')
    print(tweet)

asyncio.run(main())