#Twitter API v2 authentication using Tweepy for Essential access endpoints in Python
import tweepy
client = tweepy.Client(bearer_token = 'brearer_token_here',
consumer_key = 'consumer_key_here',
consumer_secret = 'consumer_secret_here',
access_token = 'access_token_here',
access_token_secret = 'access_token_secret_here')
#Search 10 tweets that contain the word "grepper"
tweets = client.search_recent_tweets(query="grepper", max_results = 10)
#Use which ever method you want to extract the searched tweet data.
searched_tweet_data = tweets.data
import tweepy
consumer_key= 'your consumer_key'
consumer_secret= 'your consumer_key_secret'
access_token= 'your access_token'
access_token_secret= 'your access_token_secret'
auth = tweepy.OAuthHandler(consumer_key, consumer_secret)
auth.set_access_token(access_token,access_token_secret)
api = tweepy.API(auth)
#From here, you can tweet, search tweets, search keywords, etc.
# import the module
import tweepy
# assign the values accordingly
consumer_key = ""
consumer_secret = ""
access_token = ""
access_token_secret = ""
# authorization of consumer key and consumer secret
auth = tweepy.OAuthHandler(consumer_key, consumer_secret)
# set access to user's access key and access secret
auth.set_access_token(access_token, access_token_secret)
# calling the api
api = tweepy.API(auth)
# the ID of the user
id = 57741058
# fetching the user
user = api.get_user(id)
# fetching the description
description = user.description
print("The description of the user is : " + description)