I have recently purchased a premium, full-archive subscription. First, I generated bearer-token using this Java code. But I use Python code “search-tweets” for retrieving data. But somehow I cannot manage to load the credentials. I keep receiving the following error:
File “c:\python36\lib\site-packages\searchtweets\credentials.py”, line 104, in _parse_credentials
This is the code I am using:
from searchtweets import ResultStream, gen_rule_payload, load_credentials premium_search_args = load_credentials("~/.twitter_keys.yaml", yaml_key= "search_tweets_api", account_type= "premium", env_overwrite=False)
And this is the code in “.twitter_keys.yaml”:
search_tweets_api: endpoint: https://api.twitter.com/1.1/tweets/search/fullarchive/.....json account_type: premium bearer_token: <..........>
I’m not sure whether there is something wrong with my yaml file, or the way I generated it? I’m still new to Python. Even though I retrieved data using my standard account before, this is the first time I use a premium account with search-tweets code. I appreciate your help!
Thanks a million in advance.