Agent402 / tools / xlsx-to-json

Excel to JSON

$0.005 per call · USDC via x402 · POST /api/xlsx-to-json

Parse an Excel/ODS/CSV workbook from a URL into JSON rows (header-keyed), per sheet. The agentable half of "convert excel to google sheets": get the data out, no Google account required. Body: {"url":"https://…/file.xlsx","sheet":"Sheet1"?}.

Input

FieldTypeDescription
url *stringPublic URL of the workbook (xlsx, xls, ods, csv)
sheetstringOptional: one sheet name (default: all sheets)

Example output

{
  "sheetNames": [
    "Sheet1"
  ],
  "sheets": [
    {
      "name": "Sheet1",
      "rows": 2,
      "headers": [
        "name",
        "qty"
      ],
      "data": [
        {
          "name": "widget",
          "qty": 4
        }
      ]
    }
  ]
}

Try it — see the 402 challenge (free)

curl -i -X POST https://agent402.tools/api/xlsx-to-json \
  -H "Content-Type: application/json" \
  -d '{"url":"https://example.com/report.xlsx"}'

The response is HTTP 402 Payment Required with exact payment requirements. Any x402 v2 client pays automatically and retries:

Paid call (JavaScript agent)

import { wrapFetchWithPayment } from "@x402/fetch";
import { x402Client } from "@x402/core/client";
import { registerExactEvmScheme } from "@x402/evm/exact/client";
import { privateKeyToAccount } from "viem/accounts";

const client = new x402Client();
registerExactEvmScheme(client, { signer: privateKeyToAccount(KEY) });
const payFetch = wrapFetchWithPayment(fetch, client);

const res = await payFetch("https://agent402.tools/api/xlsx-to-json", {
  method: "POST",
  headers: { "Content-Type": "application/json" },
  body: JSON.stringify({
    "url": "https://example.com/report.xlsx"
  }),
});

Wallet-only. This tool reaches the network/browser/storage, so it is paid in USDC via x402 (no proof-of-work tier).

Related tools

JSON validate & format

FREE with compute · or $0.001 USDC · POST /api/json-format

Validate, pretty-print, or minify JSON. Returns parse errors with position when invalid.

JSON to CSV

FREE with compute · or $0.002 USDC · POST /api/json-to-csv

Convert a JSON array of objects to CSV. Nested objects are flattened to dot-path columns.

CSV to JSON

FREE with compute · or $0.002 USDC · POST /api/csv-to-json

Parse CSV (quoted fields supported) into a JSON array of objects, using the first row as headers (header=false for array…