Skip to content

Instantly share code, notes, and snippets.

@s2t2
Last active April 22, 2018 18:25
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save s2t2/1dc7c53d34621f9a68d03e8554b53dc7 to your computer and use it in GitHub Desktop.
Save s2t2/1dc7c53d34621f9a68d03e8554b53dc7 to your computer and use it in GitHub Desktop.
twitter, instagram api - get bearer token
curl -u "$TWITTER_CONSUMER_KEY:$TWITTER_CONSUMER_SECRET" --compressed --data 'grant_type=client_credentials' 'https://api.twitter.com/oauth2/token'
#> {"token_type":"bearer","access_token":"____________"}
curl --get 'https://api.twitter.com/1.1/search/tweets.json' --data 'q=ninja+turtles' --header "Authorization: Bearer $TWITTER_BEARER_TOKEN"
#> ...
curl --get 'https://api.twitter.com/1.1/statuses/user_timeline.json' --data 'user_id=36672696' --header "Authorization: Bearer $TWITTER_BEARER_TOKEN"
#> ...
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment