Retweet counts using Twitter REST API - twitter

I want to get retweet count for set of tweets. With few search about it I found out that it could done using the Twitter REST API (oauth) , but it has limit with respect to number of request made (RATE LIMIT).Can anyone help me how to implement it using the oauth signature and without any limit.

You can't currently get retweet counts without obeying the limit:
https://developer.twitter.com/en/docs/basics/rate-limiting
Sorry.
You can always attempt to obey the limit and optimise your application/service. See the section in the above link titled "Tips to avoid being Rate Limited".

Related

How to increase the maximum number of requests per user for Youtube Data API

What is the Maximum number of requests per user for Youtube Data API? Is there a way to increase the maximum number?
My application uses Playlists: insert and PlaylistItems: insert. I know about maximum number of requests for Youtube Data API. but these api returns RATE_LIMIT_EXCEEDED even though the request limit has not been reached.
So I changed my account and ran the APIs, it worked.
The problem can be avoided by preparing multiple accounts, but it is not solved fundamentally.
Is there a way to increase the maximum number of Youtube Data API requests per user?
somedays ago i contacted Google about the same problem you have, and they answered me saying my API key was out of compliance.I think your case is the same, but until now I didn't realized what I did for The API being out of compliance. if someone knows the answer I appreciate.

Isn't a video search by keyword for OAuth authorized users?

I have implemented search.list kind of like docs points https://developers.google.com/youtube/v3/docs/search/list
But I found out about the quota unit.
So I made an OAuth 2.0 flow, so the user can log in with it's own account and then not dry my own quota, because I mistakenly thought videos.list was a sort of authorized way to get search by keyword https://developers.google.com/youtube/v3/docs/videos/list
So, even tho the user is authorized, all search.list request will be excuted using apiKey and not OAuth credentials??
There is one quota limit for your whole app. So all your users have to share it.
That said, it’s a good idea to have the OAuth2 flow and with it using the users own api key with the search requests because there is also a quota limit that applies to X amount of request in 100 seconds by a given user. This limit is very high but it eases the situation when many users work with your tool in parallel.

Getting the overall retweet_count of an account using Twitter API

Can we get the total Retweet_Count per an account OR per Screenname like followers count at user level as followers count is a property associated with user information, Where as Retweet_Count is a field associated with each individual Tweet.
I'm thinking I need to get all the tweets of a user then add the filed Retweet_Count in each & every tweet a user received. Here the problem is the total number of tweets getting using twitter rest api are limited to last 200 tweets (only 2 weeks old tweets in these 200).
We cannot find historical tweets with Streaming API, If we store all the real time tweets using streaming api in our local database then with the use of id of each tweet record in our local data base we need to call twitter rest api call(GET statuses/show/:id) in a loop, then add all the Retweet_Count value in this loop. But due to this the number of restapi calls are increasing to get the total Retweet_Count.
Please suggest me for the better approach.
No, that's not at all possible .
Since the retweet_count associates with each tweet, you need to get all the tweets first.
The reason why i said it's impossible is because if a user has more than 3200 tweets, then you can't get the exact retweet_count as twitter offers only 3200 most recent tweets of a user through GET statuses/user_timeline.
GET statuses/user_timeline method can only return up to 3,200 of a
user’s most recent Tweets. Native retweets of other statuses by the
user is included in this total, regardless of whether include_rts is
set to false when requesting this resource.
One more thing. Some Tweets retweent_count may vary time to time. I mean some may undo retweet & some may retweet old tweet or past week tweet. So, you need to retrieve all the tweets again and again to update-to-date with exact retweet_count. By doing this, there are more chances that you will fall in Twitter's Rate Limit.

Is it possible to access the live tweets of a user using tweepy?

I am trying to access live tweets of a user whenever he tweets it. So, all I want is something that continuously monitors a user account and whenever he tweets something I have to capture it. All the tweets are random so I cannot use any filters.
For any security reasons, if I cannot access other's tweets can I do it on my own account?
With tweepy you can connect to the REST API or the Streaming API.
Using the Streaming API you can use the filter endpoint to select the users you wish to follow with that streaming connection and you will receive updates as they get published.
Twitter's documentation: https://dev.twitter.com/docs/api/1.1/post/statuses/filter, tweepy's code: https://github.com/tweepy/tweepy/blob/master/tweepy/streaming.py
Tweepy's documentation doesn't give examples on the Streaming functions but you can find sample code searching at GitHub or StackOverflow for "tweepy filter follow".
Tweepy talks to the Twitter REST API, and the REST API doesn't have any way to react to someone posting a tweet.
HOWEVER...
You could certainly write an application that retrieves the tweets of a partcular user and looks for any tweets that weren't there the last time you checked.
You'd want to be cautious about how often you check so you don't run afoul of the API rate limits.

Twitter API - Getting friends and follower ids for a set of users?

I am able to extract tweets, and the submitter's user details using the streaming API, but I also need the list of followers and friends of users posting these tweets.
I am aware that Twitter search API has the friends/ids and followers/ids functions through which one can get the public followers and friends list one user at a time.
But, my data collection requires getting this information for all the users whose tweets I have collected, around 20,000+ users. This is quite exhaustive given the high number of users, and the limitation of one user per call. Moreover, I need to refresh this list for each of these 20,000+ users preferably once a day to observe changes in their friends and followers (if any).
IS there any I can achieve this using the Twitter Streaming API or any other method. Or I have to apply for the Twitter commercial data license?
Thanks!!!
20,000 is way beyond the limits of any normal Twitter API method. I think your going to have to apply for a commercial license to go that high. The streaming API, I believe, tracks 400 keywords and 5000 users max. Your right in that the REST twitter API method only allows you to track one user or a list of ID's. You can take a look at the Twitter Counter API which mines additional info including information about followers, etc. But again, 20,000 I'm sure would be above the limits. Communicate with Twitter, Gnip and, and the Twitter Counter service to see what they can do for you.
Twitter Counter API:
http://twittercounter.com/pages/api?ref=footer

Resources