Forums

Getting 403 for reddit

Hey, I'm trying to access Reddit using this url:

url = "https://www.reddit.com/r/books/"

I'm using the requests library:

response = requests.get(url, proxies=proxies)

tried with and without the proxies.

Getting a 403.

<Response [403]>

I see reddit is on the Whitelist, so what could the problem?

Thanks!

That might be coming from Reddit itself -- is there anything useful in the contents of the response that you get?

Response from reddit: You\'ve been blocked by network security. To continue, log in to your Reddit account or use your developer token If you think you\'ve been blocked by mistake, file a ticket below and we\'ll look into it.

I'm using the Reddit API. have an api key and a secret.
But before that, I'm scraping the subreddit to get some data, and that is where I can this error.
Locally this code works.

Any ideas if there is a workaround for this will be appreciated.
Thanks

Iirc reddit blocked scraping efforts this/or last year in favor of moving towards api use (which they can charge for)