I'm trying to use the reddit API to pull text data for a project, but I can't get the OAuth access token. Instead of responding with the access token, the response just says bad request.
Here's my code:
data={'grant_type':'authorization_code','code':'authcode which I got from the get request before','redirect_uri':'https://www.google.com/'}
r=requests.post('https://www.reddit.com/api/v1/access_token',data=data,auth=('client ID','client Secret'),headers={'User-Agent':'Rishi'})
print(r.text)
this what I'm getting
{'message': 'Bad Request', 'error': 400}
Triple checked the personal use script and secret, and so I'm struggling to think of what's wrong. Any ideas?