Skip to content

Instantly share code, notes, and snippets.

@sayar
Created June 5, 2016 00:45
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save sayar/754497e131281778bee457f4f9db7b6e to your computer and use it in GitHub Desktop.
Save sayar/754497e131281778bee457f4f9db7b6e to your computer and use it in GitHub Desktop.
Emotion API Node.js Sample Code
var request = require('request');
request({
method: 'POST',
url: 'https://api.projectoxford.ai/emotion/v1.0/recognize',
headers: {
'Content-Type': 'application/json',
'Ocp-Apim-Subscription-Key': 'PUT KEY HERE'
},
body: JSON.stringify({
url: 'https://pbs.twimg.com/media/CkIcZcuUYAE5WLD.jpg:large'
})
}, function (error, response, body) {
if (!error && response.statusCode == 200) {
var object = JSON.parse(body);
console.dir(object, {depth: null, colors: true})
}
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment