# Excel & CSV to JSON Rows: XLSX from URL, every sheet (`steadydata/spreadsheet-to-rows`) Actor

Rows of any Excel (XLSX) or CSV file by URL, up to 200 files a run and 5,000 rows each: one JSON object per row keyed by the header row, with sheet name, row number and counts, from every sheet or one you name. Dates as ISO, numbers as numbers, formulas as cached values. Pay per row.

- **URL**: https://apify.com/steadydata/spreadsheet-to-rows.md
- **Developed by:** [Steadydata Team](https://apify.com/steadydata) (community)
- **Categories:** AI, Developer tools, Automation
- **Stats:** 2 total users, 1 monthly users, 100.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

from $0.20 / 1,000 row delivereds

This Actor is paid per event. You are not charged for the Apify platform usage, but only a fixed price for specific events.
Since this Actor supports Apify Store discounts, the price gets lower the higher subscription plan you have.

Learn more: https://docs.apify.com/actors/running/actors-in-store.md#pay-per-event

## What's an Apify Actor?

An Actor is a serverless cloud program that runs on the Apify platform. It has two run modes.
In Batch mode, an Actor accepts a well-defined JSON input, performs an action which can take anything from a few seconds to a few hours,
and optionally produces a well-defined JSON output, datasets with results, or files in key-value store.
In Standby mode, an Actor provides a web server which can be used as a website, API, or an MCP server.

Apify vocabulary and the platform model are defined once, in the agent quickstart at https://apify.com/agents.md.

## How to integrate an Actor?

If asked about integration, you help developers integrate Actors into their projects.
You adapt to their stack and deliver integrations that are safe, well-documented, and production-ready.

Do not guess an integration path. Every one of them is in the agent quickstart at https://apify.com/agents.md: the Apify MCP server, Agent Skills with the Apify CLI, the JavaScript and Python clients, the REST API, and the account-free path for an agent with no human to sign in. It also carries the rule on stating cost before the first paid run.

For examples already wired to this Actor's own input schema, see the [API](#api) section below.

Each client library has reference documentation the quickstart does not restate: [JavaScript/TypeScript](https://docs.apify.com/api/client/js/docs.md) (`npm install apify-client`) and [Python](https://docs.apify.com/api/client/python/docs.md) (`pip install apify-client`).

# README

## Spreadsheet to JSON Rows: XLSX & CSV from URL, every sheet

Rows of any XLSX or CSV file by URL, up to 200 files a run and 5,000 rows each: one JSON object per row keyed by the header row, with sheet name, row number, columns and counts, from every sheet or one you name. Dates as ISO, numbers as numbers, formulas as cached values. Robots-aware. Pay per row.

### Why this scraper

- **Only delivered results are charged.** Inputs that fail come back as clear error
  records at no cost.
- One fetch per file, parsed in memory with openpyxl and the standard CSV reader, no browser and no start fee. Measured on the platform: 59 rows from three XLSX workbooks (six sheets) and a CSV in 9 seconds for a hundredth of a cent; a 17,000-row CSV parses in under a second.
- Rows you can use directly: one JSON object per row keyed by the header row (or by column letter when there is no header), with the sheet name and index, the row number as it is in the sheet, the column list and the row count of the sheet. Numbers stay numbers, also in CSV (except codes with leading zeros), dates become ISO dates, timestamps ISO date-times, booleans stay booleans, formulas give their cached value, empty rows are skipped and not charged.
- Every sheet or one: leave `sheet` empty for all sheets in order, or name a sheet or give its number. CSV delimiters (comma, semicolon, tab, pipe) are detected; UTF-8 with or without BOM and Latin-1 are read.
- Robots-aware: each host's robots.txt is read once per run and a closed path comes back as a free `ROBOTS_DISALLOWED` row (measured: github.com's `/raw` path; use raw.githubusercontent.com instead).

### Who this is for

Paste direct file links in `urls` (up to 200 per run), optionally name a `sheet`, keep `headerRow` on when the first row holds the column names and set `maxRowsPerFile` (default 1,000, ceiling 5,000, top to bottom across sheets). Built for pulling published spreadsheets (open data, price lists, exports, reports) into automations, databases and dashboards without a desktop tool in the loop.

### Who this is not for

The URL must point at the file itself; a share page, a login-protected link or a Google Sheets web page is not a spreadsheet and comes back as a free `NOT_SPREADSHEET` row (export it as xlsx or csv first). Old binary `.xls` files are not read; save them as `.xlsx`. The header is the first non-empty row of a sheet, so a sheet with a title row above the real header keys its rows by that title row (measured on a test workbook). Formulas without a cached value, as written by some libraries, come back as null. Merged cells give their value in the top-left cell only. Files above 50 MB are refused.

### Input example

```json
{
    "urls": [
        "https://raw.githubusercontent.com/datasets/population/main/data/population.csv"
    ],
    "headerRow": true,
    "maxRowsPerFile": 1000
}
```

### Output example

- `url`
- `fileName`
- `fileType`
- `sheetName`
- `sheetIndex`
- `rowNumber`
- `row`
- `columns`
- `columnCount`
- `sheetRowCount`
- `sheetCount`
- `fileBytes`

Error codes: `INVALID_URL`, `ROBOTS_DISALLOWED`, `NOT_SPREADSHEET`, `NO_ROWS`, `SHEET_NOT_FOUND`, `FETCH_FAILED`, `BLOCKED`.

One delivered row looks like this:

```json
{
  "url": "https://raw.githubusercontent.com/apache/poi/trunk/test-data/spreadsheet/SampleSS.xlsx",
  "fileName": "SampleSS.xlsx",
  "fileType": "xlsx",
  "sheetName": "First Sheet",
  "sheetIndex": 1,
  "rowNumber": 2,
  "row": {
    "Test spreadsheet": "2nd row",
    "B": "2nd row 2nd column"
  },
  "columns": [
    "Test spreadsheet",
    "B"
  ],
  "columnCount": 2,
  "sheetRowCount": 2,
  "sheetCount": 3,
  "fileBytes": 9112,
  "status": "ok"
}
```

### Related actors from steadydata

- [pdf-text-extractor](https://apify.com/steadydata/pdf-text-extractor): the same idea for PDF files
- [url-status-redirect-checker](https://apify.com/steadydata/url-status-redirect-checker): check the URLs you find in a sheet
- [webpage-to-markdown](https://apify.com/steadydata/webpage-to-markdown): a web page as clean text instead of a file

### Pricing

Pay per event: one `row-delivered` event per delivered result. No charge for inputs
that fail, no separate platform-usage surcharge.

**Free Apify plan:** this actor delivers up to 25 rows per run for accounts on the Apify free
plan, and then stops with a message. That limit is set by us, not by Apify. It exists so the
actor keeps paying for itself for the people who do pay. Any paid Apify plan runs it at full
size, billed per delivered row, with failed rows never charged.

**Reviews:** if this actor saves you time, a short review on this page is the one thing that
helps most. Ratings are what other buyers look at first, and we have no other way to ask.

### FAQ

**Is personal data collected?**
Nothing beyond what is in your file. The actor reads only the URLs you give it and keeps nothing after the run.

**How are duplicate or empty column names handled?**
An empty header cell gets its column letter as key; a repeated name gets a counter (`Amount`, `Amount (2)`), so every key is unique and no column is lost.

**Why does `rowNumber` skip numbers?**
It is the row's number in the sheet, and empty rows are skipped; a row after an empty row keeps its own number, so you can find it back in the file.

**Can I read one sheet of a large workbook?**
Yes: set `sheet` to its name or number. The whole file is still downloaded, but only that sheet's rows are delivered and charged.

**What does a run cost when a file fails?**
Nothing. `ROBOTS_DISALLOWED`, `NOT_SPREADSHEET`, `SHEET_NOT_FOUND`, `NO_ROWS`, `FETCH_FAILED`, `INVALID_URL` and `BLOCKED` rows are free; only delivered rows are charged.

**What happens when the source changes?**
Sources change from time to time; that is the nature of this work. The actor is
monitored daily and fixed fast, and while it is broken you are not charged, because
only delivered results cost anything.

# Changelog

This Actor's version history is a separate document: https://apify.com/steadydata/spreadsheet-to-rows/changelog.md

# Actor input Schema

## `urls` (type: `array`):

One per row, up to 200: direct links to .xlsx or .csv files (https://...). Each host's robots.txt is respected.

## `sheet` (type: `string`):

Name of one sheet to read, or its number starting at 1. Empty reads every sheet.

## `headerRow` (type: `boolean`):

On: the first non-empty row gives the keys. Off: keys are the column letters A, B, C.

## `maxRowsPerFile` (type: `integer`):

Cost ceiling per file across its sheets, top to bottom.

## Actor input object example

```json
{
  "urls": [
    "https://raw.githubusercontent.com/datasets/population/main/data/population.csv"
  ],
  "headerRow": true,
  "maxRowsPerFile": 1000
}
```

# Actor output Schema

## `results` (type: `string`):

No description

# API

You can run this Actor programmatically using our API. Below are code examples in JavaScript, Python, and CLI, as well as the OpenAPI specification and MCP server setup.

## JavaScript example

```javascript
import { ApifyClient } from 'apify-client';

// Initialize the ApifyClient with your Apify API token
// Replace the '<YOUR_API_TOKEN>' with your token
const client = new ApifyClient({
    token: '<YOUR_API_TOKEN>',
});

// Prepare Actor input
const input = {
    "urls": [
        "https://raw.githubusercontent.com/datasets/population/main/data/population.csv"
    ]
};

// Run the Actor and wait for it to finish
const run = await client.actor("steadydata/spreadsheet-to-rows").call(input);

// Fetch and print Actor results from the run's dataset (if any)
console.log('Results from dataset');
console.log(`💾 Check your data here: https://console.apify.com/storage/datasets/${run.defaultDatasetId}`);
const { items } = await client.dataset(run.defaultDatasetId).listItems();
items.forEach((item) => {
    console.dir(item);
});

// 📚 Want to learn more 📖? Go to → https://docs.apify.com/api/client/js/docs

```

## Python example

```python
from apify_client import ApifyClient

# Initialize the ApifyClient with your Apify API token
# Replace '<YOUR_API_TOKEN>' with your token.
client = ApifyClient("<YOUR_API_TOKEN>")

# Prepare the Actor input
run_input = { "urls": ["https://raw.githubusercontent.com/datasets/population/main/data/population.csv"] }

# Run the Actor and wait for it to finish
run = client.actor("steadydata/spreadsheet-to-rows").call(run_input=run_input)

# Fetch and print Actor results from the run's dataset (if there are any)
print(f"💾 Check your data here: https://console.apify.com/storage/datasets/{run.default_dataset_id}")
for item in client.dataset(run.default_dataset_id).iterate_items():
    print(item)

# 📚 Want to learn more 📖? Go to → https://docs.apify.com/api/client/python/docs/quick-start

```

## CLI example

```bash
echo '{
  "urls": [
    "https://raw.githubusercontent.com/datasets/population/main/data/population.csv"
  ]
}' |
apify call steadydata/spreadsheet-to-rows --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "type": "http",
            "url": "https://mcp.apify.com/?tools=fetch-actor-details,steadydata/spreadsheet-to-rows"
        }
    }
}
```

The hosted server signs you in with OAuth on first connect, so no API token belongs in this config. Clients without OAuth support can send an `Authorization: Bearer <APIFY_API_TOKEN>` header instead, using a token from API & Integrations in Apify Console (https://console.apify.com/settings/integrations).

## OpenAPI specification

Download the OpenAPI definition: https://api.apify.com/v2/actors/jqCqgpUkCWbouft0l/builds/Ua0f3BarLuFJrhL1q/openapi.json
