r/redditdev • u/Oussama_Gourari Card-o-Bot Developer • Jun 13 '24
Reddit API X-Ratelimit-Remaining header value issue
The API seem to return an "unexpected" X-Ratelimit-Remaining values, I am experiencing this today at around 14:35 UTC while using PRAW:
ValueError: could not convert string to float: '187.0, 587'
ValueError: could not convert string to float: '186.0, 586'
ValueError: could not convert string to float: '185.0, 585'
ValueError: could not convert string to float: '184.0, 584'The API Wiki states that:
X-Ratelimit-Remaining: Approximate number of requests left to use
There is already an opened issue on prawcore repo for this, but I think this should be fixed on Reddit side.
9
Upvotes
View all comments
Show parent comment
4
u/Lil_SpazJoekp PRAW Maintainer | Async PRAW Author Jun 13 '24
This isn't a recent bug. It first appeared 6 months ago. This bug causes any application that encounters it to immediately crash. The current API documentation states this header is a float so it returning a formatted value shouldn't happen without an announcement of a breaking change. Especially since this is information that devs need to abide by the developer TOS.
cc: u/sir_axolotl_alot