Introduction
The Cellvert API is organized around REST. It accepts multipart/form-data uploads, returns JSON for metadata and errors, and returns the converted file as binary content.
Every request must use HTTPS. Requests over plain HTTP are rejected.
Authentication
Authenticate with your access key as a Bearer token in the Authorization header. You receive your access key by email after your purchase.
Authorization: Bearer cvt_your_access_key
Keep your access key secret. Call the API from your server, never from a web page or mobile app where the key would be visible. If your key is exposed, replace it from the login page.
Rate limits
| Pack | Requests per minute |
|---|---|
| Team | 30 |
| Business | 120 |
| Enterprise | Custom |
When you exceed the limit, the API responds with 429 Too Many Requests. Wait for the number of seconds given in the Retry-After header, then retry.
Errors
Errors return a JSON body with a machine-readable code and a human-readable message:
{
"error": {
"code": "insufficient_pages",
"message": "This file has 42 pages but your balance is 30 pages."
}
}
| Status | Code | Meaning |
|---|---|---|
| 400 | invalid_request | A parameter is missing or invalid. |
| 401 | invalid_key | The access key is missing, wrong or has been replaced. |
| 402 | insufficient_pages | Your balance does not cover the pages in this file. |
| 403 | api_not_included | Your pack does not include API access. |
| 413 | file_too_large | The file exceeds 50 MB or 500 pages. |
| 415 | unsupported_file | The file is not a valid PDF, or it is password-protected. |
| 422 | no_table_found | No text or table could be extracted. No pages are deducted. |
| 429 | rate_limited | Too many requests. See rate limits. |
| 5xx | server_error | Something went wrong on our side. Retry with exponential backoff. No pages are deducted. |
GETGet account
Returns the pack and remaining page balance of the access key.
curl https://cellvert.com/api/v1/account \
-H "Authorization: Bearer cvt_your_access_key"
Response:
{
"plan": "team",
"pages_remaining": 4820,
"api": true,
"email": "finance@example.com"
}
POSTConvert a PDF
Uploads a PDF and returns the converted file in the response body. Pages are deducted only when the conversion succeeds.
Parameters (multipart/form-data)
| Field | Type | Description |
|---|---|---|
file | file, required | The PDF to convert. Maximum 50 MB and 500 pages. |
format | string | xlsx (default) or csv. A CSV file always contains all pages, one after another. |
layout | string | pages (default, one sheet per page) or merge (all pages in one sheet). |
ocr | string | auto (default), always or never. |
lang | string | OCR language code: eng (default), fra, deu, spa, ita, por, nld, pol, swe, dan, tur, chi_sim. |
detect_numbers | boolean | true (default) converts numeric values to numbers. false keeps every value as text. |
Response
On success, the API returns 200 OK with the file as the body and these headers:
| Header | Description |
|---|---|
Content-Type | application/vnd.openxmlformats-officedocument.spreadsheetml.sheet, or text/csv |
Content-Disposition | Suggested file name, for example attachment; filename="statement.xlsx" |
X-Pages-Used | Number of pages deducted for this conversion. |
X-Pages-Remaining | Your balance after this conversion. |
Code examples
curl https://cellvert.com/api/v1/convert \
-H "Authorization: Bearer $CELLVERT_KEY" \
-F "file=@statement.pdf" \
-F "format=xlsx" \
-F "layout=merge" \
-o statement.xlsx
import os
import requests
with open("statement.pdf", "rb") as f:
r = requests.post(
"https://cellvert.com/api/v1/convert",
headers={"Authorization": f"Bearer {os.environ['CELLVERT_KEY']}"},
files={"file": ("statement.pdf", f, "application/pdf")},
data={"format": "xlsx", "layout": "merge"},
timeout=300,
)
if r.ok:
open("statement.xlsx", "wb").write(r.content)
print("Pages remaining:", r.headers["X-Pages-Remaining"])
else:
print(r.status_code, r.json()["error"]["message"])
import { readFile, writeFile } from "node:fs/promises";
const form = new FormData();
form.append("file", new Blob([await readFile("statement.pdf")], { type: "application/pdf" }), "statement.pdf");
form.append("format", "xlsx");
form.append("layout", "merge");
const res = await fetch("https://cellvert.com/api/v1/convert", {
method: "POST",
headers: { Authorization: `Bearer ${process.env.CELLVERT_KEY}` },
body: form,
});
if (res.ok) {
await writeFile("statement.xlsx", Buffer.from(await res.arrayBuffer()));
console.log("Pages remaining:", res.headers.get("X-Pages-Remaining"));
} else {
console.error(res.status, (await res.json()).error.message);
}
Best practices
- Store your access key in an environment variable or a secrets manager, never in source code.
- Check
GET /accountbefore large jobs to make sure your balance covers them. - Retry
429and5xxresponses with exponential backoff. Do not retry4xxerrors without changing the request. - Set a generous timeout (up to 5 minutes) for large scanned files.
- Files sent to the API are processed in memory and deleted immediately after conversion. They are never stored or used for training.
Questions about the API or higher limits? Contact our team.