shields icon indicating copy to clipboard operation
shields copied to clipboard

Reddit API Changes

Open calebcartwright opened this issue 2 years ago • 4 comments

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

calebcartwright avatar Jun 13 '23 18:06 calebcartwright

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 avatar Jun 13 '23 20:06 chris48s

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

chris48s avatar Jul 16 '23 14:07 chris48s

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

image

image

ReenigneArcher avatar Dec 16 '23 18:12 ReenigneArcher

@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:

  • Open a new issue - I don't think what you're seeing is the same problem this issue is about
  • Post a link to the badge. It looks like in the post above you've just uploaded a static image

Thanks

chris48s avatar Dec 17 '23 12:12 chris48s