Excel & CSV to JSON: Spreadsheet Rows for AI Agents and n8n avatar

Excel & CSV to JSON: Spreadsheet Rows for AI Agents and n8n

Pricing

Pay per usage

Go to Apify Store
Excel & CSV to JSON: Spreadsheet Rows for AI Agents and n8n

Excel & CSV to JSON: Spreadsheet Rows for AI Agents and n8n

Turn Excel (.xlsx, .xls) and CSV files into clean JSON: one item per row, keyed by the header. Finds the header row under title lines, fills merged cells, keeps numbers, dates and booleans typed, and decodes Big5, GBK, Shift-JIS and EUC-KR CSVs.

Pricing

Pay per usage

Rating

0.0

(0)

Developer

Ryan Lin

Ryan Lin

Maintained by Community

Actor stats

0

Bookmarked

2

Total users

1

Monthly active users

3 days ago

Last modified

Features

Limited permissions

Share

Excel & CSV to JSON: spreadsheet rows for AI agents, n8n and code

Give it links to Excel or CSV files and get every data row back as one clean JSON item, keyed by the column headers.

把 Excel(.xlsx / .xls)與 CSV 檔轉成乾淨的 JSON:一列一筆、以欄位名稱為鍵,自動找出表頭、補齊合併儲存格,並正確解碼 Big5 等編碼。

AI agents cannot open a binary .xlsx, and n8n workflows need rows, not files. This Actor does the boring parts that usually go wrong:

  • Finds the real header row. Report-style sheets start with a title, a unit note and a blank line. Those are skipped and reported separately; the header is the first row that is as wide as the data and contains only text.
  • Fills merged cells. A region name merged over five rows is present in all five rows, not only the first.
  • Keeps types. Numbers are JSON numbers, booleans are booleans, dates are ISO strings (2026-09-01, 2026-09-03T14:30:00). Whole numbers stored as 125000.0 come back as 125000.
  • Does not destroy codes. In CSV files 02134, 0912345678 and 20-digit IDs stay text; only values that are unambiguously numbers are converted.
  • Reads legacy encodings. CSV files in Big5, GBK/GB18030, Shift-JIS, EUC-KR, UTF-16 and Windows-1252 are detected and decoded, so Chinese, Japanese and Korean text is not garbled.
  • Detects the file type from the content, not from the URL, and reports per-file errors without failing the other files.

No browser, no external API. A typical file finishes in one or two seconds.

What you can do with it

  • Let an AI agent read a spreadsheet. "Open this Excel file and tell me the three customers with the highest revenue" becomes one tool call.
  • Feed rows into n8n, Make or Zapier. Each row arrives as one item, ready for an IF node, a database insert or an email.
  • Import supplier price lists, bank exports and government open data that arrive as .xls or Big5 CSV.
  • Normalise many files into one dataset and export it from Apify as JSON, CSV or Excel with consistent keys (keyStyle: snake_case).

Input

Only fileUrls (or files) is needed.

FieldTypeDefaultWhat it does
fileUrlsarray of strings—Links to .xlsx, .xlsm, .xls, .csv or .tsv files. Public Google Sheets links and GitHub "blob" links work too. Also accepts data: URLs.
filesarray of objects—File content instead of a URL: {"fileName": "a.xlsx", "base64": "..."}.
uploadedFilesarray—Files uploaded in Apify Console.
outputModestringrowsrows: one item per row. sheets: one item per sheet with a rows array.
sheetsarray of stringsall visibleSheet names or numbers (starting at 1).
maxRowsPerSheetinteger100000Return at most this many data rows per sheet.
headerRowinteger0 (auto)Row number of the header. 0 detects it.
hasHeaderbooleantrueTurn off for files without column names; keys become column_1, column_2, …
fillMergedCellsbooleantrueCopy the value of a merged cell to every cell it covers.
includeHiddenSheetsbooleanfalseAlso read hidden sheets.
keyStylestringoriginaloriginal, snake_case or camelCase. Non-ASCII letters are kept.
inferTypesbooleantrueCSV only: convert unambiguous numbers and true/false.
includeSourcebooleantrueAdd _file, _sheet and _row to each row.
delimiterstringautoCSV separator: auto, comma, semicolon, tab, pipe or a single character.
encodingstringautoCSV text encoding, for example big5 or cp1252.
maxFileSizeMbinteger50Larger files are not downloaded.
proxyConfigurationobjectoffOnly if the file host refuses direct downloads.

Example: preview a file for an AI agent

{
"fileUrls": ["https://go.microsoft.com/fwlink/?LinkID=521962"],
"maxRowsPerSheet": 20,
"keyStyle": "snake_case"
}

Example: one sheet of a report, as a single item

{
"fileUrls": ["https://example.com/q3-report.xlsx"],
"sheets": ["Orders"],
"outputMode": "sheets"
}

Example: file content from n8n or an agent

{
"files": [{ "fileName": "export.csv", "base64": "5aeT5ZCNLOmDqOmWgA0K..." }]
}

Output

Rows mode (default)

One dataset item per spreadsheet row. This is a real result for Microsoft's public "Financial Sample" workbook with keyStyle: snake_case:

{
"segment": "Government",
"country": "Canada",
"product": "Carretera",
"discount_band": "None",
"units_sold": 1618.5,
"manufacturing_price": 3,
"sale_price": 20,
"gross_sales": 32370,
"discounts": 0,
"sales": 32370,
"cogs": 16185,
"profit": 16185,
"date": "2014-01-01",
"month_number": 1,
"month_name": "January",
"year": "2014",
"_file": "Financial Sample.xlsx",
"_sheet": "Sheet1",
"_row": 2
}

_row is the row number in the original sheet, so a value can be traced back. year is "2014" because that column is stored as text in the workbook; Excel cell types are kept as they are.

