Is there any way to find out when was the last time a user was active, that is, either the last login date or tweet or retweet on Twitter via API? Any activity of a user.
-
1Out of curiosity did you get any further on this topic? – rdoubleui Jan 14 '16 at 11:40
1 Answers
This answer assumes you're watching a known list of Twitter users.
Pretty sure that you are not going to see the login date/time. If you request the user's tweets from the user's timeline, then those tweets are sorted by date/time (GET
on https://api.twitter.com/1.1/statuses/user_timeline.json?screen_name=twitterapi&include_rts=true
). You might need to set include_rts
to true
in order to get back retweets. The time of the latest tweet gives you the time of the last activity.
Additionally you can add trim_user=true
to keep the payload smaller.
Notice that those requests do count into the rate limit count. You can do bulk requests by using the users/lookup
request, which lets you query up to 100 users with one request, which is more rate-limit-friendly.
Reference: https://dev.twitter.com/rest/reference/get/statuses/user_timeline

- 3,554
- 4
- 30
- 51