How to Get Your Number of Followers for Twitter With Javascript

Written by john mitchell Google
  • Share
  • Tweet
  • Share
  • Pin
  • Email
How to Get Your Number of Followers for Twitter With Javascript
Twitter is a short-messaging service that lets you follow people you're interested in. (Oli Scarff/Getty Images News/Getty Images)

You can retrieve the number of Twitter followers for any user, including yourself, with JavaScript. Use jQuery, a JavaScript library, to write a code snippet that quickly gets and displays the Twitter follower count on any website that allows JavaScript code implementation. Blog services that do not allow JavaScript include, and; otherwise you should be free to use this code on any hosted server on the Web.

Skill level:


  1. 1

    Use a text editor to open the HTML document you want to display the Twitter follower count on. You can create a new HTML document or use an existing one.

  2. 2

    Insert this code in the place you want to show the follower count, replacing "user" with your first name and last name, if applicable:

    <strong>User</strong> has <span id="followers"></span> Twitter followers.

  3. 3

    Go to the line below and call the jQuery library hosted at Google's API site. Insert this code to call the JavaScript library:

    <script type="text/javascript" src=""></script>

  4. 4

    Go to the next line and insert this code, replacing the "screen_name" variable with your actual Twitter username:

    <script type="text/javascript">


        URL: '',
        data: {screen_name: 'twitter'},
        data Type: 'jsonp',
        success: function(data) {



  5. 5

    Save the HTML document and upload it to your Web server. When a person visits your website they will see "User has 50 Twitter followers." Of course, the name will be your name and the follower count will accurately show how many followers you have at the time the page loads.

Don't Miss

  • All types
  • Articles
  • Slideshows
  • Videos
  • Most relevant
  • Most popular
  • Most recent

No articles available

No slideshows available

No videos available

By using the site, you consent to the use of cookies. For more information, please see our Cookie policy.