# Excel & CSV Extractor — xlsx, xls, csv to JSON (`gochujang/excel-extractor`) Actor

Extract data from Excel (.xlsx) and CSV files into structured JSON. Input: URL or base64. Output: sheet name, headers, rows. Batch multiple files. $0.01/file + $0.0001/row.

- **URL**: https://apify.com/gochujang/excel-extractor.md
- **Developed by:** [Hojun Lee](https://apify.com/gochujang) (community)
- **Categories:** Developer tools
- **Stats:** 3 total users, 2 monthly users, 100.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

Pay per usage

This Actor is paid per platform usage. The Actor is free to use, and you only pay for the Apify platform usage, which gets cheaper the higher subscription plan you have.

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

## What's an Apify Actor?

Actors are web data automations that power AI and operations. They run on the Apify platform to scrape websites, process data, connect APIs, and automate workflows.
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.
Actors are written with capital "A".

## 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.
The best way to integrate Actors is as follows.

- **AI agents and MCP clients** — the [Apify MCP server](https://docs.apify.com/integrations/mcp.md) at `https://mcp.apify.com` (remote, streamable HTTP, OAuth on first use).
- **Agentic workflows and local Actor development** — [Agent Skills](https://apify.com/.well-known/agent-skills/index.json) with the [Apify CLI](https://docs.apify.com/cli/docs.md): `npm install -g apify-cli`, then `apify login`.
- **JavaScript/TypeScript projects** — the official [JS/TS client](https://docs.apify.com/api/client/js/docs.md): `npm install apify-client`.
- **Python projects** — the official [Python client](https://docs.apify.com/api/client/python/docs.md): `pip install apify-client`.
- **Any other language** — the [REST API](https://docs.apify.com/api/v2.md).

For usage examples, see the [API](#api) section below.

For more details, see Apify documentation as [Markdown index](https://docs.apify.com/llms.txt) and [Markdown full-text](https://docs.apify.com/llms-full.txt).

# README

## Excel & CSV Extractor — xlsx, xls, csv to JSON

> Extract structured data from **Excel (.xlsx) and CSV files** into clean JSON. Pass a URL or base64-encoded file — get back sheet names, column headers, and rows. Works with multi-sheet workbooks. Perfect for data pipelines, AI ingestion, and ETL workflows. **$0.01/file + $0.0001/row.**

### Run in 30 seconds

Paste any Excel or CSV URL:

```
https://example.com/sales-report.xlsx
https://data.gov/dataset/prices.csv
https://github.com/user/repo/raw/main/data.xlsx
```

No API keys needed.

***

### What you get

One output record per sheet:

```json
{
  "file_name": "sales-report.xlsx",
  "sheet": "Q1 Sales",
  "row_count": 842,
  "columns": ["Date", "Product", "Region", "Revenue", "Units"],
  "rows": [
    {"Date": "2026-01-03", "Product": "Widget A", "Region": "US", "Revenue": "12400", "Units": "124"},
    {"Date": "2026-01-04", "Product": "Widget B", "Region": "EU", "Revenue": "8900", "Units": "89"}
  ]
}
```

Enable `flatMode: true` to get one record per row instead.

***

### Input options

| Field | Default | Description |
|-------|---------|-------------|
| `fileUrl` | — | Direct URL to .xlsx or .csv file |
| `fileBase64` | — | Base64-encoded file (alternative) |
| `fileName` | auto | File name for format detection |
| `includeHeaders` | `true` | First row = column headers |
| `sheetNames` | `[]` (all) | Specific sheets to extract |
| `maxRowsPerSheet` | `10000` | Row cap per sheet (up to 500,000) |
| `flatMode` | `false` | One output record per row |

***

### Use cases

1. **AI data ingestion** — Feed spreadsheet data into Claude, GPT, or RAG pipelines
2. **ETL pipelines** — Transform Excel reports into structured database records
3. **Financial analysis** — Extract P\&L, balance sheet, or budget data for processing
4. **Survey/form data** — Parse exported Google Sheets or SurveyMonkey exports
5. **Inventory systems** — Import product catalogs from supplier Excel files
6. **Automation** — Trigger on new file uploads, extract data, push to APIs
7. **Multi-sheet reports** — Extract all tabs from complex workbooks in one run
8. **Data validation** — Check column consistency, row counts, and value types

***

### Pricing

| Event | Price |
|-------|-------|
| Actor start | $0.01 |
| Per row extracted | $0.0001 |

| Example | File | Rows | Cost |
|---------|------|------|------|
| Small CSV (500 rows) | 1 | 500 | $0.06 |
| Sales report (5,000 rows) | 1 | 5,000 | $0.51 |
| Large dataset (50,000 rows) | 1 | 50,000 | $5.01 |

***

### Supported formats

| Format | Extension | Notes |
|--------|-----------|-------|
| Excel (modern) | `.xlsx`, `.xlsm` | Multi-sheet, formulas evaluated |
| CSV | `.csv`, `.tsv` | Auto-detects encoding (UTF-8, Latin-1) |

> **Legacy `.xls`**: Not supported. Open in Excel or LibreOffice and save as `.xlsx`.

***

### Related actors

- **[PDF Text Extractor](https://apify.com/gochujang/pdf-text-extractor)** — Extract text from PDF files
- **[DOCX Text Extractor](https://apify.com/gochujang/docx-text-extractor)** — Extract text from Word documents
- **[RSS Feed Parser](https://apify.com/gochujang/rss-feed-parser)** — Parse RSS/Atom feeds into JSON
- **[Web to Markdown](https://apify.com/gochujang/web-to-markdown)** — Convert web pages to clean text

# Actor input Schema

## `fileUrl` (type: `string`):

Direct URL to an Excel (.xlsx) or CSV file

## `fileBase64` (type: `string`):

Base64-encoded file content (alternative to fileUrl)

## `fileName` (type: `string`):

Used to detect format (.xlsx, .csv). Auto-detected from URL if omitted.

## `includeHeaders` (type: `boolean`):

Treat first row as column headers (rows output as objects). Default: true.

## `sheetNames` (type: `array`):

Which sheets to extract. Leave empty to extract all sheets.

## `maxRowsPerSheet` (type: `integer`):

Maximum rows to extract per sheet. Default: 10000.

## `flatMode` (type: `boolean`):

Output one dataset record per data row instead of one record per sheet.

## Actor input object example

```json
{
  "fileUrl": "https://example.com/data.xlsx",
  "includeHeaders": true,
  "sheetNames": [],
  "maxRowsPerSheet": 10000,
  "flatMode": false
}
```

# Actor output Schema

## `dataset` (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 = {};

// Run the Actor and wait for it to finish
const run = await client.actor("gochujang/excel-extractor").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 = {}

# Run the Actor and wait for it to finish
run = client.actor("gochujang/excel-extractor").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 '{}' |
apify call gochujang/excel-extractor --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "type": "http",
            "url": "https://mcp.apify.com/?tools=fetch-actor-details,gochujang/excel-extractor"
        }
    }
}

```

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/mLCxQsjuon0cW5sqC/builds/pLXEqPEeEddd4cKKL/openapi.json
