Python Forum

Full Version: Twitter extracts on analytics tab
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Twitter download data
Is there a way to download one month data using python

https://analytics.twitter.com/user/username/tweets

say i am interested in April month data and in the calendar i have chosen Apr1 to Apr 30 and next step is to click export tab. it will have around 40 columns starting from Tweet id to promoted media engagements(40th column)

If we are using twitter API i am having below registered

access_token_key,access_token_secret,consumer_key,consumer_secret

with twitter API i am able to get last 200 tweets , but how can we take the analytics record.
import tweepy
import twitter
access_token_key=
access_token_secret=
consumer_key= 
consumer_secret=
def get_tweets(username):
        auth = tweepy.OAuthHandler(consumer_key, consumer_secret)
        auth.set_access_token(access_token_key, access_token_secret)
  api = tweepy.API(auth)
         number_of_tweets=200
        tweets = api.user_timeline(screen_name=username)
        tmp=[] 
       rer= [tweet.text for tweet in tweets]
 for j in rer:
             tmp.append(j)
print(tmp)
if __name__ == '__main__':
    get_tweets("username")


can this be done in Python with any script option or by any means. this is for automation.

there are so many columns are there in excel report.

Tweet id Tweet permalink Tweet text time impressions engagements engagement rate retweets..........
promoted follows promoted email tweet promoted dial phone promoted media views promoted media engagements

Thanks for your help!.
Thanks Larz. I will follow from future post :)
Do you have any idea on the above
I'm not familiar with tweepy, so not sure what's needed to get what you want.
Steps is : 1. Login to twitter with your userid and password 2.click on user profile we can see analytics tab 3. click on analytics tab it will pop up to new window [https://analytics.twitter.com/user/username/tweets].
If you have gone to the site "https://analytics.twitter.com/user/username/tweets" ,you will see the date range specified in it and we need to download after specifying the date.

There are N number of columns are there like Tweet id, Tweet permalink, Tweet text, time impressions, engagements, engagement rate, retweets,..........promoted follows, promoted email, tweet promoted, dial phone, promoted media, views promoted, media engagements.