How to programmatically (PHP) authenticate my app so it can retrieve my own followers and the followers of my partners?


All the OAuth docs and code samples I’m finding, both at and elsewhere, seem to assume that as an app developer I will want to set up a process wherein human users can authenticate. Most of these code samples are for situations where the developer wants to write an interface for tweeting.

What about something like retrieving a list of followers? The docs indicate that to do this, I must authenticate my app:

I see that my first move is to get a token, and the docs for that are here:
However, I’m not sure how to do the post that’s described at the bottom of that page. I’m not sure what that’s going to look like in PHP. Is it something like this:

Or, perhaps I’m overlooking some easier way to retrieve all followers for an account? The followers will most likely number in the thousands, but almost certainly not hundreds of thousands. Probably south of 50,000.

Thank you,


I’d strongly suggest using the tmhOAuth library for this:

It will handle the authentication, and is nicely documented and has several examples:



I recommend my own library It’s really simple and let you login as application or single-user to make api calls.

More details and examples on: