Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Random HTTP 429 rate limit response? #139

Open
RagingLeviathan opened this issue Sep 28, 2024 · 7 comments
Open

Random HTTP 429 rate limit response? #139

RagingLeviathan opened this issue Sep 28, 2024 · 7 comments

Comments

@RagingLeviathan
Copy link

RagingLeviathan commented Sep 28, 2024

Hey all, I built a node.js app that responds to discord message triggers. All it does is call the /followers endpoint when invoked and save the response to a json file.

Been using it for months without issue, but today, for some reason, I keep running into a rate limit exceeded? I've checked the headers of the response received from Tumblr's API, and i don't seem to be hitting the limit? It should be about 50ish requests a minute as it iterates through my followers list.

Response headers: Object [AxiosHeaders] {
server: 'nginx',
date: 'Sat, 28 Sep 2024 18:14:38 GMT',
'content-type': 'application/json; charset=utf-8',
'content-length': '89',
connection: 'keep-alive',
'x-rid': '64fd05ca71d0dc344741f924217e79d2',
p3p: CP="Tumblr's privacy policy is available here: https://www.tumblr.com/policy/en/privacy",
'x-ratelimit-perday-limit': '5000',
'x-ratelimit-perday-remaining': '4106',
'x-ratelimit-perday-reset': '76341',
'x-ratelimit-perhour-limit': '1000',
'x-ratelimit-perhour-remaining': '610',
'x-ratelimit-perhour-reset': '753',
'strict-transport-security': 'max-age=31536000; preload',
'alt-svc': 'h3=":443"; ma=86400'
}

calling ;
https://api.tumblr.com/v2/blog/${blogName}/followers?limit=2000&offset=20&prev_offsets=0

Yep, I did set the followers limit ridiculously high! Any clue what could be up?

The strangest thing is i am seeing it retrieving blogs, but it seems to fail before the fetching completes.

Tried to contact support, but got a response from a bot. :')

@RagingLeviathan
Copy link
Author

Speak of the devil, as soon as i post this, it finally completed. 🤣 Could this have been a transient issue on Tumblr's side maybe? Strange one, for sure. 🤔

@RagingLeviathan
Copy link
Author

Although, hmm, maybe not. 🤔 This is happening again... with the first call I tried today? It's like there's an issue with trying to retrieve the last follower, has anyone got any ideas what could be up?

@cyle
Copy link
Member

cyle commented Sep 30, 2024

I didn't even know we had this, but it turns out we have a separate rate limit for the followers endpoint, ~60 requests per minute. You likely hit that! I'll add this to our documentation. Sorry about that!

@cyle
Copy link
Member

cyle commented Sep 30, 2024

Looks like you also uncovered a small bug, the x-ratelimit-perhour-limit is telling you about the global rate limit that applies to all of your consumer's API usage, and not the limit that applies to this specific endpoint. We can probably fix that up too, it would've made this a bit clearer, I hope.

@RagingLeviathan
Copy link
Author

Oh, whoops! Thank you for sharing this, i appreciate it! :) This definitely helps, so cheers!

@RagingLeviathan
Copy link
Author

Looks like you also uncovered a small bug, the x-ratelimit-perhour-limit is telling you about the global rate limit that applies to all of your consumer's API usage, and not the limit that applies to this specific endpoint. We can probably fix that up too, it would've made this a bit clearer, I hope.

Will the rate limit for this specific endpoint come back in the headers in future too, or at least be captured in the documentation?

@cyle
Copy link
Member

cyle commented Oct 2, 2024

at the very least, we'll add documentation about it, for sure.

i need to confer with the folks closer to the work on how these headers are meant to behave before i can say whether we should reflect the "global" or "local" rate limits there.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants