Getting an image text to a document
This example explains how to convert an image containing text (e.g. a scanned book page) to a text file. For this, an option called OCR (Optical Character Recogniton) is used.
Please note that the
language
option can be set to specify which language the text is in. This can lead to a better conversion result.
POST /v2/jobs HTTP/1.1
Host: api.api2convert.com
x-oc-api-key: <your API key here>
Content-Type: application/json
Cache-Control: no-cache
{
"input": [{
"type": "remote",
"source": "https://example-files.online-convert.com/raster%20image/png/example.png"
}],
"conversion": [{
"category": "document",
"target": "txt",
"options": {
"ocr": true
}
}]
}
curl -X POST \
https://api.api2convert.com/v2/jobs \
-H 'cache-control: no-cache' \
-H 'content-type: application/json' \
-H 'x-oc-api-key: <your API key here>' \
-d '{
"input": [{
"type": "remote",
"source": "https://example-files.online-convert.com/raster%20image/png/example.png"
}],
"conversion": [{
"category": "document",
"target": "txt",
"options": {
"ocr": true
}
}]
}'