# JSON to CSV & Excel Converter - Flatten Nested JSON, XLSX (`wood-between-studio/json-csv-excel-converter`) Actor

Convert JSON, JSONL, CSV, TSV and Excel files or Apify datasets to CSV, Excel (XLSX), JSON or JSONL. Flattens nested objects and arrays into clean columns, picks or renames fields, gives download links. $2 per 1,000 files.

- **URL**: https://apify.com/wood-between-studio/json-csv-excel-converter.md
- **Developed by:** [Wood Between Studio](https://apify.com/wood-between-studio) (community)
- **Categories:** Developer tools, Integrations, Automation
- **Features:** Limited permissions
- **Stats:** 2 total users, 1 monthly users, 100.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

from $2.00 / 1,000 file converteds

This Actor is paid per event. You are not charged for the Apify platform usage, but only a fixed price for specific events.

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

## JSON to CSV & Excel Converter: Flatten Nested JSON, Convert CSV, XLSX, JSONL and Apify Datasets

**Convert JSON, JSON Lines, CSV, TSV and Excel files (or any Apify dataset) into CSV, Excel XLSX, JSON, JSONL or TSV**, with nested objects flattened into clean columns (`address.city`, `company.name`) and arrays joined, split into columns or kept as JSON. Pick and order the columns you want, drop the rest, and get a direct download link for every file.

### Why use it?

- **Many inputs.** File URLs (`.json`, `.jsonl`/`.ndjson`, `.csv`, `.tsv`, `.xlsx`), Apify dataset IDs (e.g. the output of another Actor) or pasted JSON. Format is detected automatically, and common wrappers like `{"data": [...]}` or `{"items": [...]}` are unwrapped.
- **Real flattening.** Nested objects become dot-notation columns; arrays are joined with `; `, split into `tags.0`, `tags.1`, or kept as JSON text. Every column across all rows is collected, not just the first row's.
- **Excel-ready output.** XLSX with bold, frozen header row and auto-filter; CSV with UTF-8 BOM so Excel opens accents correctly, and `;` delimiter for European Excel.
- **Cheap and fair.** **$2 per 1,000 output files** plus **$0.50 per 1,000 rows** read. No start fee. Sources that fail are free.

### Use cases

- Turning API responses or scraper output into spreadsheets for clients and colleagues
- Converting Excel files to JSON or CSV for code, databases and no-code tools
- Flattening nested JSON before loading it into Google Sheets, Airtable or a BI tool
- Converting between CSV, TSV, JSON and JSON Lines in automated pipelines (Make, Zapier, n8n, API)

### Input

| Field | Default | Notes |
|---|---|---|
| `fileUrls` | | Direct links to files |
| `datasetIds` | | Apify dataset IDs or names |
| `jsonData` | | Pasted JSON array, object or JSON Lines |
| `outputFormats` | `["csv","xlsx"]` | `csv`, `xlsx`, `json`, `jsonl`, `tsv` |
| `flatten` | `true` | Dot-notation columns for nested objects |
| `arrayMode` | `join` | `join`, `index` or `json` |
| `fields` / `omitFields` | | Keep (in order) or drop columns |
| `csvDelimiter` | `,` | `,`, `;` or `|` |
| `maxRows` | `200000` | Per source |

```json
{ "fileUrls": ["https://jsonplaceholder.typicode.com/todos"], "outputFormats": ["csv", "xlsx"], "fields": ["id", "title", "completed"] }
```

### Output

One dataset row per file written, with the download link:

```json
{ "source": "https://jsonplaceholder.typicode.com/todos", "status": "success", "format": "xlsx", "rows": 200, "columns": 4,
  "columnNames": ["userId", "id", "title", "completed"], "bytes": 14210, "downloadUrl": "https://api.apify.com/v2/key-value-stores/.../records/todos.xlsx" }
```

Files are stored in the run's key-value store (Storage tab) under `<source-name>.<format>`.

### Pricing

Pay per event: **$0.002 per output file** and **$0.0005 per 1,000 rows** read (rounded up per source). No start fee.

### Notes

Only reads the files and datasets you give it. Built by Wood Between Studio. Questions or a format you need? Open an issue on the Issues tab.

# Actor input Schema

## `fileUrls` (type: `array`):

Direct links to .json, .jsonl/.ndjson, .csv, .tsv or .xlsx files. Format is detected from the content type, extension or content.

## `datasetIds` (type: `array`):

IDs (or names) of your Apify datasets, e.g. the output of another Actor run.

## `jsonData` (type: `string`):

Optional: paste a JSON array (or object, or JSON Lines) here.

## `outputFormats` (type: `array`):

One file per format per source.

## `flatten` (type: `boolean`):

Turn {"a":{"b":1}} into a column a.b. Off = nested values are written as JSON text.

## `arrayMode` (type: `string`):

How arrays become columns when flattening.

## `fields` (type: `array`):

Optional. Column names to keep, in this order (flattened names like address.city).

## `omitFields` (type: `array`):

Optional. Columns to remove.

## `csvDelimiter` (type: `string`):

Use ; for Excel in many European locales.

## `maxRows` (type: `integer`):

Safety limit.

## Actor input object example

```json
{
  "fileUrls": [
    "https://jsonplaceholder.typicode.com/todos"
  ],
  "outputFormats": [
    "csv",
    "xlsx"
  ],
  "flatten": true,
  "arrayMode": "join",
  "csvDelimiter": ",",
  "maxRows": 200000
}
```

# Actor output Schema

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

No description

## `summary` (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 = {
    "fileUrls": [
        "https://jsonplaceholder.typicode.com/todos"
    ]
};

// Run the Actor and wait for it to finish
const run = await client.actor("wood-between-studio/json-csv-excel-converter").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 = { "fileUrls": ["https://jsonplaceholder.typicode.com/todos"] }

# Run the Actor and wait for it to finish
run = client.actor("wood-between-studio/json-csv-excel-converter").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 '{
  "fileUrls": [
    "https://jsonplaceholder.typicode.com/todos"
  ]
}' |
apify call wood-between-studio/json-csv-excel-converter --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "type": "http",
            "url": "https://mcp.apify.com/?tools=fetch-actor-details,wood-between-studio/json-csv-excel-converter"
        }
    }
}
```

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/0q486CYytbusNfEqp/builds/yabTS6xur8UJPDVNY/openapi.json
