Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
323 views
in Technique[技术] by (71.8m points)

How rate limit works in twitter in search API

I want to user Search API for twitter using 1.1 version.

There is a limit for 450 request per applications.

But I have a doubt in this rate limiting. I thought that it means we can make 450 request in every 15 mins of request window.

But I read(but i am not sure about what exactly i read) something like by default it returns 15 status based on search query. But if you query more status in single request it's considered based on the number of statuses.

Do they have a rate limit only for every 15 mins or they have rate limit for a day too?

So I couldn't understand how it exactly works ? Can any one help me with this?

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Reply

0 votes
by (71.8m points)

Rate limits are segmented by the type of authentication, user or app. User authentication is any OAuth process that is based on the user. Application-only authentication is for your application credentials and not based on user. In the case of Search, you have a 15 minute window of 180 for user and 450 for app. For a higher rate limit (in the case of search) use application-only authentication. This will give you:

24 hours x 4 15-minute increments x 450 requests per 15-minute increments == 43200 requests per day

You just have to control your app so that it doesn't exceed 450 requests in a 15 minute interval.

Here's Twitter's docs on rate limiting:

https://developer.twitter.com/en/docs/basics/rate-limiting

You can also use the X-Rate-Limit-Limit/Remaining/Reset HTTP headers and the rate-limiting endpoint to keep track of where you're at and what's available:

https://developer.twitter.com/en/docs/developer-utilities/rate-limit-status/api-reference/get-application-rate_limit_status


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
OGeek|极客中国-欢迎来到极客的世界,一个免费开放的程序员编程交流平台!开放,进步,分享!让技术改变生活,让极客改变未来! Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...