API endpoint for starting a new conversion process.
POST https://api.ocrconvert.com/v1/convert
Basic Example
curl -X POST -F 'api_token=M-1iePVVQ8axehHLDiWEawerfxPlR9TzRoU102gAbNKXzotpeqQlN4NRJKX6H' -F 'filename=@/path/example.jpg' -F 'output_format=txt' -F 'language=eng' https://api.ocrconvert.com/v1/convert
POST Parameters
Field |
Type |
Description |
api_token |
String |
Your API Token |
filename |
String |
Input filename including file extension |
output_format optional |
String |
Output format to which the file should be converted
Default | txt |
Supported Values | txt |
|
language optional |
String |
Language of the input file
Default | eng |
Supported Values |
ara = Arabic
bul = Bulgarian
cat = Catalan
chi_tra = Chinese Tra
chi_sim = Chinese Sim
ces = Czech
dan = Danish
nld = Dutch
eng = English
fin = Finnish
fra = French
deu = German
ell = Greek
hin = Hindi
hun = Hungarian
ind = Indonesian
ita = Italian
jpn = Japanese
kor = Korean
lav = Latvian
lit = Lithuanian
nor = Norwegian
pol = Polish
por = Portuguese
ron = Romanian
rus = Russian
srp = Serbian
slk = Slovak
slv = Slovene
spa = Spanish
swe = Swedish
tgl = Tagalog
tur = Turkish
ukr = Ukrainian
vie = Vietnamese
|
|
Return SUCCESS
Field |
Type |
Description |
code |
Int |
HTTP Status Code |
status |
String |
Always ok on Success |
data |
Object |
Result data |
data.id |
String |
Your Conversion ID |
{
"code": 200,
"data": {
"id": "Xe_6rlk-a94n"
},
"status": "ok"
}
Return ERROR
Field |
Type |
Description |
code |
Int |
HTTP Status Code |
status |
String |
Always error on Error |
error |
String |
User-Friendly error message |
{
"code": 400,
"error": "Bad request",
"status": "error"
}
API endpoint to get the status of the file conversion.
GET https://api.ocrconvert.com/v1/_ID_/status
Basic Example
curl -X GET https://api.ocrconvert.com/v1/Xe_6rlk-a94n/status
Return SUCCESS
Field |
Type |
Description |
code |
Int |
HTTP Status Code |
status |
String |
Always ok on Success |
data |
Object |
Result data |
data.output |
Object |
Output file information |
data.available |
Boolean |
Availability status of the output file |
data.available_until |
Object |
Date information for the availablility of the output file |
data.available_until.date |
String |
Output file information |
data.available_until.timezone |
String |
Timezone of the date format |
data.available_until.timezone_type |
Int |
Timezone type of the date format |
data.output.size |
Int |
Size of the output file in bytes |
data.output.url |
Int |
URL of the output file for download |
data.step |
String |
Conversion Step
Supported Values |
queued
running
timeout
success
failed
|
|
{
"code": 200,
"data": {
"output": {
"available": true,
"available_until": {
"date": "2017-11-10 18:59:46.000000",
"timezone": "UTC",
"timezone_type": 3
},
"size": 13,
"url": "https://www.ocrconvert.com/file/qBn9-2n-QaoR/download"
},
"step": "success"
},
"status": "ok"
}
Return ERROR
Field |
Type |
Description |
code |
Int |
HTTP Status Code |
status |
String |
Always error on Error |
error |
String |
User-Friendly error message |
{
"code": 400,
"error": "Invalid ID provided",
"status": "error"
}
API endpoint to get the contents of the output file.
GET https://api.ocrconvert.com/v1/_ID_/download
Basic Example
curl -X GET https://api.ocrconvert.com/v1/Xe_6rlk-a94n/download
Return SUCCESS
Field |
Type |
Description |
code |
Int |
HTTP Status Code |
status |
String |
Always ok on Success |
data |
Object |
Result data |
data.content |
String |
Content of the output file |
data.encoding |
String |
Encoding of the content
|
{
"code": 200,
"data": {
"content": "gMjAwIE9o0ZXN0123DQICBUaHUsIDA5IE5vdiABCDE3IDE4OjU5OjQ2IEdNVA0KDQ",
"encoding": "base64"
},
"status": "ok"
}
Return ERROR
Field |
Type |
Description |
code |
Int |
HTTP Status Code |
status |
String |
Always error on Error |
error |
String |
User-Friendly error message |
{
"code": 400,
"error": "Unable to get contents of the requested file",
"status": "error"
}
API endpoint to delete the file.
DELETE https://api.ocrconvert.com/v1/_ID_
Basic Example
curl -X DELETE https://api.ocrconvert.com/v1/Xe_6rlk-a94n
Return SUCCESS
Field |
Type |
Description |
code |
Int |
HTTP Status Code |
status |
String |
Always ok on Success |
data |
Object |
Result data |
data.message |
String |
User-Friendly message |
{
"code": 200,
"data": {
"message": "File deleted"
},
"status": "ok"
}
Return ERROR
Field |
Type |
Description |
code |
Int |
HTTP Status Code |
status |
String |
Always error on Error |
error |
String |
User-Friendly error message |
{
"code": 400,
"error": "Bad request",
"status": "error"
}