5

How to get google plus followers in plain text? JSON or XML https://developers.google.com/+/api/latest/people/get doesn't have followers field key.

6 Answers 6

4

Currently there is no way to get followers (or any circle information) from Google+ through the API.

2
3

You can do using API key, must sure Google plus followers visibility should be public

try on fiddle: https://jsfiddle.net/himstar/j4932w0s/

var profileid = '100520061367519307358';
var apikey = 'AIzaSyAqlZ1MJSGXMSs8q5WbfvLpZTGJeHLVc2w';
var url = 'https://www.googleapis.com/plus/v1/people/' + profileid + '?key=' + apikey;
$.ajax({
    type: "GET",
    dataType: "json",
    url: url,
    success: function (data) {
        var googlefollowcount = data.circledByCount;
        $(".googlefollowercount").html(googlefollowcount);
    }
});
2

Actually there is : http://www.emoticode.net/ruby/get-google-page-followers-count-with-google-api.html

require 'open-uri'
require 'json'

google_api_key = 'put your google api key here'
page_id = '105672627985088123672'

data = open("https://www.googleapis.com/plus/v1/people/#{page_id}?key=#{google_api_key}").read    
obj = JSON.parse(data)

puts obj['plusOneCount'].to_i

using Ruby.

1
  • Link is break :'(
    – Carmoreno
    Dec 15, 2017 at 15:55
2

in php:

// get api https://code.google.com/apis/console?hl=en#access
$google_api_key = 'YOUR_API';
$page_id = 'YOUR_PAGE_ID';
$data = @file_get_contents("https://www.googleapis.com/plus/v1/people/$page_id?key=$google_api_key");   
$data = json_decode($data, true);
echo $data['plusOneCount'];
3
  • Sorry to bring this post back up - Have you got any insite as to whether this still works? Nov 7, 2014 at 15:40
  • As far as I can tell that does not return any followers (anymore?).
    – BlaM
    Aug 3, 2015 at 11:59
  • Just Change echo $data['plusOneCount']; to echo $data['circledByCount'];
    – Jlil
    Nov 9, 2017 at 20:36
0

You can retrieve all of your circles using the People.list method, for example:

...
Plus.People.List listPeople = plus.people().list("me", "visible");
listPeople.setMaxResults(5L);

PeopleFeed peopleFeed = listPeople.execute();
List<Person> people = peopleFeed.getItems();
...

Try the example in the APIs Explorer

0

As of August 2018 the Google+ API endpoint https://www.googleapis.com/plus/v1/people/userId/people/collection is deprecated.

There is a new endpoint for getting all the contacts: https://people.googleapis.com/v1/people/me/connections. There is a metadata key in the response, and for Google+ contacts it will look somewhat like this:

  "metadata": {
    "sources": [
      {
        "updateTime": "2013-01-13T19:16:50.668Z", 
        "etag": "...", 
        "type": "CONTACT", 
        "id": "..."
      }, 
      {
        "etag": "...", 
        "type": "PROFILE", 
        "id": "...", 
        "profileMetadata": {
          "userTypes": [
            "GOOGLE_USER", 
            "GPLUS_USER"
          ], 
          "objectType": "PERSON"
        }
      }
    ], 
    "objectType": "PERSON"
  }

Note the "GPLUS_USER" part.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.