Google +1 Button SEO – Getting Bulk Counts with the hidden API

| |

63 responses to “Google +1 Button SEO – Getting Bulk Counts with the hidden API”

  1. Great post! Thanks.

    It’s certainly a start 🙂

  2. Thanks! This is just what I was looking for. I wish Google would make it as easy as Facebook and Twitter to get the count.

  3. I agree! I’m sure they will in time, but not sure why they haven’t from the get go. This private API isn’t quite as straightforward as the Twitter and FB ones, but works perfectly for the moment. Fingers crossed they release a public API with proper support.

    Would love to hear what you use it for. 🙂

  4. Hi Tom, I was wondering if you have any suggestions as to how I can integrate the google plus 1 button into my wordpress site ?

  5. When I copy your exact code(except change the API key to mine), I get a error returned from Google. Any idea what the problem could be? It’s returning a 400 error.

    Error:
    [ { “error”: { “code”: 400, “message”: “Bad Request”, “data”: [ { “domain”: “global”, “reason”: “badRequest”, “message”: “Bad Request” } ] }, “id”: “p” } ]

  6. Hi Jake,

    You’ve answered your own question! Don’t change the key – it is a developerKey that is the same for everyone. Changing it will give you a 400 error. Let me know how you get on (and what you are using it for – I love to know about applications!). 🙂

    -Tom

  7. Cctv installers – I recommend this plugin: Google +1 WP Plugin from Pleer. It works great. 🙂

  8. Thanks for the help, seems I was getting ahead of myself changing the API key without being told to ;P.

    On another note, you wouldn’t happen to know how to get the amount of stumbles for a URL would you? They provide no public API and I’m struggling to find any code pasted online.

  9. Ruby one-liner 😀

    require ‘curb’
    require ‘json’

    JSON.parse((Curl::Easy.http_post(‘https://clients6.google.com/rpc?key=AIzaSyCKSbrvQasunBoV16zDH9R33D88CeLr9gQ’,[{‘method’=>’pos.plusones.get’,’id’=>’p’,’params’=>{‘nolog’=>true,’id’=>’!->URL’widget’,’userId’=>’@viewer’,’groupId’=>’@self’},’jsonrpc’=>’2.0′,’key’=>’p’,’apiVersion’=>’v1′}]){|curl|curl.headers[‘Accept’]=’application/json’;curl.headers[‘Content-Type’]=’application/json’;curl.headers[‘Api-Version’]=’2.2′}).body_str)[‘result’][‘metadata’][‘globalCounts’][‘count’]

  10. Sorry, parser killed my code

    require ‘curb’
    require ‘json’

    JSON.parse((Curl::Easy.http_post(‘https://clients6.google.com/rpc?key=AIzaSyCKSbrvQasunBoV16zDH9R33D88CeLr9gQ’,[{‘method’=>’pos.plusones.get’,’id’=>’p’,’params’=>{‘nolog’=>true,’id’=>’!!!URL!!!’,’source’=>’widget’,’userId’=>’@viewer’,’groupId’=>’@self’},’jsonrpc’=>’2.0′,’key’=>’p’,’apiVersion’=>’v1′}]){|curl|curl.headers[‘Accept’]=’application/json’;curl.headers[‘Content-Type’]=’application/json’;curl.headers[‘Api-Version’]=’2.2′}).body_str)[‘result’][‘metadata’][‘globalCounts’][‘count’]

  11. On another note, I just found this class on CodeCanyon. Looks useful for those of us that need to count multiple statistics. SocialCounter Class

  12. Thanks to share it dude, nice!

  13. PHP: I would add CURLOPT_SSL_VERIFYPEER = false, use curl_setopt_array for performance reasons and put the whole thing in a function like this: /php-google-plus-one-count-api
    But the best version is async processing of multiple urls at once.

  14. Thanks a lot for the code – I’ve been monitorig the web for such a solution for a couple of weeks already, but found this post only today. And I was wondering – how do you find out what kind of request is made in such cases? I’ve seen people similarly ripping apart Twitter private API for tweet count, but I never got to know how it is done. Could you share the approach?

  15. Justin Vanderheide Avatar
    Justin Vanderheide

    Thanks, this is working wonderfully.

  16. […] and PeopleAddFind Questions, Topics or PeopleCancelFlag Answer1 Comment • 3:08pm on Thursdayhttp://www.tomanthony.co.uk/blog… for Google+Jonathan Ong • 4:34pmView 1 Comment Edit Link Text Show answer summary preview […]

  17. I am passing following JSON to URL you mentioned. I am getting error below json string. Same code was working five days back. What can be the reason behind the error

    JSON String I am passing to googleplusone
    [{“method”:”pos.plusones.get”,”id”:”p”,”params”:{“nolog”:true,”id”:”http://yahoo.com”,”source”:”widget”,”userId”:”@viewer”,”groupId”:”@self”},”jsonrpc”:”2.0″,”key”:”p”,”apiVersion”:”v1″}]

    Error I am getting :
    {“error”:{“code”:-32700,”message”:”A JSONObject text must begin with ‘{‘ at character 0 of “,”data”:[{“domain”:”global”,”reason”:”parseError”,”message”:”A JSONObject text must begin with ‘{‘ at character 0 of “}]}}

  18. The big difference of Google +1 to other social media is it will have influence on the search results people see at Google.

  19. I think it doesn’t work … Maybe … Google has change anything ?

  20. My curl_getinfo:
    Array ( [url] => https://clients6.google.com/rpc [content_type] => [http_code] => 0 [header_size] => 0 [request_size] => 0 [filetime] => -1 [ssl_verify_result] => 0 [redirect_count] => 0 [total_time] => 0 [namelookup_time] => 0 [connect_time] => 0.112 [pretransfer_time] => 0 [size_upload] => 0 [size_download] => 0 [speed_download] => 0 [speed_upload] => 0 [download_content_length] => 0 [upload_content_length] => 0 [starttransfer_time] => 0 [redirect_time] => 0 )

    May be the problem is the ssl certificate ?