Convert anything to TXT


The API for converting any file to TXT.

Here you can see all available conversion options which you can use within the "options" section of conversions (see the example JSON below the table).

Here you can see all available conversion options which you can use within the "options" section of conversions (see the example JSON on the right).

Option Name Description
allow_multiple_outputs
Type: boolean
Default: False
If the conversion produces more than one output file, by default all of them are compressed in just one file. Set this option to true if you want a download link for each file.
allow_multiple_outputs_threshold
Type: integer
Minimum: 2
Maximum: 400
Sets the threshold for the number of output files during conversion. This option is considered only when `allow_multiple_outputs` is set to true. If the generated output files exceed this threshold, they are compressed into one file. Conversely, if the threshold is not met, each output file remains uncompressed.
download_password
Type: string
Pattern: ^[ -~]{0,1000}$
Example: secret_password
A password to protect the download. To download the file send the password in the x-oc-download-password header or set a cookie named x-oc-download-password. The value contains a comma separated list of passwords.
language
Type: string
Pattern: ^[a-zA-Z_,-]{3,128}$
Example: rus,eng,deu
Language for the source (using ISO 639-2/T standard). In case of multi language documents, a comma separated list of values without quotes or spaces can be used. Please note that both plain and script languages cannot be included at the same time. Supported values are: afr, amh, ara, asm, aze, aze_cyrl, bel, ben, bod, bos, bre, bul, cat, ceb, ces, chi_sim, chi_sim_vert, chi_tra, chi_tra_vert, chr, cos, cym, dan, deu, div, dzo, ell, eng, enm, epo, est, eus, fao, fas, fil, fin, fra, frk, frm, fry, gla, gle, glg, grc, guj, hat, heb, hin, hrv, hun, hye, iku, ind, isl, ita, ita_old, jav, jpn, jpn_vert, kan, kat, kat_old, kaz, khm, kir, kmr, kor, kor_vert, lao, lat, lav, lit, ltz, mal, mar, mkd, mlt, mon, mri, msa, mya, nep, nld, nor, oci, ori, pan, pol, por, pus, que, ron, rus, san, sin, slk, slv, snd, spa, spa_old, sqi, srp, srp_latn, sun, swa, swe, syr, tam, tat, tel, tgk, tha, tir, ton, tur, uig, ukr, urd, uzb, uzb_cyrl, vie, yid, yor, script-Arabic, script-Armenian, script-Bengali, script-Canadian_Aboriginal, script-Cherokee, script-Cyrillic, script-Devanagari, script-Ethiopic, script-Fraktur, script-Georgian, script-Greek, script-Gujarati, script-Gurmukhi, script-Hangul, script-Hangul_vert, script-HanS, script-HanS_vert, script-HanT, script-HanT_vert, script-Hebrew, script-Japanese, script-Japanese_vert, script-Kannada, script-Khmer, script-Lao, script-Latin, script-Malayalam, script-Myanmar, script-Oriya, script-Sinhala, script-Syriac, script-Tamil, script-Telugu, script-Thaana, script-Thai, script-Tibetan, script-Vietnamese
language_stt
Type: string
Enum: ar-AR ca-ES zh-CN cs-CZ de-DE el-GR en-IN en-US es-ES fa-IR fr-FR hi-IN it-IT ja-JP kk-KZ nl-NL pl-PL pt-FB sv-SE ru-RU tl-PH tr-TR uk-UA vi-VN
Language of the audio source
ocr
Type: boolean
Optical character recognition
ocr_engine
Type: string
Enum: red_kiwi gold_pineapple
Selects the optimized engine depending on how the source file was created
ocr_engine_options
Object containing specific engine options.
ocr_filter
Type: string
Enum: gray
Apply a filter to the input file. It may improve text detection.
ocr_filter_options
Object containing specific filter options.
ocr_mode
Type: string
Enum: text layout
Default: layout
Optical character recognition optimization for text correctness or layout as close as possible to the original one
ocr_page_structure
Type: string
Enum: auto single_column uniform_block_vertical uniform_text single_line single_word single_char unstructured raw_line
Page structure description to the OCR engine. It may help to have a better result. If your first attempt with automatic page structure detection fails or if you know in advance the structure of your pages, you can try with a more specific one.
output_filename
Type: string
Pattern: ^[\w\W]{0,255}$
Example: my_base_filename_without_extension
The desired file name of the converted file WITHOUT the file extension.
preset
Type: string
Pattern: ^[\w\W]{1,255}$
Predefined options

Output Example

POST /v2/jobs HTTP/1.1
Host: https://api.api2convert.com
X-Oc-Api-Key: <your API key here>
Content-Type: application/json
{
    "input": [{
        "type": "remote",
        "source": "https://example-files.online-convert.com/document/doc/example.doc"
    }],
    "conversion": [{
        "category": "document",
        "target": "txt",
        "options": {
            <conversion options here>
        }
    }]
}