PDF to Excel

Extract tables from PDF documents to Excel (.xlsx) or CSV format.

POSThttps://api.morphopdf.com/v1/convert/pdf-to-excel

Authentication

AuthorizationBearer

Retrieve your API Key from Dashboard.

Request Body

Provide the PDF file using one of the following methods.

fileFile

PDF file uploaded via multipart/form-data.

urlstringOptional

Public URL pointing to a PDF file.

Query Parameters

formatstringOptionalDefault: json

Response format. Use 'binary' to receive the Excel file directly, or 'json' for metadata.

outputFormatstringOptionalDefault: xlsx

Output file format. Options: 'xlsx' (Excel) or 'csv' (comma-separated values).

modestringOptionalDefault: convert

Operation mode. 'detect' returns table regions without converting, 'convert' performs full conversion.

Response

When using format=json (default):

successboolean

Indicates whether the operation completed successfully.

messagestring

Human-readable status message.

fileNamestring

Name of the generated Excel file.

downloadUrlstring

Presigned URL to download the file. Valid for 1 hour.

Table Detection

For best results, use PDFs with clearly defined tables. Scanned documents may require OCR preprocessing. Tables with visible borders are detected more reliably.

Error Responses

StatusCodeDescription
400INVALID_INPUTNo file provided or invalid PDF
400INVALID_FILE_TYPEFile is not a valid PDF document
401AUTHENTICATION_REQUIREDMissing or invalid API key
500PROCESSING_FAILEDNo tables detected or processing error
POST/v1/convert/pdf-to-excel
curl -X POST "https://api.morphopdf.com/v1/convert/pdf-to-excel?format=binary" \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -F "file=@document.pdf" \
  --output spreadsheet.xlsx
200OK
{
  "success": true,
  "message": "File processed successfully",
  "fileName": "spreadsheet.xlsx",
  "downloadUrl": "https://files.morphopdf.com/sessions/abc123/output/spreadsheet.xlsx?X-Amz-Algorithm=AWS4-HMAC-SHA256&X-Amz-Expires=3600&..."
}