Strict Zero Data Retention · 2 Credits / Image

Image to Excel API Reference

Extract structured spreadsheet rows (headers[] & rows[][]) from JPG, PNG, and WebP table photos via direct binary multipart/form-data upload. Looking for product overview or free browser conversion? See Image to Excel API Overview or Free Image to Excel Converter.

POSThttps://api.structocr.com/v1/image-to-excel

API Quick Facts

Strict Zero Data Retention
Endpoint
POSThttps://api.structocr.com/v1/image-to-excel
Authentication
x-api-key HTTP header (auto-created on signup)
Pricing & Free Tier
2 credits per succeeded image or PDF page (failed pages refunded) ($0.0116–$0.02 / page). Prepaid packs from $5, no subscription, credits never expire. 200 free credits on signup.
Data Retention
Strict Zero Data Retention — uploaded images and extracted spreadsheets are never stored
Supported Inputs
Multipart (`file`): JPG, PNG, WebP, or scanned PDF (up to 10 MB; defaults to `mode=tables`)
Structured Output
Converts photographed tables, screenshots, whiteboard grids, and scanned schedules directly into structured tabular rows ready for `.xlsx` / `.csv` export and n8n pipelines
Default Table Mode & Zero Retention: POST /v1/image-to-excel defaults to mode=tables and accepts raw binary files up to 10 MB (JPG, PNG, WebP, or scanned PDFs). Uploaded images execute strictly in memory—never written to storage buckets and logged with raw_response: null.

Request Parameters (multipart/form-data)

FieldTypeRequiredDescription
x-api-key (header)stringRequiredYour StructOCR API key from Dashboard → API Keys.
filebinaryRequiredRaw JPG, PNG, WebP (or PDF) file up to 10 MB. Verified via file magic bytes.
modestringOptionalDefaults to tables. Pass auto for key-value header fields + tables, or json with schema.
schemastringOptionalComma-separated keys, JSON string array, or JSON Schema (max 50 fields, depth 4) returned in custom_data.
pages / stitch_tablesstring / boolOptionalApplies if a multi-page PDF scan is uploaded (pages=all or 1-5; stitch_tables=true).

Code Examples (Write .xlsx & UTF-8 CSV)

Every snippet sends a direct binary multipart upload to POST /v1/image-to-excel and writes extracted tables to Excel or CSV.

curl -X POST "https://api.structocr.com/v1/image-to-excel" \
  -H "x-api-key: YOUR_API_KEY" \
  -F "file=@./price-sheet-photo.jpg"

Configure an HTTP Request node in n8n to turn incoming form uploads, Gmail attachments, or Google Drive images into Excel (.xlsx) files or Google Sheets rows:

  • Method & URL: POST https://api.structocr.com/v1/image-to-excel
  • Authentication: Generic Credential Type → Header Auth (Name: x-api-key, Value: your StructOCR API key)
  • Send Body: On → Form-Data → Parameter Type: n8n Binary File, Name: file, Input Data Field Name: data (or your trigger's binary property name)
  • Next Node (Code → Convert to File / Google Sheets): Expand document.tables[0].rows into one item per spreadsheet row using the snippet below, then attach n8n's built-in Convert to File → Convert to XLSX or Google Sheets → Append Row node.
// n8n Code Node (Run Once for All Items, JavaScript)
// Expands document.tables[0] into one n8n item per row for Excel (.xlsx) or Google Sheets
const rowsOut = [];

for (const item of $input.all()) {
  const res = item.json;
  if (!res.success || !res.document?.tables?.length) continue;

  for (const table of res.document.tables) {
    const headers = table.headers || [];
    for (const row of table.rows || []) {
      const record = { _table: table.title || table.id };
      headers.forEach((h, idx) => {
        const key = (h || `col_${idx + 1}`).trim();
        record[key] = row[idx] ?? "";
      });
      rowsOut.push({ json: record });
    }
  }
}

return rowsOut;

Response Payload (Synthetic Example)

Every row in document.tables[].rows is normalized to match headers.length, using "" for empty cells.

{
  "success": true,
  "mode": "tables",
  "document": {
    "summary": {
      "document_type": "price_list",
      "title": "Pricing Schedule (Synthetic Sample)",
      "language": "en"
    },
    "fields": {},
    "tables": [
      {
        "id": "table_1",
        "title": "Pricing Schedule",
        "page_range": [
          1,
          1
        ],
        "stitched": false,
        "headers": [
          "SKU",
          "Description",
          "Qty",
          "Price"
        ],
        "rows": [
          [
            "SKU-101",
            "Steel Bracket",
            "24",
            "$18.50"
          ],
          [
            "SKU-102",
            "Hex Bolt Pack",
            "50",
            "$9.00"
          ],
          [
            "SKU-103",
            "Mounting Plate",
            "12",
            "$42.00"
          ]
        ]
      }
    ]
  },
  "custom_data": null,
  "pages": [
    {
      "page": 1,
      "status": "ok",
      "tables_found": 1
    }
  ],
  "usage": {
    "page_count": 1,
    "pages_processed": 1,
    "pages_succeeded": 1,
    "credits_per_page": 2,
    "credits_charged": 2
  }
}

Billing & Error Codes

Credit Accounting

2 credits per succeeded image/page. Validation errors (400, 413, 415) fail before billing at 0 credits; upstream extraction failures refund automatically.

Common Status Codes

401/403 invalid key · 402 insufficient credits · 413 file > 10 MB · 415 unsupported MIME (must be JPG/PNG/WebP/PDF) · 503 transient capacity retry.

Try POST /v1/image-to-excel Live