How to get the Twitter follower count of a user on a given date, or at the time of a tweet? - twitter

I have access to Twitter API for Academic Research, and I'd like to get the follower count on a given date of a user, or at the time of a tweet.
The doc mentions that "This fields parameter enables you to select which specific user fields will deliver in each returned Tweet.", so I assumed that by adding public_metrics to the users.field, the number of followers can be seen in each returned Tweet, however, in each returned Tweet, I can only see user_id. https://developer.twitter.com/en/docs/twitter-api/tweets/search/api-reference.
Is it even possible to achieve what I want with Twitter API for Academic Research? Is there any other approach to make it?
Thank you so much.

You cannot get the follower count on a specific date; it will always be the count at the time you make the API call.
You may need to add expansions to your API call in order to receive the values you are trying to pull out.

Related

Firestore query with array of strings

I try to make social network (like instagram )
User have posts and followers etc
I want for home feed show posts just from users i follow.
User have array with ids of users he follow. So idea is to query from colloection “Posts” where id is equal to one of ids and sort them by timestamp and limit them.
I could make for loop for each in following array but this will be unusable for more than 100 following users.
Edit how I think it could be solved
Hello i dont know if im doing it right but here is my solution for social network like instagram or any other where one user follow other users and have feed from their posts ordered by date.
Each user have its own Collection Timeline where are posts references (postId, createdAt, createdBy) that user should see at his feed, when user start following other user it will put all his posts to feed. For display feed I just call on User timeline, sort it by date and request just 25 of them.
When user start the app I loop trough all followers and request their posts younger than lastTimeline timestamp from their posts collection if they have any I add them to timeline.
I would be happy for your opinion.
You can loop through all the followed user ID and then request the first 5 posts of each one.
Or use some kind of paging

Why one tweet can have many IDs?

When searching tweets by the Twitter API, I got many tweets in the response with different IDs, but representing the same tweet. Example of IDs:
898174127525199872
898164436929716224
898163389104406529
898162871690944513
898163196938248193
You can see any of this tweets by URL: twitter.com/Triangle_Global/status/<id> - replacing <id> with a number. All this URLs redirect to the same address, the page with tweet 897793867822411776. Moreover, this ID was not returned in the search query.
Why one tweet has many IDs? Is it possible to construct a query that returns only "original" tweets, without such "duplicate" ids?
All these tweets that you reference are retweets of 897793867822411776. You can see this by looking at the retweeted_status field.
You didn't say which API endpoint you are using. If you are using search/tweets there is no way to return only "original" tweets. What you can do is throw out any tweets that has the retweeted_status field present. If the tweet is not a retweet it will not contain this field.

Twitter Tweet Search FROM particular date to TO particular date wrt/ and without user using java api

I would like to search for a tweets within a range of between dates by using Twitter API v1.1
let Query query=new QUery(String query);
what is the query thats suits for my question ??
Thanks in advance for reply back.
I suggest setting until to limit your query to an upper date bound, e.g.:
query.setUntil("2014-07-01");
Then step back through the result set, by making subsequent search calls, until you hit your lower date bound.
Be aware that the search API may not contain all Tweets and it may not 'go back' as far as you need. For more information on it, and other query parameters, take a look at Twitter's documentation on searching.

How to get list of Tweets by hash tag that are more than 7 days old

I am using this URL http://search.twitter.com/search.json to grab tweets with the hash tag #SameHashTag. The feed only returns items within the past week. Twitter explains why here:
https://dev.twitter.com/docs/faq#8650
I really need to get the last 10 tweets, regardless of when they were created. What is the alternative?
Note I read about user_timeline, but that seems to be based on user instead of hashtag. I read about list_timeline, but that seems to pull tweets from a defined list of users instead of hashtag.
You can't get old tweets from Search API. If your hashtag doesn't change you could search it and save results every day and build your own history.

Users/Friends with twitterizer that don't follow back

I am using twitterizer in an ASP.NET-project. I nned an example (code) how I can use twitterizer to show a list of followers (paged) for a special account that don't follow back.
The query is: Give me all users that I follow for e.g. 5 days but that didn't follow me back. The result should be displayed in a GridView with paging.
Thanks!
As I stated in the email, there is no way to filter friends or followers by date.
Your best bet to do this is to use TwitterFriendship.FriendsIds() and TwitterFriendship.FollowersIds(), then select the difference between the two. That will give you the list of followers that you don't follow. (Friends are users you follow.) In order to identify new friends/followers, you'll need to keep a list of the Ids, then consult that list at a later date to see the changes over time.
You could create a database (or list, etc) of users you followed and users who follow you. Update this as often you you need and add a time stamp for each new addition. Then you could query this database to create the list you want.

Resources