Monday, September 5, 2016

how to generate a twitter (bearer) key with curl to use the twitter api

First you need to craete a twitter application ( and generate a consumer (api) key and consumer (api) secret.

With this key and secret, you must call once to generate the bearer key. 
curl -XPOST -u apikey:api-secret --data "grant_type=client_credentials"

With the access token from the response you can access the Twitter APIs

and... just to save your time. the keys in the example above will not work ;)