Export Twitter Followers and Friends using a Google Spreadsheet

Note: Twitter recently wrote to me reminding me that

methods of obtaining and exporting Twitter content obtained via the Twitter API is prohibited by section I.4.A of our API Terms of Service (https://dev.twitter.com/terms/api-terms ), specifically:
You will not attempt or encourage others to sell, rent, lease, sublicense, redistribute, or syndicate access to the Twitter API or Twitter Content to any third party without prior written approval from Twitter. If you provide an API that returns Twitter data, you may only return IDs (including tweet IDs and user IDs). You may export or extract non-programmatic, GUI-driven Twitter Content as a PDF or spreadsheet by using “save as” or similar functionality. Exporting Twitter Content to a datastore as a service or other cloud based service, however, is not permitted.

Following clarification from Twitter I making this template available again but please note.

By using this template you agree it is for personal use only and the data is not made publicly available.

Recently I’ve noticed a growing number of people arrive at this blog having searched for ‘export twitter followers’. Rather than them leaving disappointed here’s a Google Spreadsheet I threw together which allows you to grab a copy of your friends/followers:

*** Google Spreadsheet to Export Twitter Friends and Followers – NEW Version ***
Update 27/11/2014: This has been updated to a new version that uses the TwtrService Library (one time authentication)

Benefits of using Google Spreadsheet

  • Control – You register for your own API key with Twitter so you have full control of the account
  • Playing with the data – as you are importing straight into a spreadsheet you can do all of your own data manipulation like sorting, filtering and creating your own formula for things like follow/follower ratios
  • Backup – Google Spreadsheets allow you to download copies of spreadsheets in different formats
  • Share – You can make your lists of friends/followers easily viewable

Where’s this all going?

Having already done other things with the Twitter API and Google Spreadsheets (See Populating a Twitter List via Google Spreadsheet … Automatically!, Collect/backup tweets in a Google Spreadsheet, Google Apps Script, Spreadsheets, Twitter and Gadgets) the Twitter/Google Spreadsheet back is well and truly broken. You’ll probably see fewer posts one this area with new stuff instead I’ll probably start properly documenting the little code snippets I use (but if you have any interesting ideas you want help with get in touch).
This doesn’t mean I’ll be walking away from Google Spreadsheets. As recent posts like Turning Google Spreadsheets into a personal or group bookmarking service, show there is huge scope in using Spreadsheets as a very flexible rapid development platform.
Below are some bits of the code used in my new spreadsheet (all the code is viewable via the Script Editor in the Spreadsheet):
Update: This was the old way data was collected from the Twitter API

function tw_request(method, api_request){
  // general purpose function to interact with twitter API
  // for method and api_request doc see http://dev.twitter.com/doc/
  // retuns object
  var oauthConfig = UrlFetchApp.addOAuthService("twitter");
  var requestData = {
        "method": method,
        "oAuthServiceName": "twitter",
        "oAuthUseToken": "always"
   try {
      var result = UrlFetchApp.fetch(
      var o  = Utilities.jsonParse(result.getContentText());
    } catch (e) {
   return o;

Using the TwtrService Library it’s replaced with:

function tw_request(method, api_request){
  return TwtrService.get(api_request);

Join the conversation

comment 288 comments
  • ESTV

    Awesome. Used Ur link @ the top and it worked perfectly. Thanks!

  • Alli

    Thank you for this tutorial! is there anything more simple that will just count the number of followers for a list of twitter accounts? not xml export, because google docs only allows 50 of these per sheet, i need a few more than 50…. any tips very helpful
    thank you!

  • The Art and Science of Social Media at Dora the Explora

    […] it out and got several responses, including Export.ly, Twittercounter (for a fee), Tweetake and Google spreadsheet. (Thx to @seeke001, @patrickjpowers, @kelsokennedy, @abelniak, @cspenn, @simplymeasured, […]

  • Natraldi

    Thanks for that, it works perfectly. I’m only having trouble to enable the other possible column headers in Advanced Options. Could you please help me?

    • Martin Hawksey

      Hi – it should just be a case of copying the names into a cell at the top of a blank column (unless twitter have changed the mapping)

  • Patricio

    Hi! I’m trying to use your spreadsheet, but it fails. I copied both keys to the configure menu. After that, I click on “test connection” aand a msgbox replies “Authorization is required to perform that action.”. Do you know what could be working wrong?

    • Martin Hawksey

      Hi – in the spreadsheet of you go Tools > Script editor then on the dialog box that opens select Run > authorize this should valid your twitter account with the spreadsheet. You’ll then be able to run the sheet functions. Of not let me know 😉

      • Noah

        Hi, I am having the same issue but when I Run > authorize it tells me “Unexpected error: (line 566)”
        Btw it’s very generous of you to create and share tools like this, and to keep replying to poor sobs who ask you for help this far down the line! 🙂 Thanks!

        • Martin Hawksey

          Hi Noah – haven’t been able to conclusively trace the problem but think google occasionally makes a bad copy that doesn’t handle authentication properly. Solution is to make a fresh copy of the spreadsheet and start again. Let me know if still a problem

          • Jon Thomas (@Story_Jon)

            I had the same issue (566 line error), however when I checked my OAuth Settings I noticed that I forgot to put a proper Callback URL, which should be: https://spreadsheets.google.com/macros
            Once I did that, saved it, and returned to the spreadsheet, I was able to select Tools > Script > Script Editor and then Run > aTest successfully. I also made sure I was signed OUT of Twitter before doing this.
            Hope this helps,

  • Luke

    Hi – I really like your tutorial. The twitter stuff works well. Have you had success with facebook? I am trying similar approaches but haven’t yet cracked it.

    • Martin Hawksey

      Hi Luke – not tried or seen anything yet but it an area I think I’ll be looking at in the next 3 months. If you beat me to it interested in how you do it 😉

  • charlton mcilwain

    Thanks for this!
    Any chance you’ve run into this error message when running the get others followers scripts? And if so, do you know of any resolution?
    Error message: “Exceeded absolute-time timeout in milliseconds”

    • Martin Hawksey

      Does the other person have a lot of followers?

  • charlton mcilwain

    Yes, they do – 2k+.

    • Martin Hawksey

      hmm that’s probably what’s causing the problem. Need to see if there is a way to break the task up. Have to have a think short that one.
      Thanks for the feedback

    • Martin Hawksey

      @charlton and others – I’ve added a function to get lots of friends/followers. If you are already using the spreadsheet more information on upgrading here . The version linked to in this post has been upgraded. Let me know if there are any problems

  • Ryan

    Hi, when I run aTest, I got an error “TypeError: Cannot read property “statuses_count” from undefined. (line 240)”, what is this about?

    • Martin Hawksey

      Hi Ryan – It essentially means that a connection wasn’t successful with the Twitter API (I’ve updated the script to catch this error better). In the Script editor if you run aTest then View > Log what message do you get?

  • Ryan

    Thank you Martin, I have sorted out, I entered the wrong consumer key. Also, I am wondering if twitter API allows me to extract all tweets from my followers and friends?

    • Martin Hawksey

      Hi Ryan – glad it worked out. As it happens I have another sheet for capturing peoples tweets (you can use the same API keys you’ve already got). I think the Twitter API limits the return to the last 3400 tweets.

  • Wendley

    So, I’m Brazilian and not quite understand how it works, how to have a basic tutorial to show where I make my login, that holds the account you want followers, and so on. A hug.

  • Mon

    Hi, Thanks for the apps. It surely helps a lot. One quick question though, how to add advance option in the spread sheet? Do we just add it in column header?

    • Martin Hawksey

      Yes adding the advance column headers automatically pulls extra info

  • Portrait of a Twitter account: UKCLE at Danegeld

    […] analyse the community around the account range from FriendorFollow to Martin Hawksey’s Export Twitter followers Google spreadsheet or a full visualisation – see Tony Hirst’s  Twitter follower […]

  • charlton mcilwain

    Awesome! I will give it a shot. Many thanks, going to have my students make use of this in the fall. It will be a great help! One last Q – any chance there’s a way to get friends/followers of more than one person at a time?

    • Martin Hawksey

      @charlton hmm it might be possible the main issue is you only get 350 requests to the twitter API per hour so you will need to do some load balancing (working on another project right now, will come back to this depending on demand)

  • Richard O

    Thanks a lot for this! Do you know if there is some easy way to turn this spreadsheet into a gdf-file or some other file that I can read into Gephi?
    All the best,

  • Tony Hirst

    @richard Gephi will accept a CSV input file. Simplest case is two columns, representing node connected to node. If you just open the CSV file in Gephi it will create the nodes and and the edges for you.

  • Richard O

    Thank you for the response, Tony!
    I will try that. Can I load additional information about each node from a separate file?
    Thank you for a very interesting blog!

  • Angelo Centini

    Awesome tool! I was wondering about exporting data from twitter lists in a similar way. That would be really useful to analyze selected groups of tweeps.

  • Angelo Centini

    That’s a very interesting tool. However I haven’t been able to download the data as it says you cannot export data from external sources, and a list – also if managed by you – is intended as an external source. Nevertheless that’s a very nice desktop application, ty for sharing!

    • Martin Hawksey

      Didn’t know about the export limitations on SocialBro – thanks for sharing.
      Another tool I’m just about to write about is a MS Excel add-on NodeXL (only available for Windows PC). NodeXL is an advanced network visualisation tool so probably more than you need but it does have a built-in option to get list memberships (one of the Import options) which are saved to a spreadsheet (vertices sheet)

  • Angelo Centini

    I’m afraid I’m a Mac user but I’ll give it a try anyway on a PC. I have to say I’m interested in visualizations too and I’ve been playing with Gephi for several months. Although I’ve a background as a statistician I’m not a coder and one of my main issues has been data export from social networking services. And your blog has revealed to be very useful. Thanks!

    • Martin Hawksey

      @Angelo you’ll like my latest post then on NodeXL – Getting started with the @WiredUK friends network (no coding required ;). It’s a rerun of a Gephi recipe by Tony Hirst. It might be worth firing up the PC just to get the data and then export to Gephi. It is possible to run NodeXL on a virtual machine in Mac – you’ll obviously will need a copy of Win and Office though to do this).

  • Angelo Centini

    Already read it 🙂 Thank you for your suggestions, that seems a clever workaround

  • R Wood

    Hi, I love the concept but when I run the aTest I get a pop-up on the spreadsheet that reads: “OOPS – it didn’t work” and when I check the log it reads: “Exception: Unexpected error:” Any suggestions?

    • Martin Hawksey

      @R Wood did you authenticate the spreadsheet with Twitter okay?

  • john blue

    This worked without a hiccup! Utterly amazed by the simple approach (using Google Docs) to get out info. I have been using Twitter Ruby Gem (it works too) but this was way simpler for many export tasks. Thanks a bunch.

    • Martin Hawksey

      @John – thanks glad it worked for you. Loads more other stuff you can do with Google Spreadsheets and Apps Script – its a great tool for rapid development 😉

  • Mark

    Great work Martin, thank you! Easy to use and runs beautifully. Been looking for something like this for awhile now.
    If you do develop the spreadsheet to include list data as well, just a column saying which lists you have put them in that would be fabulous.

  • Mitch

    Thanks Martin, this is amazing. Exactly what I needed. Great work.

    • Mitch

      Actually, I’ve suddenly got an error saying, “The coordinates or dimensions of the range are invalid. (line 204)” yet I haven’t changed anything in the script. Nothing works. Any ideas?

      • Martin Hawksey

        @Mitch sometimes this error is a temporary fault because Google servers are playing up. One thing you could try is open the Tools > script editor run one of the menu options then check View > log to see if it says anything

  • John L

    Thanks for this.
    However, when trying to authorize the spreadsheet with twitter, I did what you said Script Editor -> Run -> aTest (there was no ‘authorization’ function). I get the message saying ‘Apps Script – Oops. It did not work’. I’ve followed all the other steps and am not sure what is going wrong.
    I am running in Firefox on a Mac.
    Thank you for your help.

    • Martin Hawksey

      @John L I think its due to turbulence on either Google or Twitter servers preventing the spreadsheet to connect properly. Afraid I’ve got no better solution than trying again later

      • John L

        I tried it again on a different day and time using Chrome instead of Firefox. Still had the some problem. Oh well.
        Anyway, thanks so much for replying. I really appreciate it.

        • HD

          Hi John and Martin,
          I just had the same problem with the ‘Apps-Script Opps’ message. I finally went to Tools -> Script Editor, Run -> Authorize and then it fixed the problem. I guess I must have missed that in the original instruction.
          Hope that helps for others with the same error message.

          • HD

            ps this is absolutely awesome. I just downloaded 23,000 twitter followers of a company I want to analyze – amazing!

  • Alix Rivera,

    Thanks a lot for your great job. I did everything as you explained above, and I have no error message at all.
    Nevertheless I can not find where is my list.
    I might sound stupid, but all I have is a small yellow message saying: “Running script getFollowers”
    I have more than 30K followers, and I guess it will take some time to show the full list, but after 2 hours, there is nothing else but the yellow message.
    Do you think I did something wrong?
    Thank you in advance for your help.

  • Alix Rivera,

    Oh, Now I got the list. This is awesome!
    Thank you very very much!

  • Benoît Perrier

    Wow, this is brilliant. Thank you so much. I was desperate seeing that tweetake.com was down. Rhis replaces it perfectly.

  • Twitterbereik in Google Maps | WOID

    […] de slag wilt gaan met data van je twittervolgers en vrienden dan kun je de Google spreadsheet van Mashe gebruiken. Het is een beetje puzzelen en dan kan je bijvoorbeeld via Batchgeo je volgers in […]

  • Clay Hoffman

    Whenever I run aTest, I get an error saying, “Oops it didn’t work” or “Opps, Authorisation is required to perform that actions” but it doesn’t give me the option to authorize it.

    • Martin Hawksey

      Have you done the ‘open tools > script editor and run authenicate’ bit?

  • Clay Hoffman

    i don’t see authenicate, just configuration and get follows and friends types of scripts

    • Martin Hawksey

      Hmm there should be two athenicate functions in there (either will work) not sure why you can see other code and not these – usually if its a bad copy none of the code is there

      • Clay Hoffman

        I just deleted and made another copy of your spreadsheet. Still not seeing any athenicate functions.

        • Martin Hawksey

          Is it the same problem if you run aTest in the new spreadsheet as well?

          • Clay Hoffman

            Yes it is.

          • Tzcttwitt

            The authenticate function is gone.
            I copied the spreadsheet a couple of times and saw same symptoms as Clay Hoffman.
            I reviewed the code of the script and it has no authenticate or similarly named function 🙁

          • Martin Hawksey

            Hi – I’ve put a new version of this spreadsheet up. It has improved code for getting the data from Twitter. If there are still problems let me know

  • Clay Hoffman

    I see the authorize script now, but when I run it I keep getting “Unexpected error: (line 580) Dismiss.
    This is whats on line 580-585
    var result = UrlFetchApp.fetch(
    var o = Utilities.jsonParse(result.getContentText());
    ScriptProperties.setProperty(“STORED_SCREEN_NAME”, o.screen_name);

    • Tzcttwitt

      Me too 🙂

      • Martin Hawksey

        Sometimes I think google doesn’t copy the authorisation tokens from twitter properly which leaves you in limbo with a half authenticated script. I’m afraid the only way I’ve found to get around this is to make a fresh copy of the template.

  • Joel

    This script is great, and I appreciate all the work that you have done.
    I looked through the comments, and it looks like other people aren’t having this issue, so I’ll see if I have something set up incorrectly. But, when I run the “getLotsOfFriendAndFo”, I get an error that says “ReferenceError: “users” is not defined. (line 172)”. Line 172 says: “var chunks = chunk(users,100);”. I am using V2 of the spreadsheet. I have tried on a couple of copies of the sheet. I am also trying to pull in someone elses followers. It works when I use the “get other persons followers” from the twitter menu, but it’s been timing out because of the volume. Any help would be appreciated, although I completly understand that you don’t want to spend a ton of time troubleshooting a free script you made.

    • Martin Hawksey

      Hi Joel – As you asked so nicely I had a look and there was a problem with the script. I’ve updated the code so if you grab a new copy of v2.1 it should work (fingers crossed – and if it doesn’t let me know 😉

  • Jonah Keegan

    Martin, for advanced, do I just need to add the field name to a new column in the spreadsheet? I want to add
    to my export. Thanks!

    • Jonah Keegan

      I think I’m actually looking for
      (the timestamp for the follow request YOU sent to a friend / someone you want to follow)
      I think follow_request_sent is the timestamp for follow requests from YOUR followers?
      Does the following timestamp exist?

      • Martin Hawksey

        Hi Jonah – you are right in that putting follow_request_sent as one of the headers means that data is populated. As you have probably discovered now this only returns true or false. The data returned by the bit of the API used in this solution unfortunately doesn’t include a following request timestamp (if this data is important to you, you might want to look at the socialbro.com app)

  • Johan Myrberger

    Nice stuff, works like a charm!
    In order to visualize the network in gephi I’d like to also include the friends/followers relation among all friend/followers for a Twitter account. (Ie not get the complete list of all their F/F, but only the interconnection between the listed ones)
    Is this something you have looked at?

    • Martin Hawksey

      Hi Johan, I do have a script which constructs friend follow relationships but its very restricted in how many relationships it can manage (e.g. ignores relationships over 5000 and can only manage base networks of 300). What I’ve done in the past is use NodeXL. The import via twitter list lets you paste a list of username you want to get relationships for and generates an edge list, which can either be analysed further in NodeXL or exported to gephi)

  • Almir Souza

    Hi Martin, how are you?
    I configured everything according to the steps and I have no error message at all, however, can not download my complete list of followers.
    After all set performing “getFollowers” and showed that first run in the bottom right a message 100 to 200 of 148000, but when he arrived in 4900 to 5000 of 148000 the system kept running and not download anything. I redid the process a few times and still managed to download about 26,000, but 122,000 still missing. I did something wrong? I left to do something? What do I need to get the 148,000?
    But without doubt the tool is fantastic!

    • Martin Hawksey

      Hi Almir, this tool is mainly geared around a 5000 follower max. There is a supplemental script in Tools > Script editor … called getMoreFriendsAndFollowers which can get more but is limited by the google spreadsheet maximum of 400,000 cells (with the number of columns used its around 40,000 twitter account details

      • Almir Souza

        Martin, thanks for the help. I looked in Tools -> Script Editor -> getMoreFriendsAndFollowers, but I found this script, it does not exist for me, at least by that name. For me there and getAnotherFollowers getLotsOfFriendAndFo. It is one of these two?

        • Martin Hawksey

          Sorry don’t know my own scripts 😉 yes it’s getLotsOfFriendAndFo

          • Almir Souza

            Hahahaha … okay! It happens. So, I tried that too, but does not return all my followers. He lowers 5000 and the first stop. Then re-run the scrip getFollowers and returns the message “Oops!
            Exceeded maximum execution time. “Then I ran the scrip getLotsOfFriendAndFo you said, but nothing happens. What is the procedure? I’m sorry to bother.

          • Martin Hawksey

            To use this new code you need to enter the following information directly into the script editor where prompted in the getLotsOfFriendAndFo function:
            sheetName – sheet name you want to import the data to;
            friendOrFo – whether you want ‘friends’ or ‘followers’; and
            optScreenName – the screen name of the person

  • Almir Souza

    Hi Martin, how are you? Happy 2012!
    Man, I’m picking up the same child to extract all the data. For this tool will be to extract that really gives my 150,000 followers?
    I was downloading the data and I returned the message limitation 400,000 cells from there I created a new worksheet and the worksheet name added to the scripts and getFollowers getLotsOfFriendAndFo script editor and yet the same message appears.
    Any other alternative?

    • Martin Hawksey

      Hi when you reach the 400k limit make a copy of you original spreadsheet then remove the existing imported data and continue running the getmorefriendandfo script (you can rejoin the data by downloading as .csv and pasting together in Excel)

      • Almir Souza

        And clearSheet use the function to remove the data?

        • Almir Souza

          I just do what you said.
          Step 1: I ran getFollowers the first time and fell 5000 followers
          Step2: getFollowers ran a second time and fell over 5000 followers
          Step3: In the third execution getFollowers returned the message had reached the limit of 400k
          Step4: I made a copy of the worksheet and then it performed the function clearSheet to erase the data that had previously downloaded
          Step 5: Ran getLotsOfFriendAndFo, however, limit 400k message back to present, once again ran the function clearSheet and yet the message continued … ?

      • Almir Souza

        I just do what you said.
        Step 1: I ran getFollowers the first time and fell 5000 followers
        Step2: getFollowers ran a second time and fell over 5000 followers
        Step3: In the third execution getFollowers returned the message had reached the limit of 400k
        Step4: I made a copy of the worksheet and then it performed the function clearSheet to erase the data that had previously downloaded
        Step 5: Ran getLotsOfFriendAndFo, however, limit 400k message back to present, once again ran the function clearSheet and yet the message continued … ?

        • Martin Hawksey

          Guessing Google doesn’t realise the sheet has been emptied. When you get to step 5 and get the 400k message close the spreadsheet and reopen it – getLotsOfFriendAndFo should remember where it was up to

          • Almir Souza

            Martin, could extract here. Thanks again for your help! The tool is amazing!
            Where are you from? And it works with what?

  • Sarath

    Hi Martin,
    It is not working for me. Getting error “Oops! exceeded time”
    Also, can you please tell how to export it in excel

  • pat

    Howdy Martin,
    First off, WOW! This is amazing.
    I’m running into one problem:
    I’m using the “Get other persons or followers” down the Twitter drop-down menu and it queries about 3400 users then returns this error:
    The coordinates or dimensions of the range are invalid. (line 323)

    • Martin Hawksey

      So it appears the method for creating new sheets in Google Spreadsheets is currently borked, so I’ve come up with a workaround that fixes it. Use the original link at the beginning of this post to get version 2.1.2

  • ahmad

    I am also trying to download more than 5000. Everything seems to work except it keeps downloading the same set of 5000 over and over again. I rerun GetLotsOfFriendsAndFo and just keeps downloading the same batch. Hmm. Any suggestions.

    • Martin Hawksey

      Hmm not sure why this is happening. Important thing is to run getLotsOfFriendAndFo() from the script editor window. if you don’t this might send you into a loop

  • Mi experimento Twitter. - El Planetahuevo

    […] me permitirá aprender a manejar las listas, algo que hoy por hoy no hago en absoluto.Utilizaré esta herramienta para exportar los seguidores cada día antes de añadir los 100 nuevos, para luego estudiar la […]

  • David Eedle

    This is one of the neatest uses I’ve seen on Google Docs. I was about to sit down to rite API calls to pull lists of followers for a bunch of Twitter accounts, and instead came across this spreadsheet
    Great work!

    • Martin Hawksey

      Thanks David (I take it it’s working okay for you – other people are having problems?)

    • Raymond

      Please if this worked for you can you tell me how I can lay my hands on this with detailed instructions on how to make use of this?
      I need to get a list of all my followers for my two accounts.

      • Martin Hawksey

        Check out socialbro.com Think they have export options

  • Karen O'Rawe

    This is probably a silly question but when I try to get other person’s followers I get ‘This users account is protected. Data is not available’ however the Tweets are not protected. I’m guessing that I am missing something obvious. Please could you help me?
    Thanks for a great post – Very useful.

    • Martin Hawksey

      Hi Karen – not you being stupid but me. There was a bug in a fix I made. If you make a fresh copy of version 2.1.2 (fingers crossed) it should work.

  • Winton

    Amazing! saved me a whole lot of time. Thanks!

  • How to map an influencer's network? - ident{een}ityident{een}ity

    […] of using Python to scrape data from Twitter, I followed a tutorial posted by Martin Hawksey on how to extract Twitter friends and followers using Twitter API and Google Spreadsheets. Using this technique gave me the following information about the people that danah followers on […]

  • Aaron S

    Jon Thomas (@Story_Jon) You rock! The call back URL was the fix to help me authorize the app.

  • Morten

    Hey, did you ever fix so you can download more than 5000 tweets? Mine isn’t working either, but great job making this, tho 🙂

    • Martin Hawksey

      @Morten it should be able to work with over 5000 but you need to configure the getMoreFriendOrFo() function in the script editor – there’s documentation on my site somewhere ;-s

  • Notes on extracting the JISC CETIS twitter follower network – MASHe

    […] The musing of Martin Hawksey (EdTech Explorer)HomeGoogle Apps Script ExamplesExport Twitter Followers and Friends using a Google SpreadsheetTurning Google Spreadsheets into a personal or group bookmarking serviceCollecting any data in a […]

  • Linklove Boston 2012 Recap | distilled

    […] like to use Followerwonk for this, but that only works if you have the paid version. So you can use this free Twitter export tool. You can stalk the big news publications by searching for location-specific people based off who […]

  • John

    This is a very helpful tool.
    For my study, I need to have not only the friends and followers of a specific screen name but also the ‘friend’ and ‘follower’ connections between those. Does anyone know of a script that will download this type of data from Twitter? I know that Is there a NodeXL provides this option but, unfortunately, it is extremely slow…
    Any help or guidance with this will be greatly appreciated.

  • Optimize Your Link Building with Twitter

    […] to run reports for large. My limited coding skills only got me so far but then I found this great Twitter Followers Google Doc that does everything for you.Setting Up the Doc for the First TimeMake a Copy of the Spreadsheet […]

  • Steve

    Hi! When I try to load the Twitter menu, I get an error message Script function onOpen could not be found. Any suggestions? Thanks.

      • Steve

        Yep, did that. More than once. Tried it in IE and Opera using different google accounts and get the same message.

        • Martin Hawksey

          There appeared to be temporary server issues with Apps Script in the last 24 hours

  • abdul

    Thanks for this great tool
    it really helped me a lot in colecting data. However, I’ve tried get other person follower but the max it could get is 5000 then i tried to do it again for the same person but i couldn’t. Plus, i’m afraid even if it did, it’ll get the same first 5000 again which wont be very helpful for me.
    could you plz let me know if there’s another way around it so i can get all the followers of another person
    again thank you for this powerful tool

    • Martin Hawksey

      Getting more than 5000 is a pain but possible. The answer is in this comment thread 😉

  • matthaeus

    amazing work

  • luis

    I was confused about how to get other kind of data like the other column headers you mentioned. tried changing values in the sheet but got empty results.. so how exactly can one add other columns for the other values?

    • Martin Hawksey

      Hi Luis – was there a particular column you were trying to add?

  • Nina

    Thank you for this!!!
    Help, please. I need to use one of the advanced options but I’m not sure if I’m doing this correctly. I created a new column in the Followers sheet and named the header status_in_reply_to_screen_name . Am I missing something? Cos this method is not working for me.

  • Wayne

    Hi :). Is there a way to run the script again and only add new additions? Rather than adding the entire list again and having duplicates?
    Thank you by the way this has already saved me a TON of hours!

  • Raymond

    Hello, gone through the post and still didn’t see a means of extracting just my followers list. Anyhow anyone can help with that for me? Thanks

  • charlton

    Hi Martin – a question for you a bit off topic here. Twitter’s data column gives a date/time value. Do you know of any easy way to convert that (from Excel) to a time interval such that it can be used for dynamic analysis?
    Many thanks,

  • Anon

    Such a shame they made you remove this sir – used to be an excellent tool!!

  • Norbert Herman

    Hi Martin, your script is awesome and I got it working in the end, but with a little glitch. I suggest you amend the instructions:
    Step 4.5 While in the Script Editor mode, select Run > authenticate
    Step 6.5 Back in the excel file select Twitter > Test Connection – you should get back a message stating “Connected to Twitter Successfully”. If you do not get this message, check to make sure you have the call-back URL filled in on our Twitter App Settings – make your call-back URL the same as your website URL even if its a fictitious one for the time being

  • Taimoor

    Thank you! I’m also searching for a way to get emails of all my twitter followers. I can create a new landing page, but it will be much time consuming.
    Well thanks!

  • Dave

    Hi Martin
    Following your instructions but the twitter dev site won’t accept – Callback URL = https://spreadsheets.google.com/macros as a valid URL, what am I doing wrong please?#

  • Stacey

    I keep getting a
    APPS Script
    OOPs it didn’t work message
    any ideas?

  • Robi

    If the user has more than 100k follower, how to get only the first 5000 follower ?

  • Régis Chaigne

    Got some difficulties (wanted to go too fast…) but coming back to the tutorial everything is well documented.
    Did not work in Opera, worked fine in Chrome.
    Awesome result.
    Thanks Martin !

  • Jessica

    Amazing script! This is exactly what I was looking for. Thank you for putting it together. Love the ability to add columns.

  • Willem Karssenberg

    Works great, but how do I add more column headers?
    I cannot figure thet out

    • Willem Karssenberg

      Sorry, found the answer in the comments already!

  • Stefa

    Request failed for returned code 410. Server response: {“errors”: [{“message”: “The Twitter REST API v1 will soon stop functioning. Please migrate to API v1.1. https://dev.twitter.com/docs/api/1.1/overview.”, “code”: 68}]} (line 585, file “Twitter Script”)

  • Stefan

    I am getting an 410 error when running the Authenticate function
    Request failed for returned code 410. Server response: {“errors”: [{“message”: “The Twitter REST API v1 will soon stop functioning. Please migrate to API v1.1. https://dev.twitter.com/docs/api/1.1/overview.”, “code”: 68}]} (line 585, file “Twitter Script”)

    • Jules

      Same, Stefan…

  • Cristian

    The spreadsheet has not retrieved any followers since the migration to the API 1.1. Will an updated version that interacts with the new API be available at some point?
    Thanks a lot for this, it is a great tool!

  • Jules

    I fixed it – go to script editor and “find” all instances of “/1/” (there should be 2) and “replace” with “1.1”. Tada!!!

  • Cristian

    Jules–thanks, I actually noticed that someone has updated the code in the public Google Spreadsheet file. However, I am still having problems getting it back to work. Have you been able to use it and regularly download data in the current version?

  • Jules

    Jules, I think something may have changed. When I run the script, it now says that there are no new users. Did someone change the script on the public spreadsheet.

  • Cristian

    Thanks Martin–it does work fine now!

  • Rich

    What a great spreadsheet Marting! Question, can it be modified to get the time of the last tweet?

    • Martin Hawksey

      It could. Just requires another API call (this is not a feature I’m interested in adding)

  • Rich

    Sorry about the extra “g” in Martin.

  • How Can I (Re)Publish Tweets? | Be Helpful

    […] Google Docs can be used as a coding platform for accessing Twitter. This approach does require a willingness to dive into some configuration and maybe some software code. […]

  • whoisrobert

    Hello, I was wondering what a callback URL is? what do I use for that.

  • ashwini

    can i get the emails of my followers through some API call? Is that facility availble on twitter? I am urgent need of it.Any way or any link

    • Martin Hawksey

      Email addresses aren’t accessible via the api

  • Andrew Gotobed

    In theory Martin would it be possible to create something similar to this, but set it to grab via location? For instance, list all my followers in London UK?

  • Free SEO Tools | What Is Search?

    […] Export Twitter Followers Using a Google Doc export your Twitter followers using the Twitter API. Check your data. […]

  • Bong

    I am getting error when I run aTest ” OOPS-it didnt work..” . I am missing something

  • rog

    Brilliant stuff, thanks a million!
    Now if only there was some way of making it send DMs – I’m not a spammer, I run the twitter account for a local group and could do with advising our followers of new campaigns a few times a year.

  • Nazbir

    I just want to say, thanks a lot man. You script is working like a charm! Now i have my own app on Google drive to analyze my twitter account.
    Thanks again, you rock 🙂

  • Per Pettersson

    Really neat way of using the data and spreadsheets! Thank you for this.

  • Evielyn Chapman

    Thanks for this! This is why I love Google Apps… been searching for a way to download a csv file of my followers with no luck & then thought maybe Google Apps? Would it be OK to link back to this article from my blog?

  • charlton mcilwain

    HI Martin. I’ve used this before you received the Twitter admonition. Glad to see it’s Back. Is there still way in the new version to search for Tweets with other search operators – hashtags, keywords, etc.? Or will this only do friends/followers data?
    Many thanks!

  • Jan Tijssen

    It looks so nice, but somehow I do something wrong. When I run “authorize” I am running in an error at line 585. Can somebody please explain. I am just doing whats instructed, I do not have experience with these kind of interfaces, but I really looooveee the functionality.

  • andreafuller710

    I’m having the same issue Jan. Have you figured anything out?

    • tom

      same issues here too

  • at{mine}

    Hi I tried to configure the twitter API using the instructions below but it keeps telling me that I have an invalid URL formate to do it…any help would be appreciated! Thanks!
    1. Register for an API key with Twitter at http://dev.twitter.com/apps/new (if you’ve already registered a Google Spreadsheet/Twitter mashup you can reuse your existing Consumer Key/Consumer Secret). In the form these are the important bits:
    – Application Website = anything you like
    – Application Type = Browser
    – Callback URL = https://spreadsheets.google.com/macros
    – Default Access type = Read-only
    2. Once finished filling in the form and accepting Twitter’s terms and conditions you’ll see a summary page which includes a Consumer Key and Consumer Secret which you need to enter below
    3. When your Key and Secret are saved you need to open Tools > Script Editor … and run the ‘authenticate’ function

  • themadething

    You are an absolute GENIUS. Thank you so much! Your directions were also tremendously clear for someone like me who knows nothing about scripts or code and super easy to follow. Thanks again!

  • Robin Drew

    This is an awesome app.
    I’m trying to use the ‘GetLotsofFriendAndFo’ function and I’m running into a problem mentioned above, but I don’t see a solution.
    The first time I ran it, it asked for the user etc that I wanted to target. Since then though that same form has not reappeared, so every time I run it it downloads the same users. I’m not even totally convinced that the users it’s downloading are of the account I originally put in.
    Any way around this? A way to reset it perhaps, or to see what account it’s targetting?

  • dinos

    Hi, good script!
    One question for you: getting the followers of another user (about 9000) i can obtain always the first 5000. Why? there is a way to obtain the remaining followers?
    thanks a lot

  • Kim

    Hi Martin,
    Thanks for providing this! When I try to Run: Authenticate I get this error: OAuth Error (line 585, file “Twitter Script”)
    Would love any assistance with this 🙂

  • Michelle

    Hi, i know that you have to give permission and others can automatically look at your documents- I got up to the point that said run atest and found that two other who were not identifiable had revised the script in that time and also it said the test failed too! Any help ? Slim chance I know. Also any idea of what those people might have done as i was logged in via my personal account!

  • anon

    Hi. I’m not at all technical but followed your instructions and exported the data that I wanted first time. Thanks v much for building this sheet – much appreciated 🙂

  • Keval

    Hello! I was able to retrieve all the followers of my account and am trying to get all the followers of my followers. It seems that I am able to do it by manually entering the username of the user whose follower’s I am interested in. But I am looking for followers of all my followers and manually entering each one would just not be feasible. Is there any work around for this or any script that I could run which gets me the data?

  • Dr Ray

    If it worked for me, there is hope for anyone. Thanks Martin. I take it that there is no way to get email, phone number or to separate the name as “First name” “Last Name”

    • BlackATL

      Just downloaded Version 3.0 but I’m getting an error:
      ScriptProperties API is deprecated.
      File: Twitter Script Line: 175
      What should I do?

      • Martin Hawksey

        Hopefully fixed in latest version

  • BlackATL

    Downloaded version 3.0. Getting the following error:
    ScriptProperties API is deprecated.
    File: Twitter Script Line: 175
    Thanks for all your hard work!

  • richg41Rich

    Find the spreadsheet seems broken. I get the following error: There was a problem
    Script function setup could not be found!

  • Charlton McIlwain

    running the newest version, I get this error message when I try Twitter>Configure: :”Script function setup could not be found”
    Any ideas?

    • Martin Hawksey

      When you open Tools > Script editor in your copy is it version 3.0.2? It might be that you got a duff copy in between updates. I’ve just tested and the setup runs fine

      • BlackATL

        I’m having the same problem. Everything under the Twitter pulldown returns “Script function could not be found” (with the name of the particular function included in the error message). I am using a fresh copy from version 3.0.2.

      • BlackATL

        Haha. Those error messages have stopped. Now I’m just getting the “no new users” messages.

  • Charlton McIlwain

    should the get other persons friends/followers work? I can get my friends/followers no problem, but when I try the others the tab pops up that says looking for data, but then doesn’t return anything after that.

    • Martin Hawksey

      ok – so looks like there were a couple of things to fix. Updated now to version 3.1 (fresh copy of the template required). This update should also fix getting other data like status_created_at into the sheet)

      • BlackATL

        I can’t figure out what I’m doing wrong. I opened your sheet, made a copy, then selected “Test Connection.” Initially it doesn’t work but if I wait about 30 minutes, the connection tests successfully. However, none of the functions to get followers work for me. They always return “All done – no new users.” I’m using version 3.1. Any suggestions?

        • Martin Hawksey

          So not even getting your own followers works? You can try Tools > Script editor and Run > getFollowers when it finishes you can View > Logs to see if any errors have been thrown

          • Martin Hawksey

            Looks like you haven’t run Twitter > Configure from the sheet. If you run this what does it say?

          • BlackATL

            I’ve been using your sheet for about a year. It stopped working recently. When I select Test Connection, it always says I’ve successfully connected to Twitter but all the functions return “No new users”. When I select Configure, the API fields are empty (though I registered a long time ago). When I click the registration link you have in the instructions, it takes me to a page that says Access Denied.

          • BlackATL

            I created a new API Key. All is working again. Initially couldn’t get 3.2 to accept the Key (nothing would happen when I clicked the Next button). Went back to 3.1 and was able to enter it there. Now the saved API works with 3.2 Thanks again for all your work!!

          • guidelikeyou

            Thanks for your reply Martin ! I managed to go a bit farther… I have my api key and secret. But when I put it in the configure section of the spreadshit, I can’t click on next… The only solution I have is quitting. Then, if I run the Get followers or Get friends nothing happen. But this is normal i guess since I did not manage to validate the previous step. If there any chance you can help a bit more, i’d be very grateful 🙂

          • Martin Hawksey

            there was a bug with the next button which is fixed. Take a fresh copy of the template and you should be able to set it up properly

          • Martin Hawksey

            ah – okay found and fixed a bug that prevented the next button working

          • guidelikeyou

            Yay, well done Martin, it workd fine ! And it was super easy. Cheers !

  • guidelikeyou

    Hi Martin, Thanks for this tuto but I cannot run it correctly for some reason (I am not IT at all, more marketing like..). I have the twitter tab, when I click on configure, I get an error “cannot find the function of Script set up”. Not sure where to find the key and and Secret Twitter then… Can you help?
    (OMG, you’ve been commenting on this for the last 3 years… impressive!)

  • E o'B

    Firstly thanks for the spreadsheet and supporting it for so long.
    Question for you, i’m looking to come up with a simple method (that i can set up and walk away from) to export the follower_count and statuses_count for 10 different twitter accounts, While i can get this info using “get other followers” account by account on your spreadsheet I am then faced with a tonne more info than is required (all the followers details). Not the end of the world but running this on 10 accounts, all with 3000+ followers takes quite some time.
    I was wondering if i achieve this by scripting in a “Get Following” option to return only the details on the 10 accounts i follow, would this be against the twitter api terms and conditions (the reason i assume a function like this is not already included). Any info on this would be much appreciated.
    (I realize that i could achieve what i’m looking for by having the 10 accounts follow one specific account i’d set up for only this purpose but i could see this causing me future issues due to having no real control over who is following the account.)
    Thanks again.

  • JB

    Hey! Thanks so much for supporting this. Is it possible instead of using the url field, it can use the expanded_url field? Right now the urls are the t.co short links that mask the url that appears on the users profile (or when the link is resolved).

    • Martin Hawksey

      It is possible but you’ll need to modify the code in Tools > Script editor. Look for lines (two occurences) that include TwtrService.get("users/lookup" and in the for loops after them add the line before the data.push with o[j].expanded_url = (o[j].entities.url) ? o[j].entities.url.urls[0].expanded_url : null; (in the second instance replace the o with d e.g. d[j].expanded_url = (d[j].entities.url) ? d[j].entities.url.urls[0].expanded_url : null;. Finally add a column called expanded_url

  • Katie

    Works beautifully several times over! Thanks for devoting so much time to making this work.

  • Mike

    Thanks Martin. Fantastic! It’s just what I needed to sort out my contacts and keep track of my direct Tweets.
    In case it helps anyone who is not familiar with API registration, the ‘API Secret code’ is displayed on the ‘Keys and Access Tokens’ page of the Twitter Application Manager.

  • Mike

    Hi Martin,
    Forgive me if I am being stupid but is the data available to be able to add a column showing the Twitter profile url for each contact? I would like to be able to click on a link in my spreadsheet that would then allow me to go to a Followers Profile page, so I can then send them a Direct Tweet.
    Kind regards

  • Sam

    Hi Martin, I used the older version a few months ago and it worked a charm, really grateful thanks. However it stopped working today so I had a look at this blog and noticed it has gone up to v3.2. I’ve downloaded it and done all the setup but it won’t function for me.
    I’ve authenticated etc and done a ‘test connection’ to see message Connected to Twitter sucessfully with XXXXXXXXX
    However when I run ‘get followers’ or anything else I see the message ‘Looking for data…’ for about 3 seconds, it disappears and nothing happens. Any tips? Thanks in advance

  • Diana

    Hi Martin,
    Thank you so much for this app. I’m using it to collect data on other users’ friends for a network analysis and it worked wonderfully 93 times (i.e. for 93 Twitter users), but I seem to have hit a wall. I’ve re-copied the doc, used a different Twitter key and secret, used a different gmail account’s drive, and waited for a few days between tries, but it’s no longer returning the data. The script will start to run but then will just time out. Do you have any suggestions? Thank you so much in advance!

    • Martin Hawksey

      In the spreadsheet if you open Tools > Script editor and Run > one of the functions one of the other drop down menu options is to View > log (or something similar) this may reveal more about where the script is going wrong

  • Samer

    Dear Mr. Martin
    Thanks for creating such an amazing application. I have a question with regard the usage capability of your tool. I have a list of more than 1000 usernames/screen names of twitter users and I am interested in collecting their friend info only. I know your tool can do that, but I have to type each person name to get their information. The question is can I supply your tool somehow with the list of the users and it collect the data instead of typing in one user a time? any help is appreciated in advance as this will be used in my research and a citation to your tool will absolute be provided in my research.

    • Martin Hawksey

      Hi – the tool could be set up in this way but twitter imposes restrictions on how much data can be collected per every 15 minutes. For friend/followers you can make 15 calls/15 minutes returning 200 user account details https://dev.twitter.com/rest/public/rate-limits

      • Samer

        Hi Martin, Thanks for the reply. I know twitter have this restrictions but I was wondering if there is a way to make it automatic i.e. like NodeXl which collect data then wait some times then collect data again. I used NodeXl and provided it with a list of users which gave me all the info I was looking for but the problem with NodeXl is slow and give me more than what I am looking for. If it is possible to do the same task with your tool how can I do it please?

        • Samer

          Also, if I have the list of users how can I provide them to the tool. I tried copy pasting some users but I end up with an error.

        • Martin Hawksey

          Out of the box this tool wouldn’t do it and would need extra code. If the extra code was added I don’t think it would be any quicker than NodeXL as it uses the same Twitter data points with the same restrictions

  • Cristian

    Hi, I have used your spreadsheet many times and has always worked perfectly, but now I am having problems. When I try to authenticate after entering my API credentials I get the following error message: “TypeError: Cannot call method “getRange” of null.” I have tried with three different browsers and three different Twitter apps but the problem will not go away. How can it be solved? Thanks!

    • Martin Hawksey

      Hi – there was an issue with the script. If you retry to authenticate now or should work

  • Annegret Linder

    Dear Martin!
    First of all: Thank you so much for your work! The spreadsheet already saved me tons of time (or money). 🙂
    I do have a little problem with the advanced options. I added a column in my spreadsheet with the followers by another Twitter user and tried to reload the data, but the columns stay empty no matter what I do or how Ilong I wait. Am I missing something? I just need to get the URL to the follower’s profiles and I’m the happiest employer on the world today. 🙂
    Thank you, thank you, thank you and sunny greetings from Germany!

    • Martin Hawksey

      To get followers of another user you need to use the menu option … or am I missing your question?

      • Annegret Linder

        Hi Martin!
        I managed to get the data for another Twitter user, and I also added columns for example for verified/not verified. But it seems to be the case that the column for the link to the user profile does not work properly. The data does not load.
        Besides that everything is great! 🙂
        Thank you

  • Billay

    Wanted to be sure to Thank You for making this product. It has saved me a ton of time. I was on a mission to figure out how to get followers/following from a twitter account when I ran across your template. It would have taken me many hours to figure out how to do this. You made things so much easier.
    I’m not sure if I saw this mentioned somewhere in the comments or if you’re aware it does this, but before trying your getlotsofFriendsorFo script, we decided to run that same spreadsheet name again for an account that has 15k followers. To our surprise your coding remembered the twitter cursor and bought back the rest of the records in 3 batches. I’m sure using your getlotsofFriendsorFo script would be beneficial for larger accounts resulting in less batch runs, but this was Outstanding!
    Thanks again,

  • John

    Hi, thanks for what seems to be a great tool!
    I’ve tried following the steps, but when it attempts to authorize my Twitter account it says that “Having multiple Google accounts will interfere with the authorization” (paraphrased). It suggests opening an Incognito window, but when I run the script there I get the same results. I can’t get through that screen to the next step.
    Also, what steps are needed to completely uninstall everything once I’m done?

    • Dan

      I have this same problem too. Is there a way to fix this?

    • Martin Hawksey

      What browser version are you using? Multiple google accounts aren’t an issue if you are running the script against your default account.
      I’ve added a menu option to disconnect twitter access. Take a fresh copy of the template to use it. As personal access details are stored centrally running this in one sheet deletes details for all (I should add the way access details are stored means as the project owner I have no access to them, they are stored by Google associated with your user account)

      • John

        Hi Martin,
        I am using the latest version of Google Chrome [Version 42.0.2311.90 (64-bit)].
        I couldn’t get your Spreadsheet to work, as mentioned in my previous post.

        • Martin Hawksey

          ah – think I’ve spotted the problem. There were some changes Google made that I didn’t push to this version. If you take another copy of the template (sorry) it should work.

          • Keith

            I’m having the same problem with the 3.2.2 version. Did this get resolved? I’ve tried with different browers and making new copies of the google doc. It seems to hang up on that “multiple accounts” page and doesn’t move on.

  • Bain

    Thanks for sharing this. I’m not a programmer (and don’t even play one on TV), so there is no way I could have done this myself. (Well, I suppose if I spent a few months learning to code…) You’ve saved me a ton of time. Thanks again!

  • Sam

    Hi Martin,
    Thank you for your tool, the instructions were very easy to follow!
    However, it pulled 5 times as many followers then we actually have. What could be the reason for this?

  • Austin Burbridge

    This tool has been working very well — until a few days ago. Suddenly it has started to pull many duplicate records, etc.

  • UCAudio

    Can this be tailored to export all tweets you have favorited along with the username of the person who posted the favorited tweet? Thanks!

  • dany_danay

    Thanks a lot for your work!
    I have a question/problem.
    I want to extract lots of followers from an account, i try this:
    If you get a ‘Exceeded absolute-time timeout in milliseconds’ error message there is a manual function in the script editor called getLotsOfFriendAndFo(). To use this clear any existing data imported to the particular sheet and enter the following details into the function in the script editor:
    sheetName – sheet name you want to import the data to;
    friendOrFo – whether you want ‘friends’ or ‘followers’; and
    optScreenName – the screen name of the person
    To run the script Run > getLotsOfFriendAndFo as many times as needed (the script will import 100 friends/followers at a time) or if you want to go away and make a cup of tea use Triggers > Current project triggers and add getLotsOfFriendAndFo as a time-driven function to run every minute (once you’ve finished your tea best to delete this trigger).
    With NO results…
    sheetName – sheet name you want to import the data to;
    Its a new spreadsheet created in google drive or what?!?

    • Martin Hawksey

      you need to be a bit more leisurely – twitter rate limits this data. I can’t recall the actual limits (might be captured in the comments), but running every 15min should do it

  • Lizzie

    I love the concept of this tool! I’m a beginner trying to follow your instructions… I get to the point of creating my twitter application and can’t go any further because the following error message appears:
    The client application failed validation: Not a valid URL format
    I think my issue is that I don’t fully understand what I am being asked for here, but can you help explain please so that I can create the required coded to continue?
    Many thanks

  • Alex

    Hi, sorry if I’m missing something, but I’m trying to grab a list of another user’s followers. It works at first then times out after successfully grabbing 5000 followers. It tells me to run it again to get the rest (a further 3000 ish), but nothing happens when I do – can’t get those last 3000. Any tips?
    Many thanks

  • peconi

    your script is not working anymore: trying to get other persons followers I get this error message: “Script is using OAuthConfig which has been shut down. Learn more at http://goo.gl/IwCSaV
    The version I’m using is 2.1.2

  • mark

    im having an issue with downloading once over 5000, like mentioned i use the script editor and i manage to get on occasion around 20k on one sheet, i copy what i have into my excel sheet, clear the current sheet and reload the page, i then run script again, it says it downloads them and no errors come up and all the extra cells are there so the row goes down to about 20-30k, or more depending on how many times i run it, however not data is showing in any of the cells?

  • Alejandro

    Hi Marti, thanks for sharing this hack.
    I’ve tried following the steps, but when it attempts to authorize my Twitter account it says that:
    “Twitter Authorisation
    Please be aware that if you are logged into multiple Google accounts authentication may fail. You can either log out of other Google accounts or use an incognito window.
    “Oops something went wrong. Twitter says: Desktop applications only support the oauth_callback value ‘oob’ /oauth/request_token”
    Can you help me to resolve it?

    • Bill D.

      Same. Anyone know how to fix that?

  • Dan W

    Just wanted to say a big thanks for sharing this. Really useful and easy to use (even though I did get it wrong a couple of times – user error though, not your fault!)

  • JM67

    I wanted to try your last script before use the manual function (the first doesn’t work even with your instructions) but the connection with Twitter didn’t work.
    I try the test Twitter Connection and I got the message “Ooops It didn’t work.
    But I was connect with my Twitter account.
    What could be wrong please ?

  • Thomas

    Very useful, thanks for sharing this.
    Are there any functions available to export Twitter list members?

  • Mike S

    Thank you Martin. Brilliant!

  • Josie

    Thank you so much ! Great help and so easy to use !

  • Derek

    For anyone getting the following error:
    “Oops something went wrong. Twitter says: Desktop applications only support the oauth_callback value ‘oob’ /oauth/request_token”
    You need to edit your Twitter Application and add in a Callback URL. For the sake of simplicity, just use a localhost address:
    I did this and the script worked perfectly!

  • John

    Thank you for sharing this hack, it has been very useful.
    Lately though I often encounter an error with big accounts (account with really many followers).
    The script freezes after it adds rows in the spreadsheet and throws an error:
    “TypeError: Cannot call method “join” of undefined”
    I suspect it may be due to very long user ids twitter now uses. It seems to me that there is a problem with lookup function of these ids but I am not sure where.
    I tried to add a line in getLotsOfFriendAndFo function “params.stringify_ids = “true”;” but this didn’t solve the issue.
    Using logger I can see that now user_id param is displayed correctly but the problem persists.
    I suspect it may be due to big accounts having many new users with long user ids. I don’t get this problem with relatively smaller accounts but still well over 5000 followers.
    I would very much appreciate if you could find a way to fix this

    • Andres Guerra

      The script stringifies id numbers too big to be used as arguments and those are lost. I have 124 followers. Martin’s script gives me 122. I’ve tried to get my followers through Twitter’s console https://dev.twitter.com/rest/tools/console and it gives me two more, which are the only ones that have the new, long id number. They don’t appear among the 122 the spreadsheet shows.
      I would appreciate that this is fixed too. I’ve been trying for hours to no avail. The problem is well explained here: https://dev.twitter.com/overview/api/twitter-ids-json-and-snowflake

      • Martin Hawksey

        I don’t think this is a problem – the sheet already uses id_str referenced in the link provided. Andres if you can provide your twitter screen name I can look into further

        • John

          I think finally got it found the problem.
          New or big accounts have a lot of new followers, the once with big user ids. This causes the lookup url created to be too long for twitter to handle it and it returns an error.
          So if of the 100 users you use for each users/lookup api call most or all have long ids lookup fails. If there are more older users with smaller ids it doesn’t.
          The solution I found is to change the “var chunks = chunk(users,100);” to “var chunks = chunk(users,75);” (Maybe it would also work with 90 or something like that) and it works fine now.
          I also added stringify_ids as a paramater so that javascript handles the ids properly.
          I hope this helps and again, thank you for sharing this script

  • Jason

    Is there a way to extract the email addressed from this google spreadsheet?

    • Martin Hawksey

      Twitter don’t make this information available

  • Gabrielle

    re: advanced settings – adding a column header doesnt seem to be working for me.
    Added Column “O” (after N) included fx profile_link.. hit getfriends again and I get errors. It adds 5 new users each time but they are 5 blank lines.
    TypeError: Cannot call method “join” of undefined. (line 484, file “Code”)
    I tried in Chrome and in IE but get both browsers get errors.
    ps. other than this issue.. it works great and I love it. : )

    • John

      I’ve just started getting the same error code … very frustrating!
      Have you managed to get it to work?

      • Martin Hawksey

        looks like Twitter have changed this – using a column name `url` will return a shortened version of a profile link. To get the expanded version required an edit to the code, but if you take a fresh copy of the template profile_link should be working again

        • John

          When I try and run the ‘Get Followers’ for a second time to pull additional followers I’m receiving the ‘TypeError: Cannot call method “join” of undefined.’ Error … Any ideas??

          • Jon

            I’m getting this too 🙁

  • Sara Mulder

    Thanks for this – love it!!

  • Mario

    Thank you! Life saver.

  • Vanessa

    Hi, I’ve been using this tool pretty reliably, but the last few times I’ve used it, it’s given me the incorrect number of followers.
    When click “get another person’s followers” and input the screenname, it collects the data and roughly shows the right number of followers. However, when it says that it’s inputting the number of followers into the sheet, it’s a lower number. So the account has 700 people, it says it’s located 700 people, but only puts in 650 into the sheet. Is there any way I can deal with this?

  • Vanessa

    Hi there, the tool isn’t downloading the right number of followers. It identifies the correct number of followers when it’s gathering the data, but when it actually inputs it into the excel sheet, it misses quite a few.
    For example, the account has 700 followers. The tool identifies this but then only downloads 650.
    I’ve tried this with other accounts and it appears to have the same issue. Any help?

  • Joe Lamport

    I keep getting this message when I try to authorize: “Oops something went wrong. Twitter says: Desktop applications only support the oauth_callback value ‘oob’ /oauth/request_token”
    I’ve tried re-copying the spreadsheet, putting in a call back URL, but still it is not working. Please, any help would be appreciated!

    • Martin Hawksey

      just back sure the desktop sign in in your dev.twitter.com/app is not ticked … should work then

  • Catalina

    Hi, there, this is great however, I can’t seem to create a connection between the spreadsheet and twitter.
    I keep getting the following message:
    Oops something went wrong. Twitter says:{“errors”:[{“code”:32,”message”:”Could not authenticate you.”}]}
    I included a callback URL, changed the settings to sign in to twitter, and still nothing. Any thoughts?

    • Martin Hawksey

      Unchecking the Twitter sign-in should fix it

      • Catalina

        I misspoke. I meant i had already unticked the Sign-In to Twitter option. Still nothing. Anything else?

  • Michael

    So if I wish to obtain a list of followers, for example 20,000, how often will the project trigger need to be set for using the ‘getlotsoffriendandfo?
    Obtaining 200 followers at a time?
    5 minutes? 15 minutes?

  • John

    I think the sheet is royally screwed up now??
    I’ve been using it successfully for years but this last month the data its supplying is just wrong, non of the followers or friends list are even close to the numbers displayed on Twitter?
    Any ideas this is giving me a headache now. Ive tried everything I can think off.

  • Abdul

    Hey this used to work absolutely fine for over a year, but now its giving me this error and does not return anything:
    TypeError: Cannot call method “join” of undefined
    Any idea on how to fix this?

  • dinos

    there is a similiar tool for Instagram?

  • Franz

    Is there any way to get the details of the accounts that one account is following instead of its followers? Get Friends, Get followers, Get following 🙂
    Thank you,

    • Martin Hawksey

      hi – Get Friends is the same as Get Following 🙂

Comments are closed.