0
API를 처음 사용하고 트위터 API를 사용하여 트윗을 검색하려고합니다. 나는 트위터에 개발 가이드를 따라 갔지만 여전히이 json 코드를 제공하고있다. {u'errors ': [{u'message'u'Bad 인증 데이터 'u'code'(215)}]}Twitter API를 사용하여 Python 사용 (215 오류 받기)
consumer_key = xxx
consumer_secret = yyy
token = base64.b64encode(consumer_key + ":" + consumer_secret)
headers = {'Authorization' : 'Basic ' + token, 'Content-Type' : 'application/x-www-form-urlencoded;charset=UTF-8'}
data = {'grant_type' : 'client_credentials'}
url = 'https://api.twitter.com/oauth2/token'
resp = requests.post(url, data = data, headers=headers)
d = resp.json()
access_token = 'Bearer ' + d['access_token']
tweets = requests.get('https://api.twitter.com/1.1/search/tweets.json?q=python')
어떤 조언?