1 year ago

#75632

test-img

AI-bobobo

I can't use Twitter API v2 with project application

I have been very grateful to Twitter API v2. The natural language processing using Twitter data has been very useful for my study. Thank you for everything.

It's been a while since I wanted to get other data, so I ran the data collection code and got the following error

Exception: (403, '{"client_id":"19~","detail":"When authenticating requests to the Twitter API v2 endpoints, you must use keys and tokens from a Twitter developer App that is attached to a Project. You can create a project via the developer portal.","registration_url":"https://developer.twitter.com/en/docs/projects/overview","title":"Client Forbidden","required_enrollment":"Standard Basic","reason":"client-not-enrolled","type":"https://api.twitter.com/2/problems/client-forbidden"}')

in following code

import requests as req

headers = {"Authorization": "Bearer {}".format(bearer_token)}
params = {'query': ...,
                  'tweet.fields':'created_at',
                  'expansions':'author_id', 
                  'user.fields':'description,created_at,public_metrics',
                  'max_results':'100',
                  'start_time':'2006-03-21T00:00:00Z',
                  'end_time':'2009-01-01T00:00:00Z'}

response = req.request("GET", url, params=params, headers=headers)

if response.status_code != 200:
    raise Exception(response.status_code, response.text)

I have a project named ReplyGeneratorbyPGN.enter image description here

Please give me advice..<(_ _)>

POSTSCRIPT

This project is made half a year ago, I regenerated bearer token. And, this problem solved with Twitter Academic license .

What is the difference between above and this?

Thank you.

twitter

bearer-token

0 Answers

Your Answer

Accepted video resources