Setting up Twurl


I’ve seen many people asking about OAuth and Twurl. I’ve written a small primer for my organization and will share it here:

Twurl is twitter’s curl client. The advantage of using it is that we can pass urls around without OAuth signatures. OAuth is stored in the .twurlrc.

To generate the OAuth signatures:

  • Log in to your twitter account and find the “Keys and Access Tokens” of your app
  • Use twurl with the following commands:

account authentication:

twurl authorize --consumer-key {API-KEY} --consumer-secret {API-SECRET}

user authentication:

twurl authorize -u {USERNAME} -p {PASSWORD} --consumer-key {API-KEY} --consumer-secret {API-SECRET}

With account authentication, the user account is implied by the API credentials. If you are looking to authenticate against a separate account, use user authentication.

You can access the Ads API with such a call:

twurl -t -H /0/accounts | python -m json.tool

If you did both authentications above (well, not with my account) then issue this command:

twurl accounts

which will give you:

{KEY} (default)


You can change accounts with:

twurl set default {USERNAME}


twurl set default {USERNAME} {KEY}

the latter is if you are using multiple keys.

You can probably get most of the above info with:

twurl --tutorial

Ads API calls with PHP
Can any one explain briefly about how to use ads api in initial stage and how can i give request to access analytics data
Twurl /followers/ids returns wrong followers
Request token is required to fetch access token!
Not able to find out listed Fields from Ads API v1
Conversion pixel didn't create tailored audience
MISSING_PARAMETER, account_id is required
Reach estimate returns error with a valid geo location id
Unable to create new TailoredAudiences
Guidelines for Reporting Issues

Nice! thanks for sharing here, I’m sure it will be helpful to others!


Thank you fort this small tutorial! Please add “authorize” in above statement! i.e

twurl authorize --consumer-key {API-KEY} --consumer-secret {API-SECRET}


You are right. Thanks for pointing this out. Not sure how/if i can update the post.


@clatko feel free to open a pull request on the twurl repo integrating this step by step guide in the README - that might be a better place for this information.


I agree, It would be a perfect way for many because I saw lots of people asking questions about twurl!


I agree and will submit a PR right now. I still feel this information is pretty important to Ads API community and should be readily available in the search so it should not be removed.