4 ms·
This is cool ... any idea what languages are supported? All I can find in the Google docs is "Vision API supports a broad set of languages."
by yborg 11y ago
This is cool ... any idea what languages are supported? All I can find in the Google docs is "Vision API supports a broad set of languages."
- diggan 11y agoThe HTTP API is relatively simple to work with actually. Here is a quick example on how to work with it in NodeJS: var request = require('request') var file = require('fs').readFileSync('./testimage.png').toString('base64') var body = { requests: { image: { content: file }, features: [ { type: 'TEXT_DETECTION', maxResults: 10 } ] } } var url = 'https://vision.googleapis.com/v1/images:annotate\?key\=your_api_key' request({ url: url, method: 'POST', body: JSON.stringify(body) }, (err, res, body) => { console.log(err) console.log(body) console.log(JSON.parse(body).responses[0].textAnnotations[0].description) }) Basically you want to convert image data into base64, put it in the requests.image.content field and make a POST request and you'll get back the text.