About this endpoint
What it does
Uploads a PDF file and extracts its text. Returns the text as one string, or page by page when structured is true.
Request Body (multipart/form-data)
| Parameter | Type | Description |
|---|---|---|
| file | File | Required. The PDF file to upload. |
| structured | Boolean | Return the text page by page instead of one string. Default: false. |
Response
Returns a JSON object. The shape depends on structured.
| Parameter | Type | Description |
|---|---|---|
| text | String | Returned when structured is false. All text in reading order. |
| page_count | Integer | Returned when structured is true. Number of pages. |
| pages | String Array | Returned when structured is true. Text of each page, in order. |
Notes
- A non-PDF file returns a 422 error.
- Password-protected PDFs are not supported and return an error.



