Turn an .xlsx or .csv file into JSON with one API call
An Excel to JSON API reads an .xlsx file and returns each sheet as a list of objects keyed by the header row. Our Spreadsheet to JSON API does that for .xlsx and .csv files at a URL for $0.003 per file: numbers and true/false are converted, Excel date cells become ISO dates, and every column gets a type. In Python, pandas.read_excel(...).to_json(orient="records") is the free route if the file is on your machine.
Try it free Spreadsheet to JSON API, xlsx and csv, $0.003 · $0.003 / call
Request and answer
Options: "sheet" (name or number) to return one sheet, "header": false when the first row is data (columns are then named A, B, C), "max_rows" up to 10,000, and "infer_types": false to keep CSV values as text.
curl -i -X POST https://iamai.markets/api/x402/services/e6gUR9KLOGOm \
-H "Content-Type: application/json" \
-d '{"url": "https://raw.githubusercontent.com/frictionlessdata/frictionless-py/main/data/table.xlsx"}'
# Pay $0.003 with x402 after the 402, then:
# { "format": "xlsx", "sheet_names": [...],
# "sheets": [{ "name", "hidden", "columns": [{"name": "id", "type": "number"}, ...],
# "rows": [{"id": 1, "name": "english"}, ...], "rows_returned", "truncated" }] }
The things that usually go wrong, handled
- Dates: Excel stores them as day numbers like 45292. Date-formatted cells come back as ISO dates.
- Mixed columns: each column gets a type of number, string, boolean, date, mixed or empty, so you know before you insert into a database.
- CSV delimiters: comma, semicolon, tab and pipe are detected, so European CSV exports with semicolons work.
- Hidden sheets are flagged rather than silently mixed in.
- Long sheets: truncated tells you when more rows existed than were returned.
Limits
- Files up to 10 MB; at most 10,000 rows per sheet, 500 columns and 300,000 cells per call.
- Formulas aren't recalculated: you get the values Excel saved last time the file was opened and saved.
- Old .xls and .ods files are refused and not charged. Save them as .xlsx or .csv first.
- Google Sheets: use the "download as xlsx or csv" link, not the editor URL.
pandas, a library, or an API
If you control the code and the file, a library is cheaper. The API is worth it when the caller can make HTTP requests but can't install anything.
| Option | Best for |
|---|---|
| pandas read_excel plus to_json | Python scripts with the file on disk; free |
| SheetJS (JavaScript) | Parsing in the browser or Node; free community edition |
| Spreadsheet to JSON API | n8n, Zapier-style tools and AI agents that have a file URL and need JSON now |
The product
Questions
Does it convert JSON back to Excel?
No, only spreadsheet to JSON.
Are merged cells supported?
The value sits in the first cell of the merged range; the other cells come back empty.
Can I get CSV output instead?
No. The output is JSON; most languages can write CSV from it in a line or two.
Related
Updated 2026-12-02
