Skip to main content
POST
/
extract
/
spreadsheet
Extract spreadsheets
curl --request POST \
  --url https://api.horizon.new/v1/extract/spreadsheet \
  --header 'Content-Type: application/json' \
  --data '{
  "sourceUrl": "<string>",
  "sourceName": "<string>",
  "options": {},
  "webhookUrl": "<string>"
}'
{
  "jobId": "job_01hx9q9",
  "status": "queued",
  "statusUrl": "<string>",
  "result": {},
  "etaSeconds": 123,
  "jobType": "extract/pdf"
}
Normalize tabular data from spreadsheets into structured rows with column descriptors. Supports CSV, XLSX, Apple Numbers (export), and Google Sheets exports.

Request body

  • sourceUrl — HTTPS or signed URL to the spreadsheet file. Required if file is not provided.
  • file — Optional uploaded spreadsheet/CSV file via multipart/form-data.
  • sourceName — Optional label saved with the extracted dataset.
  • options — Optional object. Supported keys:
    • sheet — Name or index of the worksheet to extract (default: all sheets).
    • headerRow — Row number containing column headers (default 1).
    • dateFormat — Output date format (default ISO 8601).
    • numericLocale — Locale for decimal parsing (default en-US).
  • webhookUrl — Optional HTTPS URL Horizon should call when the extraction finishes.

Sample request

curl https://api.horizon.new/v1/extract/spreadsheet \
  -H "Content-Type: application/json" \
  -d '{
    "sourceUrl": "https://cdn.example.com/reports/sales-q1-2025.xlsx",
    "sourceName": "Sales Q1 2025",
    "options": {
      "sheet": "Summary",
      "headerRow": 2,
      "dateFormat": "yyyy-MM-dd",
      "numericLocale": "en-US"
    }
  }'

# or upload the spreadsheet directly

curl https://api.horizon.new/v1/extract/spreadsheet \
  -H "Content-Type: application/json" \
  -d '{
    "file": "data:application/vnd.openxmlformats-officedocument.spreadsheetml.sheet;base64,UEsDBBQABgAIA...",
    "sourceName": "Sales Q1 2025",
    "options": {
      "sheet": "Summary",
      "headerRow": 2,
      "dateFormat": "yyyy-MM-dd",
      "numericLocale": "en-US"
    }
  }'

Response

Returns 202 Accepted with jobId, status, statusUrl, and optional etaSeconds. Completed jobs include normalized rows, column schemas, and summary statistics.

Notes

  • Large sheets run asynchronously; chunking respects logical rows.
  • Hidden sheets are ignored unless explicitly referenced via sheet.
  • Numbers files must be exported to .xlsx or .csv before ingestion.
  • Poll GET /jobs/{jobId} (the same as statusUrl) to monitor progress or retrieve normalized rows after the job completes.
  • To upload the spreadsheet directly, send multipart/form-data with a file field instead of sourceUrl.

x402 flow

Spreadsheet extraction is priced via Coinbase’s x402 protocol. A missing proof triggers:
HTTP/1.1 402 Payment Required
Content-Type: application/json

{
  "x402Version": 1,
  "accepts": [
    {
      "scheme": "exact",
      "network": "base-sepolia",
      "maxAmountRequired": "180000",
      "resource": "POST /extract/spreadsheet",
      "description": "Horizon spreadsheet extraction",
      "mimeType": "application/json",
      "payTo": "0xYourReceivingWallet",
      "maxTimeoutSeconds": 300,
      "asset": "0xYourUSDCContract",
      "extra": {
        "name": "USDC",
        "version": "1"
      }
    }
  ],
  "error": null
}
Provide the accepts payload to your facilitator, call /verify and /settle, then replay the POST with the Base64 token in X-PAYMENT. Horizon resumes the extraction and includes X-PAYMENT-RESPONSE for your records.

Body

application/json

Provide either sourceUrl or file.

sourceUrl
string<uri>
sourceName
string
options
object

Extraction hints such as language, segmentLength, transcriptionModel, or sheet preferences depending on the endpoint.

webhookUrl
string<uri>

Webhook to call when the extraction completes.

file
file

Upload the raw file instead of providing sourceUrl.

Response

Extraction job accepted

jobId
string
required
Example:

"job_01hx9q9"

status
enum<string>
required
Available options:
queued,
processing,
completed,
failed
statusUrl
string<uri>
required

Canonical link to GET /jobs/{jobId} for this job.

jobType
string
required
Example:

"extract/pdf"

result
object | null

Present when the job completes synchronously.

etaSeconds
integer | null

Estimated seconds until completion.