I want to extract the timeline from a specifc user (Last 2 Years), using code below, but keep getting errror ‘403 Forbidden
When authenticating requests to the Twitter API v2 endpoints, you must use keys and tokens from a Twitter developer App that is attached to a Project. You can create a project via the developer portal’
client = tweepy.Client(bearer_token='@$@#$@$',
consumer_key='@$@#$@$',
consumer_secret='@$@#$@$',
access_token='2863466581-@$@#$@$',
access_token_secret='@$@#$@$'
)
user = client.get_user(username='nytimes')
paginator = tweepy.Paginator(client.get_users_tweets, id=user.data.id, max_results=2)
for tweet in paginator.flatten(limit=3200):
print(tweet)
Want to extract last 2 year of user timeline from twitter API;
New contributor
Rauer Figueiredo Castro is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.