Rudimentary GooglePlus API


 It’s Sunday, I’m at a loose end. Idle hands do the devil’s work, and today that work is to pick at the Google+ Profile page, and make a read-only API out of it.

There’s some nice JSON in there. And when I say nice, I mean undocumented and weird. But there’s good data in there. So, I’ve written some rudimentary code to pull it out and return it to you. What’s the format? That’s for me not to know, and for you to find out.

So, you need a profile id, and you’re good to go. The api is here: http://my.syyn.cc/gpapi. But how do you use it?

If I want to use it, I start with my profile, which is here: https://plus.google.com/100281903174934656260/posts. That gives me profile id, which is 100281903174934656260. I slap that into the api using this url: http://my.syyn.cc/gpapi?id=100281903174934656260 . Give it a click, have a look. Machine readable data. Good!

The parameters you can specify:

  • id=(profileid) — required
  • type=[profile|posts] — optional. profile gives you just profile info. posts gives you just the post list. Anything else, or leaving it out, you get everything.
  • debug=true — an easier to read format, not for machine readability

so for example

http://my.syyn.cc/gpapi?id=100281903174934656260&type=profile&debug=true

is a bit easier to read through.

This on the other hand is unformatted JSON, of my posts

http://my.syyn.cc/gpapi?id=100281903174934656260&type=posts

Anyway, techy types do try it out and let me know what you think. Good luck!

UPDATES

I’ve added some features.

Use “prettyposts” instead of “posts” to get a cleaned up version of post information. Informative attribute names! Only relevant stuff! You’ll like it.

Also, every post has its own page, with an url like this https://plus.google.com/100281903174934656260/posts/ExJbXW9remW .

If you use id=100281903174934656260/posts/ExJbXW9remW in the api, you’ll get just the data for that post, from the post page, rather than for all recent posts from the profile page. An advantage of this is that the post page has more comments loaded (all comments?) rather than the very shortened list which is on the profile page.

So for instance try this:

http://my.syyn.cc/gpapi?id=100281903174934656260/posts/ExJbXW9remW&type=prettyposts&debug=true

More to come.

About these ads
Rudimentary GooglePlus API

27 thoughts on “Rudimentary GooglePlus API

  1. Adam Henson says:

    Very cool! Any chance you’ll be releasing the API source? I’d like to host this and do authenticated calls via a “service” Google Plus account

  2. […] Rudimentary Google Plus API: A Read Only JSON API that accepts a Google Plus profile id and gives you profile information and posts. The author, Emlyn O’Regan has also written a tool, Syncc for tying together various social networks and currently supports extracting out data from Google Plus to other Social networks. […]

    1. emlyn says:

      Jsonp is a good idea. I might do that. Meanwhile, I’ve linked the code elsewhere in these comments so feel free to just make your own version, do what you’d like with it.

  3. CI Thinker says:

    Awesome Emlyn.The gapi tools are great.I am primarily a java developer so was wondering if there was a way to port this code in java.
    Please Advice
    collectiveIntelligenceThinker

  4. CI Thinker says:

    Hi emylyn,
    Do you know of a Java/Python API to get Linkedin updates and facebook social graph and if possible their implementation.

Leave a Reply

Please log in using one of these methods to post your comment:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s