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.
Hi, this may help — http://slayeroffice.com/tools/modi/v2.0/modi_help.html
That looks really cool. I’ll check it out when I get a minute. Thanks.
I wish I knew this before i wrote http://phpmine.com/2011/07/11/google-plus-is-lacking-in-features-or-are-they/ I would have mentioned you in post
Ok cool, well feel free to update people! Also check out http://my.syyn.cc, a service of mine for syncing G+ to FB and Buzz, sitting on top of the api.
Hi,
My understanding is that Google doesn’t want us to scrape/crawl Google+ posts unless they give us specific permission?
Cool API though.
Sam
Probably true, sorry Google!
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
Here you go:
http://code.google.com/p/emlynoreganappengine/source/browse/trunk/gpapi.py
Thank you! Awesome stuff 🙂
Touche… hosted on google!
This post had almost 1000 views a couple of days ago, many originating more or less here I think
http://news.ycombinator.com/item?id=2756502
Hacker news! Nice.
[…] 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. […]
[…] You can read Emlyn’s original blog post here. […]
Personally I home that in public API will be function to search in public posts – I could add G+ to my analytic project
[…] Google+ API en JSON […]
Would you be able to enable JSONP in your api? So I could call something like:
http://my.syyn.cc/gpapi?id=100281903174934656260&type=prettyposts&format=JSONP&callback=parsePosts
and it would return something like: parsePosts([{‘postId’:’3453′,…}]);
That would be awesome! Thanks
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.
[…] was worried that the Rudimentary Google+ API that I put up a little while back was causing the load, but looking at this, it’s not a big […]
Good stuff! FYI, I had a problem with posts having quotes in them. Probably want to escape those to produce valid JSON. (Not a Python guy, or I’d take a crack at it from our source.)
Oh really? I hadn’t noticed that. What kind of quotes, single?
Double. Example from my recent posts: http://my.syyn.cc/gpapi?id=118183987535987496192&type=prettyposts
JSON Lint complains about the existing quotes in the output from your service.
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
I’m not a java guy, so I can’t really help with a port.
There’s actually an official api now, you should use that.
https://developers.google.com/+/api/
Hi emylyn,
Do you know of a Java/Python API to get Linkedin updates and facebook social graph and if possible their implementation.
[…] Rudimentary Google Plus API […]
At this moment I am going away to do my breakfast, afterward having my breakfast coming yet again to read more news.
[…] Rudimentary Google Plus API […]