Sheets mode

One item per sheet:

{
"url": "https://example.com/q3-report.xlsx",
"fileName": "q3-report.xlsx",
"fileType": "xlsx",
"sheetName": "訂單",
"sheetIndex": 1,
"headerRow": 4,
"headers": ["地區", "訂單編號", "客戶 名稱", "金額", "出貨日", "已出貨"],
"rowCount": 3,
"truncated": false,
"preamble": ["2026 年第三季訂單明細", "單位:新臺幣元 製表日:2026-10-01"],
"rows": [
{ "地區": "北區", "訂單編號": "A001", "客戶 名稱": "台積電", "金額": 125000, "出貨日": "2026-09-01", "已出貨": true },
{ "地區": "北區", "訂單編號": "A002", "客戶 名稱": "聯發科", "金額": 98000.5, "出貨日": "2026-09-03T14:30:00", "已出貨": false },
{ "地區": "南區", "訂單編號": "A003", "客戶 名稱": "鴻海", "金額": 43000, "出貨日": "2026-09-07", "已出貨": true }
],
"warnings": [],
"error": null
}

This example comes from the Actor's test workbook: the header is on row 4 under two title lines (returned in preamble), and "北區" is a cell merged over two rows.

Errors

A file that cannot be downloaded or read does not stop the run. In rows mode it produces one item:

{ "_file": "https://example.com/nope.xlsx", "_sheet": null, "_row": null, "_error": "Download failed: HTTP 404 (file not found)." }

In sheets mode the item has the usual fields with error set. The run is marked as failed only when every file failed.

Run summary

The OUTPUT record of the run's key-value store lists every file with its sheets, detected header row, headers, row counts, CSV encoding and delimiter, warnings and errors. Read it when you need to know what was found before looking at the rows.

Use with AI agents (MCP)

The Actor works as a tool for Claude, ChatGPT, Cursor and other MCP clients through the Apify MCP server. Add it with this server URL:

https://mcp.apify.com?tools=arched_axolotl/spreadsheet-to-json

Then ask in plain language, for example: "Read https://example.com/sales.xlsx and tell me which product had the highest profit."

Settings that work well for agents:

{
"fileUrls": ["https://example.com/sales.xlsx"],
"outputMode": "sheets",
"maxRowsPerSheet": 200,
"keyStyle": "snake_case"
}

outputMode: "sheets" returns each table in one result instead of hundreds of small items, and maxRowsPerSheet protects the context window. For a first look at an unknown file, use maxRowsPerSheet: 5.

Use with n8n

In n8n, add the Apify node, choose Run an Actor and get dataset, pick this Actor and paste the input JSON. In rows mode each spreadsheet row arrives as one n8n item.

A typical workflow:

  1. Trigger — a new email attachment, a new file in Google Drive, or a schedule.
  2. Apify — run this Actor with fileUrls set to the file link (or files with the base64 content of an n8n binary property).
  3. IF / Filter — for example 金額 greater than 100000, and _error is empty.
  4. Postgres / Google Sheets / Slack — insert or send the row.

The same works in Make and Zapier with their Apify modules, or from any tool that can call a URL:

curl -X POST "https://api.apify.com/v2/acts/arched_axolotl~spreadsheet-to-json/run-sync-get-dataset-items?token=YOUR_TOKEN" \
-H "Content-Type: application/json" \
-d '{"fileUrls": ["https://go.microsoft.com/fwlink/?LinkID=521962"], "maxRowsPerSheet": 10}'

This call waits for the run and returns the rows as JSON in one response.

Limits to know about

  • One table per sheet. The Actor reads one header row and the rows below it. Sheets that hold several separate tables side by side or stacked come back as one table with the first header.
  • Single-row headers. Two-level headers (a group name above the column names) are not combined; the detected header is one row. Set headerRow to choose which.
  • Formulas. The saved result of a formula is returned. A workbook written by a program that never calculated its formulas has no saved results, and those cells are null.
  • Formatting is ignored. A cell showing 12.5% holds 0.125 and that number is returned. Colours, comments, hyperlinks, charts and images are not read.
  • Merged cells in large files. fillMergedCells applies to .xlsx files up to 20 MB; larger workbooks are streamed and only the first cell of a merge has the value (a warning says so).
  • CSV dates stay text. 2024-03-01 and 03/01/2024 are not converted, because the day/month order cannot be known.
  • Not supported: .xlsb, .ods, Apple Numbers, password-protected workbooks, and Google Sheets that are not shared publicly.
  • Item size. In sheets mode a sheet larger than about 9 MB of JSON is cut to fit one dataset item; use rows mode for big sheets.

FAQ

How fast is it? The 700-row, 16-column sample workbook above is downloaded and converted in about one second once the container has started.

The wrong row was used as the header. What now? Set headerRow to the correct row number (starting at 1), or hasHeader: false if the file has none. The OUTPUT record shows which row was detected.

Why is a number returned as text? In Excel files the cell is stored as text in the workbook (a green triangle in Excel). In CSV files the value has a leading zero, more than 15 digits, a + sign or a unit such as %; converting those would change the data.

Can it read a Google Sheet? Yes, if the sheet is shared with "anyone with the link": paste the normal sheet URL and the Actor downloads it as .xlsx. A sheet that is not public returns Google's sign-in page, which is reported as an error for that file.

What happens if one file is broken? The other files are still converted. The broken file gets an item with _error (or error in sheets mode) and is listed in OUTPUT.

Is my data stored? Files are processed in memory during the run. Results are stored in your own Apify dataset under your account's retention settings. No third-party service is called.

Need PDF, Word or PowerPoint instead? Use the companion Actor arched_axolotl/document-to-markdown, which also turns spreadsheets into Markdown tables.