Display Klout Score with Klout API

  • follow us in feedly
Published April 21, 2013 by Brad Knutson
Klout Score

I’ve spoken before regarding how I feel about social signals and their place in SEO, and the importance of the concept of “social rank.” Many startups set out to calculate social rank, but one is sticking out above the rest. Klout is that startup, and if you aren’t already signed up for their service, I suggest that you do so.

Klout was recently in the news when Microsoft (Bing) partnered with Klout. This investment was tagged with the goal of “strengthening social influence and search.” With all the talk in the last year about social signals and social influence on SEO – this seems like a logical step in that direction.

Many people have signed up for Klout. Some are pleased with their score, others are not. Regardless, you may want to display your Klout score on your website. You could make an image of your score and add it to your site – but with Klout updating scores daily, it would take a lot of manual work to update this.

Let’s look at Klout’s API so we can generate this automatically, and make sure we have the most up-to-date score available.

Before we begin, you’ll need to register an app through Klout’s Developer portal. If you’ve ever registered for an API key before, you shouldn’t have any trouble with this form, but if it’s your first time – it can be confusing. Leave a comment below if you need any help filling out the form.

Once you have your app registered, you should be given two API keys; an OAuth API Key and a Partner API V2. We need the second one. Feel free to look through Klout’s API documentation for more information.

Now that we have our API Key, we can go about pulling the score. We make the following call to the Klout API:


Enter your API key at the end of the URL. I’ll talk about determining a Klout ID in one minute, here is what mine looks like:


(As of 4/21/13 6:09 PM CST) This returns the following JSON response:


Now let’s quickly take a look at how to determine what the Klout ID is. There are a few different ways we can go about this. We need either Twitter ID, Twitter Username, or Google+ ID.


The response for these will be the following (the Klout ID is mine):


With this knowledge, now lets look at a PHP script that will take a Twitter username, and give us their Klout score.


$api_key = '<-- Enter API Key here -->';
$twitter = 'bradsknutson';
$id_url = 'http://api.klout.com/v2/identity.json/twitter?screenName='. $twitter .'&key='. $api_key;
$json = file_get_contents($id_url);
$id = json_decode($json, TRUE);
$kloutid = $id['id'];
$score_url = 'http://api.klout.com/v2/user.json/'. $kloutid .'/score?key='. $api_key;
$json = file_get_contents($score_url);
$score = json_decode($json, TRUE);
echo round($score['score']);

You can see this in action by viewing the demo I’ve set up.

Klout Score Example

View Demo

If you are using WordPress, and want to built a function that displays the Klout score of the post author, you can do that using a built-in WordPress function to get the authors Twitter user name, and insert it into the script.

<?php the_author_meta('twitter'); ?>

Now the only thing left is to style the output. Please adhere to Klout’s style guidelines.

The following two tabs change content below.
Founder at Inbounderish
Brad Knutson is a Web Developer in the Twin Cities area of Minnesota. He has experience working with WordPress and Drupal, and also has an interest in SEO and Inbound Marketing.

Keep Up-to-Date



See a complete list of topics discussed in blog posts here.

Check These Out

Get 2 Weeks Free! Sign Up Today! Premium Managed WordPress Hosting Genesis Framework for WordPress SEO is complex. Tools should be simple. Thesis Theme for WordPress:  Options Galore and a Helpful Support Community

2 thoughts on “Display Klout Score with Klout API

Share Your Thoughts

Your email address will not be shown.

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code class="" title="" data-url=""> <del datetime=""> <em> <i> <q cite=""> <s> <strike> <strong> <pre class="" title="" data-url=""> <span class="" title="" data-url="">