ScanToExcel API
Integrate AI-powered document extraction directly into your app. Send an image or PDF, get structured spreadsheet data back as JSON, .xlsx, or CSV.
Base URL
https://scantoexcel.ai/api/v1Authentication
All API requests require an API key sent via the Authorization header.
Authorization: Bearer sk_live_your_api_key
Generate your API key for free from the dashboard. The key is shown once at creation and stored only as a hash — copy it right away. You can regenerate or revoke it from the dashboard at any time. Credits control how many pages you can extract.
Quick Start
Extract data from a document image or PDF in one API call.
cURL
# JSON response curl -X POST https://scantoexcel.ai/api/v1/extract \ -H "Authorization: Bearer sk_live_your_api_key" \ -F "file=@receipt.jpg" \ -F "output=json" # Excel file straight to disk curl -X POST https://scantoexcel.ai/api/v1/extract \ -H "Authorization: Bearer sk_live_your_api_key" \ -F "file=@invoice.pdf" \ -F "output=xlsx" -o result.xlsx
Python
import requests
response = requests.post(
"https://scantoexcel.ai/api/v1/extract",
headers={"Authorization": "Bearer sk_live_your_api_key"},
files={"file": open("receipt.jpg", "rb")},
data={"output": "json"}
)
data = response.json()
print(data["title"]) # "Receipt"
print(data["rows"]) # [["Item", "Qty", "Price"], ...]JavaScript / Node.js
const form = new FormData();
form.append("file", fs.createReadStream("receipt.jpg"));
form.append("output", "json");
const res = await fetch("https://scantoexcel.ai/api/v1/extract", {
method: "POST",
headers: { Authorization: "Bearer sk_live_your_api_key" },
body: form,
});
const data = await res.json();
console.log(data.title); // "Receipt"
console.log(data.rows); // [["Item", "Qty", "Price"], ...]API Reference
/v1/extractUpload a document image or PDF and receive structured spreadsheet data. The AI analyzes the visual layout and maps every piece of text to the correct row and column. Multi-page PDFs are returned as one rows array, top to bottom. Billing is 1 credit per page; failed extractions are refunded automatically.
Request (multipart/form-data)
| Parameter | Type | Required | Description |
|---|---|---|---|
file | File | Yes | Image (JPG, PNG, WebP) or PDF (up to 10 pages). Max 20 MB. |
output | String | No | "json" (default), "xlsx", or "csv". JSON returns structured data; xlsx/csv return the file as a binary body with X-Extraction-Id, X-Pages, X-Credits-Used, and X-Credits-Remaining headers. |
detail | String | No | "high" (default, best for dense documents) or "low" (faster, fewer image tokens). |
webhook_url | String | No | HTTPS URL that receives a POST with the full result when the extraction completes. See Webhooks below. |
Response (JSON)
{
"id": "aB3dE9fGhIjK1LmN",
"status": "completed",
"title": "Receipt - Coffee Shop",
"rows": [
["Item", "Qty", "Price"],
["Latte", "2", "9.50"],
["Croissant", "1", "4.25"],
["", "Total", "13.75"]
],
"pages": 1,
"usage": {
"credits_used": 1,
"credits_remaining": 999
}
}Response Fields
| Field | Type | Description |
|---|---|---|
id | String | Persistent extraction ID — use it with GET /v1/extractions/{id} |
status | String | completed or failed |
title | String | AI-generated title for the document |
rows | String[][] | 2D array of cell values. First row is typically headers. |
pages | Number | Number of pages processed (= credits charged) |
usage | Object | credits_used and credits_remaining (null on unlimited plans) |
Rate Limits
60 requests/minute per API key
1,000 API calls/month on the API plan (see pricing)
20 MB max file size
10 pages max per PDF (1 credit per page)
Need higher limits? Contact us for enterprise plans.
Webhooks
Pass an HTTPS webhook_url form field with your request and we POST the full result there as soon as the extraction completes (8 s delivery timeout, no retries).
{
"event": "extraction.completed",
"id": "aB3dE9fGhIjK1LmN",
"status": "completed",
"title": "Invoice #1042",
"rows": [["Item", "Qty", "Price"], ...],
"pages": 1,
"usage": { "credits_used": 1, "credits_remaining": 999 }
}