Document OCR
Word, Excel and PowerPoint to Markdown API
The document endpoints download an Office or OpenDocument file from a public URL and return its whole content as Markdown: headings, paragraphs, lists and tables.
#Endpoints
| Endpoint | Accepted files | Credits |
|---|---|---|
POST /word |
.doc, .docx, .docm, .odt, .rtf |
3 |
POST /excel |
.xls, .xlsx, .xlsm, .xlsb, .ods, .csv |
3 |
POST /powerpoint |
.ppt, .pps, .pot, .pptx, .pptm, .ppsx, .ppsm, .odp |
3 |
Base URL: https://ocrapi.qoest.com. These paths have no /v1 prefix. They share the OCR API credit balance with Image OCR and PDF OCR.
#Request
curl -X POST https://ocrapi.qoest.com/word \
-H "Authorization: Bearer your-token" \
-H "Content-Type: application/json" \
-H "Accept: application/json" \
-d '{"url": "https://example.com/contract.docx"}'
Use the same body for /excel and /powerpoint.
#Parameters
| Name | Type | Required | Notes |
|---|---|---|---|
url |
string | yes | A public URL whose path ends in one of the accepted extensions for that endpoint. The query string is ignored, so signed URLs such as report.xlsx?sig=... work. Files up to 50 MB. |
#Response
{
"format": "docx",
"markdown": "# Service Agreement\n\n| Item | Price |\n|---|---|\n| Setup | $100 |"
}
format: the detected file format.markdown: the document as Markdown. Spreadsheets come back as Markdown tables; slides come back in order.
#Pricing
3 credits per file, whatever its length. Credits are deducted only when the file is converted.
#Errors
| Status | Body | Charged |
|---|---|---|
400 |
{"code": "download_failed", "message": "The file could not be downloaded."} |
no |
400 |
{"code": "encrypted", "message": "This file is locked with a password."} |
no |
400 |
{"code": "unsupported", "message": "This file type is not supported."} |
no |
400 |
{"code": "failed", "message": "This file could not be read."} |
no |
403 |
{"message": "Insufficient credits"} |
no |
422 |
The URL must point to one of these file types: ... |
no |
503 |
{"code": "unavailable", "message": "Document reading is not set up on this server."} |
no |
Send Accept: application/json so errors always come back as JSON.
#Examples
#Excel spreadsheet to Markdown table
curl -X POST https://ocrapi.qoest.com/excel \
-H "Authorization: Bearer your-token" \
-H "Content-Type: application/json" \
-H "Accept: application/json" \
-d '{"url": "https://example.com/prices.xlsx"}'
#PowerPoint deck to Markdown
curl -X POST https://ocrapi.qoest.com/powerpoint \
-H "Authorization: Bearer your-token" \
-H "Content-Type: application/json" \
-H "Accept: application/json" \
-d '{"url": "https://example.com/pitch.pptx"}'