> ## Documentation Index
> Fetch the complete documentation index at: https://docs.doconda.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Read files

> Any file, turned into Markdown ready for your AI.

```json theme={null}
POST /v1/extract
{ "file": { "url": "https://example.com/contract.pdf" } }
```

```json theme={null}
{
  "object": "extraction",
  "format": "pdf",
  "markdown": "<!-- page 1 -->\n\nLEASE AGREEMENT…",
  "chars": 18342,
  "truncated": false,
  "pages": 7
}
```

* **Formats**: Word, PowerPoint, Excel, PDF (also `.doc`, `.ppt` and `.xls`), images (PNG, JPG, GIF, WebP), TXT and Markdown.
* **Structure is kept**: headings, lists and tables in Word (with pandoc; with tracked changes, the text with the
  changes accepted); one section per slide (with its notes) in PowerPoint and one table per sheet in Excel (with
  markitdown); in PDF, headings, tables and columns in order, with page markers.
* **Scanned PDFs and images**: read with OCR, tables included. Up to 100 scanned pages per PDF; the
  rest are marked as "not read". A long scanned PDF can take a few minutes: after 120 s
  you get `202` and follow the document with `GET /documents/{id}`.
* Up to 2,000,000 characters; if it's longer, `truncated: true`. A PDF can have up to 1,000 pages.
* **It's free**, within the limit of 120 documents per minute. With `"store": false` we keep nothing after 15 minutes.

## Four ways to pass a file

They work the same in `file` and `sources` of `POST /documents`, and here (in `POST /files`, the last two):

| How | Example |
| - | - |
| A document Doconda already made, by its id | `"doc_01JAB3…"` (we use its Word, PowerPoint or Excel file; or its PDF if that's all it has) |
| An already uploaded file | `"file_01JAB3…"` |
| A public URL (http or https) | `{ "url": "https://…/report.docx" }` |
| Its bytes in base64 | `{ "data": "UEsDBBQ…", "filename": "report.docx" }` |

`multipart/form-data` with a `file` field also works, as in `POST /files`. 20 MB maximum.
URLs can only point to public addresses.


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.