Twitter API Rate Limit Per User or Per Request? - twitter

I just have a quick question on the Twitter API rate limit. In this official GitHub example,
it says that you can have up to 100 usernames per user lookup request in the Twitter API. In the Twitter API documentation, it says that you can have up to 900 user lookup requests per 15 minutes. So, does this mean that I can look up 100 * 900 = 90,000 users in 15 minutes, or does looking up 100 users at once count as 100 requests? Thanks!

Related

How do I retrieve a user's tweets of last 7 days using twitter API?

I want to pull tweets from an authenticated user's home timeline (user + people the user follows) of past 7 days. How can I do this? The documentation of GET statuses/home_timeline only provides a count parameter and some other parameters like since_id and max_id which I don't really understand.
Documentation: https://developer.twitter.com/en/docs/twitter-api/v1/tweets/timelines/api-reference/get-statuses-home_timeline
Is there any other endpoint which might help? Or is it just impossible to do so?
The recent search in the Twitter v2 API can do what you are asking.
Here is an example:
https://api.twitter.com/2/tweets/search/recent?query=from:username is:verified&max_results=100
The Research Search API can only search in the last 7 days by default. You can return a maximum of 100 tweets per request.
Docs:
https://developer.twitter.com/en/docs/twitter-api/tweets/search/integrate/build-a-rule

How to get Twitter direct_messages/events/new rate limit

Using the API "https://api.twitter.com/1.1/application/rate_limit_status.json" doesn't retrieve any info about posting direct message API (https://api.twitter.com/1.1/direct_messages/events/new.json) rate limit, even when using this (https://api.twitter.com/1.1/direct_messages/events/new.json) none of the twitter rate limit headers exists (x-rate-limit-limit, x-rate-limit-remaining, x-rate-limit-reset)
So how we can retrieve this API rate limit????
Those headers only apply to read-only endpoints, not for HTTP POST calls. This is not an API rate limit, it is an account limit. Twitter accounts have a maximum number of Direct Messages they can send each day.
The current technical limits for accounts are:
Direct Messages (daily): The limit is 1,000 messages sent per day.
Additionally, there are adaptive limits to enable conversations to occur more easily that do not count to these limits, but are on a per-message basis:
Accounts may send up to 5 messages via the API in reply to a message they have received within 24 hours. Each message received resets this threshold.
So, this is not something that you can get from the API, you have to keep track of these yourself in your code.

Twitter API Rate Limit: Does it increase for my app if if 1 year ago users authorized my app?

So I'm trying to figure out if Twitter increases the rate limit for my app if I had users sign-in - and keeps the rate increase - even if users signed in 1 year ago. Meaning, does just the act of signing in increase the pool your app is allowed of requests? And what am I using if this is so, the app token without using the user token? Does the app token "benefit". Of if I have 10 users from a year ago with 150 requests allowed per 15 minutes, to make use of the 1500 requests, would I only be able to 'get it' if user token is included with the request?
From the Twitter.com page on rate limits...
Rate limiting of the API is primarily on a per-user basis — or more
accurately described, per user access token. If a method allows for 15
requests per rate limit window, then it allows 15 requests per window
per access token.
Each user/token gets their own allocation of requests; there's not a single set of requests shared by all users.

How can I get the count of other users mentioned in tweets by a particular user using Twitter API 1.1

I am looking to get the count of how many users were mentioned by a particular user in its tweets for a specific period of time.
I am looking to achieve it in Twitter API 1.1
For example, an arbitrary user #user1 mentioned 20 users in his tweets since last 10 days.

Twitter Followers profile scan

I want to scan profile data of followers.
My goal is to get followers numbers having Less then 20 twits or 10 followers.
I know how to get followers profile data.
Now, problem is suppose a profile have 1,00,000 Followers, than its a very big task to fatch all the profile data and identify profile having Less then 20 twits or 10 followers. And i need to make 1,00,000 twitter api calls, I this is not good idea.
Example : http://twitblock.org/
Is there any way to solve this ?
Thanks In advance !
a) get his followers followers/ids up to 5000 in single request, that's at at at least 20 requests (21 or 22 just to be safe)
b) get info on each follower users/lookup up to 100 in single request, that's 1000 requests
Given you can make no more than 350 requests per hour, per oAuth account you will need to use oAuth credentials of multiple authenticated users (3 users to be exact).

Resources