Great tutorial. I had a little trouble at first, and kept getting the “Bad Request” error.
I discovered the reason I was getting it is because I was leaving off a trailing slash on a domain, i.e., I had put “http://example.com”, instead of “http://example.com/”. If anyone else is having similar problems, you might want to check that.
Works great, but I did notice a quirk in the spreadsheet – it won’t update automatically on refresh. I have to copy/paste the urls into new cells – then the count updates.
The spreadsheet works great, thanks for that. I do have a problem with the PHP code though. It does not return the same values as the spreadsheet but lower +1 counts. Anybody that has noticed this, or even better, found a workaround?
this was useful information. I have small problem. When I put $url = ($_GET[‘url’]); and wish to check +1 counts this don’t work. Anybody know how to fix that?
I’ve no idea why Google doesn’t yet have an API like Facebook or Twitter to make this easy but thanks to you we can still get the count easily. Works perfectly and does exactly what I wanted.
Hi, I have one question. I want followers of my brand page. Means who has added me to their circles. It seems g+ is showing pluses and followers total at top. I am not sure how can i get that. You examples fetches pluses count for a website. I want such as Facebook or Twitter like fans or followers count. Is it possible?
Scott
OK, I’m not sure if I am the only one attempting this via javascript or not, but I seem to be the only commenter with this problem:
Any chance this is something stupid I am missing, or do I need to be doing this server-side? I cannot imagine their server would be interpreting the requesting domain any differently from the server versus the client. Any ideas?
Hi, I’m not familiar with php. Is there a way directly retrieval the count using an url? Could we put the parameters in the url? I tried several times but couldn’t get it right. If you can show me how to do it, it will be great!
Thanks
curious
curious
Or how to do that using curl?
I tried
curl -v -k -H “Content-Type: application/json” -X POST -d ‘{“method”:”pos.plusones.get”,”id”:”p”,”params”:{“nolog”:true,”id”:”http://www.test.com”,”source”:”widget”,”userId”:”@viewer”,”groupId”:”@self”},”jsonrpc”:”2.0″,”key”:”p”,”apiVersion”:”v1″}’ https://clients6.google.com/rpc?key=AIzaSyCKSbrvQasunBoV16zDH9R33D88CeLr9gQ
but it didn’t work. I got an “error code 400…”
Could you please help me?
The main disadvantage of this is that you can check G+ count for only one specified page/URL, not for entire website. Thats sad, but actually there’s no way to count +1 for entire website 🙁 If you want to quick check of +1 and Like count of page, try http://www.seoptimer.com for this.
Hey, When I try to use this method, on a wordpress website I got this error :
‘ Fatal error: Call to undefined function curl_init() in C:\xampp\htdocs\wordpress\framework\wp-content\themes\framework\lib\functions-extanded.php on line 435 ‘
Hi, great post! thanks. I have a question about this. Is it possible get the globalCounts for a Google+ Page? for example: https://plus.google.com/+FCBarcelona/ .. a lot of thanks.
63 responses to “Google +1 Button SEO – Getting Bulk Counts with the hidden API”
Great tutorial. I had a little trouble at first, and kept getting the “Bad Request” error.
I discovered the reason I was getting it is because I was leaving off a trailing slash on a domain, i.e., I had put “http://example.com”, instead of “http://example.com/”. If anyone else is having similar problems, you might want to check that.
Works great, but I did notice a quirk in the spreadsheet – it won’t update automatically on refresh. I have to copy/paste the urls into new cells – then the count updates.
The spreadsheet works great, thanks for that. I do have a problem with the PHP code though. It does not return the same values as the spreadsheet but lower +1 counts. Anybody that has noticed this, or even better, found a workaround?
Thanks!
Hi,
this was useful information. I have small problem. When I put $url = ($_GET[‘url’]); and wish to check +1 counts this don’t work. Anybody know how to fix that?
Thank you.
You must post it (not GET) to the JSON-RPC service. You can find another full PHP implementation on:
http://olegnax.com/927-counter-goole-plusone-twitter-facebook-buttons/
I’ve no idea why Google doesn’t yet have an API like Facebook or Twitter to make this easy but thanks to you we can still get the count easily. Works perfectly and does exactly what I wanted.
Thanks.
Hi, I have one question. I want followers of my brand page. Means who has added me to their circles. It seems g+ is showing pluses and followers total at top. I am not sure how can i get that. You examples fetches pluses count for a website. I want such as Facebook or Twitter like fans or followers count. Is it possible?
OK, I’m not sure if I am the only one attempting this via javascript or not, but I seem to be the only commenter with this problem:
XMLHttpRequest cannot load https://clients6.google.com/rpc?key=AIzaSyCKSbrvQasunBoV16zDH9R33D88CeLr9gQ. Origin http://mydomain.com is not allowed by Access-Control-Allow-Origin.
Any chance this is something stupid I am missing, or do I need to be doing this server-side? I cannot imagine their server would be interpreting the requesting domain any differently from the server versus the client. Any ideas?
Hi Scott,
Browsers generally won’t allow you to do cross-site requests with Javascript for security reasons… 🙁
Hi Scott, try with JSONP.
I’m also trying this with jquery and ajax but isn’t working. I have opened a question on Stackoverflow http://stackoverflow.com/questions/8929177/getting-counts-for-twitter-links-facebook-likes-and-google-1-with-jquery-and-a
Cheers
Where you able to resolved the google+ issue?
Where you able to resolve the google+ issue?
Hi, I’m not familiar with php. Is there a way directly retrieval the count using an url? Could we put the parameters in the url? I tried several times but couldn’t get it right. If you can show me how to do it, it will be great!
Thanks
curious
Or how to do that using curl?
I tried
curl -v -k -H “Content-Type: application/json” -X POST -d ‘{“method”:”pos.plusones.get”,”id”:”p”,”params”:{“nolog”:true,”id”:”http://www.test.com”,”source”:”widget”,”userId”:”@viewer”,”groupId”:”@self”},”jsonrpc”:”2.0″,”key”:”p”,”apiVersion”:”v1″}’ https://clients6.google.com/rpc?key=AIzaSyCKSbrvQasunBoV16zDH9R33D88CeLr9gQ
but it didn’t work. I got an “error code 400…”
Could you please help me?
Very helpful article indeed. I have to admit that I always follow all blog posts about plus one, so it was quite interesting to read this. Thank you
Hi All…
I’ve tried several times an keep getting a 400 error. I haven’t changed the API code either
Array
(
[0] => Array
(
[error] => Array
(
[code] => 400
[message] => Invalid Value
[data] => Array
(
[0] => Array
(
[domain] => global
[reason] => invalid
[message] => Invalid Value
)
)
)
[id] => p
)
)
Any ideas? Has Google gone live with this and or killed this key?
Thanks.
I am also getting same error
I’m getting same error too
It will give above error if url does not have the Google+ button.
I’m getting same error too
this doesn’t work no more!
it is absurd that we can’t get the count
how will we write this tag (defined by google’s schema.org)
<meta name="interactionCount" content="UserPlusOnes:NUMBER_THAT_I_CANT_GET" >
if we can’t get the count? it is non-sense!
The main disadvantage of this is that you can check G+ count for only one specified page/URL, not for entire website. Thats sad, but actually there’s no way to count +1 for entire website 🙁 If you want to quick check of +1 and Like count of page, try http://www.seoptimer.com for this.
Wow This post and comments are really helpful. Thanks a lot.
Yeah, this is great to read the article. Many thanks, Tom Anthony
Hey, When I try to use this method, on a wordpress website I got this error :
‘ Fatal error: Call to undefined function curl_init() in C:\xampp\htdocs\wordpress\framework\wp-content\themes\framework\lib\functions-extanded.php on line 435 ‘
Any idea? Or how to make so it is defined?
Hi, great post! thanks. I have a question about this. Is it possible get the globalCounts for a Google+ Page? for example: https://plus.google.com/+FCBarcelona/ .. a lot of thanks.
ufff.. I found the solution. you must make the request with the identifier. For exemple:
$url = “https://plus.google.com/116151548242653888082”;
Yea! it works.