I’m getting an authorisation error: trying to use Premium Sandbox, so wondering is there’s anything else I need to specify in the code?
I’ve read most post here and else to see if I could fix it but all I’ve tried has failed to work!
Code below:
import requests
import json
endpoint = "https://api.twitter.com/1.1/tweets/search/fullarchive/developer.json"
headers = {"Authorization":"Bearer BEARER_TOKEN", "Content-Type": "application/json"}
data = '{"query":"(aborto)", "fromDate": "201803010000", "toDate": "201808160000","place_country":"Argentina", "maxResults":10},'
response = requests.post(endpoint,data=data,headers=headers).json()
print(json.dumps(response, indent = 2))