Twitter Follower Collector

Extract a list of all followers from any Twitter account

Share:  
Table of Contents

Find out who is following a Twitter account 🐦

The 1st step in order to know who is following a specific Twitter account is to actually list the followers. With this API, choose your own or any Twitter account and get in seconds a clear listing of every follower, including their own:

  • Twitter Profile Url
  • Full Name
  • Bio

🤖💨 Around 5000 profiles every 90min 🤖💨

What will you need? ⚙️

  • "Twitter account or Spreadsheet URL": Choose a specific twitter account like @phbuster or choose an open spreadsheet url
  • "Session Cookie auth_token": Your Twitter auth_token session cookie.

Which steps to follow?

1. Create an account on Phantombuster.com 💻

If you haven't already, create a FREE account on Phantombuster. Our service will browse the web for you. It’s a website automator which runs in the cloud. Once done we'll follow up.

2. Use this API on your account.👌

Now that you're connected to Phantombuster, Click on the following button (it will open a new tab).

3. Click on Configure me!

You'll now see the 3 configuration dots blinking. Click on them.

4. Aim a specific Twitter account or several at a time

In the 1st argument field "Twitter account or Spreadsheet URL" you have the choice to use this API for 1 twitter account at a time or several in one go.

  • One at a time: Just fill the form with a Twitter username, example: @phbuster

  • Several at a time: Paste the URL of a spreadsheet filled with Twitter username and/or Twitter account URLs on column A

5. Get your Twitter Session cookie

The Session Cookie you'll need to make this API work is called "auth_token",
Here's how you can get yours:

  • Using Chrome, go to your Twitter homepage and open the inspector
    → Right click anywhere on the page and select “Inspect”
    CMD+OPT+i on macOS
    or
    F12 or CTRL+MAJ+i on Windows

  • Locate the “Application” tab

  • Select “Cookies” > “https://www.twitter.com” on the left menu.

  • Locate the “auth_token” cookie.

  • Copy what’s under “Value” (Double click on it then Ctrl+C) and paste it into your script Argument)

// How to access your cookies with Firefox and Safari//

⚙️️Repetition setup ⚙️

Now that your API is ready, you should set up repetitive launches. That way, your scraping will be spread over days, weeks or even months. You can also specify the number of profiles to process per launch, or leave that field blank to process every profile from your list.

To do so, simply hit the “Settings” button to define when your API is launched:

Then, select a frequency:

Don't forget to click 💾 Save at the bottom of the page!

For example, 10 profiles processed per launch, 8 launches per day: you'll process a total of 80 profiles per day.

Click on Launch & Enjoy!

It’s done! All that is left to do is to click on "launch" to try your script!

Limits

Twitter has set a limitation on the amount of followers you can retrieve over a period of time (aka rate limit).
After around 5000 followers scraped, you will need to wait for about 90min before being able to continue to scrape the rest of the followers. Re-launching the API during that time won't be of any use. When the rate limit has been lifted off, the API will be able to resume where it left off, until the next rate limit is hit, etc.

Output

This API will output CSV and/or JSON containing the following fields:

  • profileUrl (Profile url of the person following the targeted account)
  • name (Name of the person)
  • bio (Bio of the person)
  • userId (Their User ID)
  • imgUrl (Their profile picture)
  • backgroundImg (Their background profile image)
  • Certified (If they are a verified Twitter profile)
  • query (Url of the profile targeted)

Developers

Like all APIs on Phantombuster, this API comes with an HTTP endpoint. Launch it from your computer, app or server with a simple HTTP request and get its result as JSON. Click Use this API above to create your new endpoint.

Clone this API

The script below is all that's required to make the API work. If you're a developer, click the button to clone the code into a new Custom API Agent in your Phantombuster account. This operation will allow you to customize the API to your exact needs. This will also create a custom HTTP endpoint.

Contribute on GitHub

Feeling adventurous? Unsatisfied with the current state of this API? Send us pull requests on GitHub to improve the API store! The script is here and you might be interested in reading our documentation here

You can also edit the page you're reading right now

(we reward contributions we like with free Phantombuster accounts :D)

Share this API

Your friends & colleagues need to know about this!