OCR stands for Optical Character Recognition. It is a technology to recognize text inside images, such as scanned documents and photos. OCR technology is used to convert image containing written text (typed, handwritten, or printed) into machine-readable text data to be used for data processing like editing or searching.
After you create an account and log in to the dashboard, choose OCR on the collections page. To make OCR API you just need to give a name for your API, click on the submit button and your API is ready.
You should note that in many cases, in order to get better OCR results, you’ll need to improve the quality of the input image you are giving to SlashApi.
Scan image and convert into readable text.
Name | Description |
---|---|
file | Image to scan |
For convenience, we'll use Axios to demonstrate making HTTP requests to the endpoints.
var axios = require('axios');
var FormData = require('form-data');
var fs = require('fs');
var data = new FormData();
data.append('file', fs.createReadStream('/path/to/file'));
var config = {
method: 'post',
url: 'http://v1.slashapi.com/team/ocr/ly8tmTzL2J',
headers: {
...data.getHeaders()
},
data : data
};
axios(config)
.then(function (response) {
console.log(JSON.stringify(response.data));
})
.catch(function (error) {
console.log(error);
});