About this endpoint
What it does
Converts one PDF, or up to 10 PDFs, into an Excel, Word or plain text result. Text pages are read directly and scanned pages are read with OCR. The response returns the converted file as base64 together with a preview of the extracted rows.
Request Body
| Parameter | Type | Description |
|---|---|---|
| fileContent | String | Required unless files is sent. The PDF as base64. A data URI (data:application/pdf;base64,...) is also accepted. |
| fileName | String | Name of the PDF, e.g. report.pdf. Used to name the output file (report.xlsx). Default: file. |
| files | Object Array | Use instead of fileContent to convert several PDFs in one call. Max 10 items, with 10 pages and 20 MB in total. |
| files[].fileName | String | Name of this PDF, e.g. a.pdf. |
| files[].fileContent | String | Required. This PDF as base64 or a data URI. |
| format | ENUM | Output format. Allowed values: xlsx, docx, txt. Default: xlsx. |
| language | ENUM | Language of the text on scanned pages, used by OCR. Allowed values: eng, deu, bul, eng+deu+bul. Default: eng. |
| onOneSheet | Boolean | Excel only. false puts each page on its own sheet (Page 1, Page 2, ...). true puts all pages on one sheet named All pages. Default: false. |
Response
Returns a JSON object with count and an items array. items always holds one object. For one PDF in xlsx or docx, it holds the file in fileBase64. For one PDF in txt, it holds the text in text and has no file. For two or more PDFs, it holds one output file per converted PDF in files, for all formats.
| Parameter | Type | Description |
|---|---|---|
| count | Integer | Number of objects in items. 1 even when several PDFs are sent. |
| items | Object Array | Conversion results. |
| items[].title | String | Short summary, e.g. sales.pdf converted to Excel. |
| items[].fileName | String | Output file name, e.g. sales.xlsx. Only present for one PDF in xlsx or docx. |
| items[].mime | String | MIME type of the output file. Only present for one PDF in xlsx or docx. |
| items[].fileBase64 | String | The output file as base64. Only present for one PDF in xlsx or docx. |
| items[].text | String | Extracted text, pages separated by --- Page N --- lines. Only present for one PDF in txt. |
| items[].files | Object Array | One output file per converted PDF. Only present when two or more PDFs are sent. |
| items[].files[].fileName | String | Output file name, e.g. a.xlsx. |
| items[].files[].fileBase64 | String | The output file as base64. |
| items[].rows | Array | Preview of the extracted rows of the first page (or of the first file). Each row is an array of cell values. |
| items[].columns | Array | Column headers. Currently always empty. |
| items[].stats | Object | Processing stats. |
| items[].stats.Pages done | Integer | Number of pages converted, across all files. |
| items[].stats.Scanned pages read | Integer | Number of pages read with OCR. Only present when OCR was used. |
| items[].stats.Files converted | Integer | Number of PDFs converted. Only present when two or more PDFs are sent. |
| items[].notes | String Array | Warnings, e.g. that some pages were read with OCR or skipped, or that a file could not be read. Only present when there is something to note. |
| items[].cached | Boolean | true when the result of an identical earlier call is returned. Only present on cached results. |
| items[].cacheAgeSeconds | Integer | Age of the cached result in seconds. Only present on cached results. |
Errors return HTTP 400 with a JSON object holding code (invalid_input), error (the full error text) and message (the same text without the invalid input: prefix). Some messages end with an example request that contains a base64 PDF.
Notes
- Limits per call, counted across all files: 10 files, 10 pages and 20 MB of decoded data. A call over any of these returns 400 and nothing is converted.
- OCR reads up to 5 scanned pages per call, counted across all files. Extra scanned pages are skipped and the call still returns 200. Compare
stats.Pages donewith the number of pages you sent, and checknotes. - Skipped scans may be listed in
notesasNo text found in this file, even when the page is readable. Send those pages in a new call. - If both
fileContentandfilesare sent, all of the PDFs are converted. - When several PDFs are sent and one cannot be read, the others are still converted and
notesnames the one that failed. - A single PDF with no text and no readable image returns 400 with
No text found in this file. - A single PDF that is damaged or password-protected returns 400 with
This PDF cannot be opened. - OCR keeps tables as one cell per line. Text PDFs keep their table columns.
- File names are cleaned: characters outside letters, digits,
.,-and_become_.



