I was having an issue with my script crashing on a message undefined
error which was answered here: TypeError: Cannot read property 'message' of undefined – Twitter API
It turned out that when hitting a rate limit, the error message is delivered differently thus console.log('Try Favorite - ', err[0].message);
would return an error unless changed to console.log('Try Favorite - ', err.message);
.
It now outputs as [[Apr 28 22:26:01.024]] [LOG] Try Favorite - HTTP Error: 429 Too Many Requests
which suggests a rate limit, however, I’m not finding a clear rate limit.
All documentation for POST limits state 1000, however, I’m counting a total of 22 over the course of the lat 8 hours, so its strange that its being rate limited.
Does anyone have any more clear documentation? All links I find seem to be dead.
I might add as well,that ONLY favorites are being affected, all other requests are working fine.
EDIT: Adding output of recent. Undefined
will be You already ____ed this tweet
, however, due to a temporary change to keep the app from crashing, message is undefined.
[[Apr 28 23:57:00.560]] [LOG] Try Favorite - HTTP Error: 429 Too Many Requests
[[Apr 28 23:57:00.562]] [LOG] Try Favorite - HTTP Error: 429 Too Many Requests
[[Apr 28 23:57:00.563]] [LOG] Try Favorite - HTTP Error: 429 Too Many Requests
[[Apr 28 23:57:00.564]] [LOG] Try Favorite - HTTP Error: 429 Too Many Requests
[[Apr 28 23:57:00.575]] [LOG] Try Favorite - HTTP Error: 429 Too Many Requests
[[Apr 28 23:57:00.578]] [LOG] Try Retweet - undefined
[[Apr 28 23:57:00.583]] [LOG] Try Favorite - HTTP Error: 429 Too Many Requests
[[Apr 28 23:57:00.584]] [LOG] Try Retweet - undefined
[[Apr 28 23:57:00.589]] [LOG] Try Favorite - HTTP Error: 429 Too Many Requests
[[Apr 28 23:57:00.592]] [LOG] Try Retweet - undefined
[[Apr 28 23:57:00.593]] [LOG] Try Retweet - undefined
[[Apr 28 23:57:00.599]] [LOG] Try Retweet - undefined
[[Apr 28 23:57:00.604]] [LOG] Try Retweet - undefined
[[Apr 28 23:57:00.609]] [LOG] Try Retweet - undefined
[[Apr 28 23:57:00.619]] [LOG] Retweeted: https://twitter.com/username/status/90374******24768
[[Apr 28 23:57:00.634]] [LOG] Try Retweet - undefined
[[Apr 28 23:57:00.671]] [LOG] Try Retweet - undefined
[[Apr 28 23:57:00.754]] [LOG] Try Favorite - HTTP Error: 429 Too Many Requests
[[Apr 28 23:57:00.800]] [LOG] Favorited: https://twitter.com/username/status/99037*******48615
EDIT: Informed that I’m visibly exceeding rate limits, however this issue has only presented itself today while working for 5 days prior. As well retweets are still returning You have already retweeted this tweet
while favorites are returning Status 429.
EDIT: Attempted on another test user with only statuses/retweet requests, went through fine. Attempted with a different test user (to avoid last test usage) favorites/create and it runs for first interval, then immediately rate limits after the 2nd request at 5 requests per 2 minutes, which means I’m being limited at 7 favorites/create requests per 4 minutes.
This leads me to believe there is a specific limit with favorites, however, still unclear while this exact interval was working for 5 days prior.
2
Answers
There doesn't necessarily seem to be any documented favorites/create specific limitations, however, everything seems to be okay today. Not totally clear what had occurred as there were no updates posted to the Twitter System Status page.
As well, see Marco's answer above for useful information on the Premium APIs.
GET Rate Limits can also be found here, and are a bit more expanded on, however documentation doesn't state that individual POST options are limited anymore than others.
According to twitter documentation, the limit for standard accounts is 15 requests per rate limit window, which is 15 minutes. So if you’re sending 22 requests in less than 15 minutes, you’re exceeding the limit.
If you wish to increase your limits checkout premium APIs