API documentation
Convert .xlsx files to LLM-ready XML text from your own code.
One endpoint, one key. Base URL: https://spreadsheets4ai.me
Authentication
Every request needs your personal API key in the Authorization header.
Authorization: Bearer sk_…
Get your key on the dashboard — it appears automatically once your API plan is active, and stops working if the subscription lapses. Keys are bound to your Whop account and are verified against your live subscription on every call.
POST /v1/convert
Option A — multipart form upload (recommended)
curl -X POST "https://spreadsheets4ai.me/v1/convert" \
-H "Authorization: Bearer YOUR_API_KEY" \
-F "[email protected]"
Option B — JSON with base64
curl -X POST "https://spreadsheets4ai.me/v1/convert" \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{"file_b64": "'"$(base64 -w0 workbook.xlsx)"'", "filename": "workbook.xlsx"}'
Response
By default you receive the XML-formatted TXT as
text/plain; charset=utf-8, with the suggested output filename
in the X-Suggested-Filename header. Add
?format=json (or Accept: application/json) to get
a JSON envelope with stats:
{
"filename": "llm_optimized_workbook_20261122_101500.txt",
"stats": {
"sheets": 3, "rows": 41, "cells": 217, "formulas": 12,
"input_bytes": 9241, "output_bytes": 15680, "elapsed_ms": 84
},
"content": "<?xml version=\"1.0\" ?>\n<Workbook filename=\"workbook.xlsx\">\n <Sheet name=\"Sales\">\n ..."
}
Python
import requests
resp = requests.post(
"https://spreadsheets4ai.me/v1/convert",
headers={"Authorization": "Bearer YOUR_API_KEY"},
files={"file": open("workbook.xlsx", "rb")},
params={"format": "json"},
)
data = resp.json()
print(data["content"]) # the XML-formatted TXT payload
print(data["stats"]) # sheets, rows, cells, formulas, timing
JavaScript (Node 18+)
import { readFileSync } from "node:fs";
const form = new FormData();
form.append("file", new Blob([readFileSync("workbook.xlsx")]), "workbook.xlsx");
const resp = await fetch("https://spreadsheets4ai.me/v1/convert", {
method: "POST",
headers: { Authorization: "Bearer YOUR_API_KEY" },
body: form,
});
console.log(await resp.text());
No-code tools
Zapier, Make and n8n all speak multipart: send an HTTP request to
https://spreadsheets4ai.me/v1/convert with method POST, a header
Authorization: Bearer …, and a file field named
file. The response body is your text — feed it straight into
your AI step.
GET /v1/me
Check your key, subscription state and remaining quota:
curl "https://spreadsheets4ai.me/v1/me" -H "Authorization: Bearer YOUR_API_KEY"
{
"user_id": "user_…",
"api_access": true,
"web_access": false,
"rate_limit": { "conversions_per_hour": 60, "remaining_this_hour": 57 },
"limits": { "max_upload_mb": 8, "max_cells": 60000, "max_sheets": 30 }
}
Limits & errors
- Uploads up to 8 MB (compressed .xlsx), 30 sheets, and 60,000 cells per workbook.
- Rate limit: 60 conversions per hour per key
(429 responses include
Retry-After). - CORS is enabled, so browser apps can call the API directly with the key in the Authorization header.
| Status | error.code | Meaning |
|---|---|---|
| 401 | unauthorized | Missing or invalid API key |
| 403 | no_subscription | Key is valid but the API plan is not active — renew to continue |
| 413 | too_large / too_many_parts | File exceeds 8 MB or expands beyond safety limits |
| 422 | too_many_cells / too_many_sheets | Workbook exceeds 60,000 cells or 30 sheets — split it |
| 422 | unreadable / not_a_zip / encrypted | Damaged file, not an .xlsx, or password-protected |
| 429 | rate_limited | Hourly quota exhausted — see Retry-After |
| 503 | busy | Converter at capacity — retry shortly |
What the output looks like
<?xml version="1.0" ?>
<Workbook filename="workbook.xlsx">
<Sheet name="Sales">
<Row index="1">
<Cell ref="A1">
<Value>Region</Value>
</Cell>
<Cell ref="E2">
<Formula>=C2*D2</Formula>
<Value>1198.8</Value>
</Cell>
</Row>
</Sheet>
</Workbook>
Every sheet, row index and cell reference is preserved.
Formula cells carry both the formula and the calculated value stored in
the file. Chart-only sheets are noted as type="chartsheet"
since visual charts are not extracted.