Problem with .twitter_keys.yaml



Hello guys,
I have a sandbox account and an app to search tweets. When I try to run the example from the search-tweets-python library, I run into this error.
My guess is there is some problem with my .twitter_keys.yaml file.
Any suggestions to what might be the problem and how to fix it?
What is the proper format for this file?


Hey @AntonLevitan, the credential file should be in YAML format and there is an example file in the repo, showing how you might include multiple endpoints (or environments).

Based on your code and the error message, I suggest checking or verifying:

  • the credential file is valid yaml
  • the top level key in your yaml file matches your ‘yaml_key’ keyword argument in load_credentials() (looks like you’re expecting ‘search_tweets_premium’ right now)
  • there is an “account_type: premium” line in your yaml file

You can also post your yaml file here for feedback (with the credentials redacted!) if you’d like.