Welcome to the Treehouse Community

Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.

Start your free trial


Nithin KV
Nithin KV
809 Points

How to get Google Plus Share count with Node JS


I'm trying to get Google Plus share count with Node Js, This is My code:-

var data = querystring.stringify({
        "id": "http://techcrunch.com/2016/06/06/blue-origin-continues-successful-record-setting-year-with-another-nasa-contract/",

var options = {
    host: 'https://clients6.google.com/rpc?key=MYAPIKEY',
    port: 80,
    method: 'POST',
    headers: {
        'Content-Type': 'application/json',
        'Content-Length': Buffer.byteLength(data)

var req = https.request(options, function(res) {
        console.log('statusCode: ', res.statusCode);
    console.log('headers: ', res.headers);

    res.on('data', function(d) {

req.on('error',function (e) {

I'm getting following error: - Error: getaddrinfo ENOTFOUND