badges / shields

Concise, consistent, and legible badges in SVG and raster format
https://shields.io
Creative Commons Zero v1.0 Universal
23.57k stars 5.49k forks source link

Reddit API Changes #9256

Open calebcartwright opened 1 year ago

calebcartwright commented 1 year ago

I've just seen some of the noise around the upcoming Reddit API changes so sharing for awareness and discussion as I think there's a decent chance we could be impacted

https://www.reddit.com/r/reddit/comments/12qwagm/an_update_regarding_reddits_api/ https://www.reddit.com/r/reddit/comments/145bram/addressing_the_community_about_changes_to_our_api/

I've not had a chance to really dig into the specifics of which API(s) are changing nor cross reference them against our own context of whether we're using such APIs and what our request volume looks like. However, my impression from a cursory review is that this is a similar change to the one Twitter rolled out not too long ago: introducing monetization gates around API access in a manner that would almost certainly be cost prohibitive for us

chris48s commented 1 year ago

I had read a bunch of stuff about this but totally forgotten we have reddit badges.

Having a quick scan over the links you posted, I think the relevant limits are

100 queries per minute per OAuth client id if you are using OAuth authentication and 10 queries per minute if you are not using OAuth authentication.

Having had a quick look at the stats from the last hour on metrics.shields.io we are making more than 10 queries per min but less than 100 but it probably varies a bit. I guess there's 2 options:

  1. Crank up the max age and try to stay under 10/minute with anon access (quick n easy, but I suspect we'll struggle to stay under 10/minute 100% of the time)
  2. Add auth (bigger job but 100 queries per minute is actually very generous. That is 144,000 per day - we'll have absolutely no trouble staying under that)

Might be worth doing 1 as a stop-gap anyway while we see if someone wants to work on 2.

chris48s commented 1 year ago

Confirmed we are now starting to hit the rate limits on reddit badges

ReenigneArcher commented 9 months ago

For the past week or so, reddit badge says my subreddit is private even though it is public.

image

image

chris48s commented 9 months ago

@ReenigneArcher - we are sometimes hitting the rate limits. In that case, we get a 429 from reddit and we would return a badge with rate limited by upstream service on it.

The error you're seeing would be thrown if we get a 403 response from reddit: https://github.com/badges/shields/blob/2814de2ecd3dffcd5206c1398a28191211cf63b5/services/reddit/subreddit-subscribers.service.js#L54

Can you:

Thanks