Bytefusedocs

Convert

PDF to Excel

Detect tables in a PDF and export them to a clean .xlsx workbook — one sheet per detected table, with values type-coerced back into real numbers, currency and dates.

Free to try — no key required 40 credits / callAI vision: 200 creditsSynchronous

Overview

Upload a PDF; get back a public R2 URL for an .xlsx workbook containing the tables found in it. PDF input only. On the free-try path — callable with no key.

POSThttps://api.bytefuse.in/api/v1/pdf/to-xlsx

Request

Content type multipart/form-data:

filefilerequired
The PDF to extract from. The filename must end in .pdf, otherwise the request returns 415.
enginestringoptional
auto (deterministic detection) or vision (premium AI). Any other value returns 422.Default: auto

Detection engines

engine=auto runs a detection-first pipeline, trying each strategy in turn:

  1. Lattice — ruled tables with visible cell borders.
  2. Whitespace stream — borderless/financial tables, recovered by column projection.
  3. OCR word-boxes — scanned or image-only pages, via Tesseract.

Non-table prose is excluded by bounding box, and cell values are type-coerced with Excel number formats that preserve the source display — e.g. (720,000), $4.50.

When to use engine=vision

For scanned, complex or dense borderless financial tables, engine=vision reads each page with a vision LLM into structured JSON, then builds a typed workbook. It falls back to the deterministic engine if it finds nothing. Costs 200 credits instead of 40.

Response

200 OK, application/json:

200 OK
{
  "success": true,
  "url": "https://<r2-host>/pdf_to_xlsx/financials.xlsx",
  "tables_found": 3,
  "sheets": 3,
  "pages": 5,
  "credits_charged": 3
}
successbooloptional
Whether extraction completed.
urlstringoptional
Public R2/CDN URL of the .xlsx workbook.
tables_foundintoptional
Number of tables detected across the document.
sheetsintoptional
Sheets in the workbook (one per table). If no table is found, a per-page-text fallback runs and this reflects those sheets.
pagesintoptional
Pages in the source PDF.
credits_chargedintoptional
Credits billed — mirrors the X-Credits-Charged header.

Credits

engine=auto (default)pdf.to_xlsx40
engine=visionpdf.to_xlsx.ai200

Examples

curl -X POST https://api.bytefuse.in/api/v1/pdf/to-xlsx \
  -H "X-API-Key: dt_live_your_key" \
  -F "file=@financials.pdf" \
  -F "engine=auto"

Errors

415Missing filename, or the file isn’t a .pdf.
422engine isn’t auto or vision, or the PDF is password-protected.
402 / 429 / 503Insufficient credits, rate limited, or capacity/config error.
500Extraction failed unexpectedly.

Full error semantics on the Errors page.