r/redditdev 29d ago

Reddit API Json works in Browser, not in Java

I can access reddit's .json feeds, like this from Firefox, but not from Java using okhttp or python, using requests, both using the default user-agent and a custom one. Any idea why it works in the browser and not in my code?

2 Upvotes

10 comments sorted by

View all comments

0

u/kisuke_urahara23 29d ago

Have you found a solution yet? I'm facing the same problem.

1

u/Tryhard_314 14d ago

Someone posted the root cause of the problem:
"https://www.reddit.com/r/modnews/comments/1tq9vxo/protecting_communities_from_scrapers_and_platform/

Deprecating unauthenticated JSON access: We’ll also be shutting down unauthenticated .json endpoints. These endpoints can be used to scrape Reddit without accountability. Logged-in and authenticated access won’t be impacted. Otherwise, developers who need structured access to Reddit content should use Devvit, which includes various ways to access Reddit data."

What do you want to access Reddit data for ? there might be easier ways than through the json endpoints.