# CSV to Parquet Converter: JSON, Datasets & Back (`ucchiii/csv-to-parquet`) Actor

Convert CSV, TSV, JSON, NDJSON files or an Apify dataset into Apache Parquet with typed columns, snappy, zstd or gzip compression and a download link. Also turns Parquet back into CSV, JSON or JSONL. Empty input = free demo.

- **URL**: https://apify.com/ucchiii/csv-to-parquet.md
- **Developed by:** [Actor Factory](https://apify.com/ucchiii) (community)
- **Features:** Limited permissions
- **Stats:** 2 total users, 1 monthly users, 100.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

from $0.91 / 1,000 converted files

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

**CSV to Parquet converter: turn CSV, TSV, JSON, NDJSON files or an Apify dataset into Apache Parquet files with typed columns and a download link — and Parquet back into CSV or JSON.**

Paste one or more file links (or pick files in a key-value store, or a dataset), press **Start**, and get one `.parquet` file per input, ready for DuckDB, pandas, Polars, Spark, BigQuery, Snowflake, Athena or any data lake. Numbers, true/false values, dates and timestamps get real Parquet types; you pick the compression (snappy, zstd, gzip) and the row group size. You pay per converted file — no monthly rent.

**Try it free:** leave every input empty and press **Start** — 5 built-in sample orders are converted to `sample-orders.parquet` (not charged; the result row carries `_demo: true`).

### What you get

Input (`weather.csv`):

```csv
date,precipitation,temp_max,weather
2012-01-01,0.0,12.8,drizzle
2012-01-02,10.9,10.6,rain
```

Result row in the dataset:

| status | file | downloadUrl | rows | columns | bytes | outputFormat | compression | schemaText |
|---|---|---|---|---|---|---|---|---|
| ok | weather.parquet | https://api.apify.com/v2/key-value-stores/…/records/weather.parquet?signature=… | 2 | 4 | 1,336 | parquet | snappy | date: date32\[day], precipitation: double, temp_max: double, weather: string |

- **One output file per input** in the run's key-value store, with a signed **download link**.
- **One dataset row per input**: file name, link, rows, columns, the schema (column name and type), size, input format and delimiter, plus notes. Inputs that fail get an error row instead and are not charged.

### How to use

1. **File URLs** — public links to `.csv`, `.tsv`, `.json`, `.jsonl` / `.ndjson` or `.parquet` files. **And/or** a **key-value store** with your files as records (for example files you uploaded in Apify Console), with optional record keys. **And/or** an **Apify dataset**, for example the results of a scraper run.
2. Optional **Output format** — Parquet (default), or CSV, JSON array or JSON Lines to turn Parquet files back into text.
3. Optional CSV settings: **delimiter** (detected by default), **header row**, **encoding**, and **Detect column types** (off = every column is text).
4. Optional Parquet settings: **compression** (snappy, zstd, gzip, none) and **row group size**.

```json
{
  "fileUrls": ["https://example.com/exports/orders.csv", "https://example.com/api/events.jsonl"],
  "compression": "zstd",
  "rowGroupSize": 100000
}
```

Parquet back to CSV:

```json
{
  "fileUrls": ["https://example.com/lake/orders.parquet"],
  "outputFormat": "csv"
}
```

### Output details

- **Types (CSV)**: integers → `int64`, decimals → `double`, `true`/`false` → `bool`, ISO dates → `date32`, ISO timestamps → `timestamp`, everything else → `string`. Types are detected from the first rows; if a later row does not fit (for example an ID column that is numeric for a million rows and then has `X-12`), that column is read again as text and listed in **notes** — the run does not fail.
- **Types (JSON and datasets)**: a column with only whole numbers → `int64`, numbers → `double`, only true/false → `bool`, anything mixed → `string`. Nested objects become dot columns (`customer.address.city`); arrays are stored as JSON text. Turn off **Flatten nested JSON objects** to keep each top-level object as JSON text.
- **Column names**: empty or duplicate CSV headers are renamed (`column_3`, `name_2`) because Parquet needs unique names. Without a header row, columns are `column_1`, `column_2`, …
- **Parquet → CSV / JSON**: nested Parquet columns (lists, structs, maps) and binary values are written as JSON text in CSV; dates and timestamps as ISO text; binary as base64 in JSON.
- **STATS** record: inputs converted and failed, output format, files and megabytes charged.

### Limits (cannot be raised by input)

- **20 inputs** per run; each file or record up to **500 MB**; a dataset up to **2,000,000 items**; up to **5,000,000 rows** per file (and **10,000 columns** for JSON inputs and datasets); each output file up to **400 MB**.
- In JSON files, one single value (one array element, or a file that is one big object) can be at most 20 MB — use a JSON array or NDJSON for big data.
- Public files only, no login. Links to internal network addresses are blocked.
- Default memory is 512 MB. For very large or wide files or row groups close to 1,000,000 rows, give the run more memory.

### Pricing

Pay per event: **$0.0013 per converted file**, plus **$0.0003 per started megabyte of input after the first 1 MB** (a 1 MB CSV costs $0.0013; a 10 MB CSV costs $0.0013 + 9 × $0.0003 = $0.004). Inputs that fail, inputs over a limit and the demo are free.
Store discounts apply automatically: BRONZE −10%, SILVER −20%, GOLD −30%.
If the maximum charge you set for the run is too low for the next file, that file gets a free error row and nothing more is charged.

### FAQ

**Why Parquet?** Parquet stores data by column with types and compression, so files are often 5–10× smaller than CSV and much faster to query in DuckDB, pandas, Spark or a cloud warehouse.

**Which compression should I pick?** Snappy is the common default and fast. Zstandard (zstd) usually gives the smallest files and is read by current versions of all major tools. Gzip is the safest choice for very old readers.

**My dates came out as text.** Only ISO formats (`2026-03-02`, `2026-03-02 10:15:00`, `2026-03-02T10:15:00Z`) are detected as dates. Other formats stay text, so nothing is guessed wrong.

**Can I convert a scraper's results directly?** Yes — pick its dataset in **Or an Apify dataset**. Nested fields become dot columns.

**Does it change my values?** No rounding or re-formatting: values are only parsed into types. Turn off **Detect column types** to keep every value as the exact text from the CSV.

If this Actor saved you time, a rating on the Store helps others find it.

### More tools from the same developer

- [JSON to CSV Converter](https://apify.com/ucchiii/json-to-csv) — turn nested JSON files or datasets into one flat CSV file
- [CSV to Excel Converter](https://apify.com/ucchiii/csv-xlsx-converter) — convert CSV, TSV, Excel XLSX, JSON and NDJSON files or Apify datasets into each other
- [Flatten JSON to CSV](https://apify.com/ucchiii/flatten-json) — flatten nested JSON into flat rows with the separator you choose
- [Merge Datasets](https://apify.com/ucchiii/merge-datasets) — combine several datasets or CSV/JSON files into one, with columns aligned
- [Excel to JSON](https://apify.com/ucchiii/excel-to-json) — turn Excel (XLSX) sheets into JSON rows, or a JSON file into an Excel sheet

# Actor input Schema

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

Public http(s) links to CSV, TSV, JSON, NDJSON / JSON Lines or Parquet files, up to 500 MB each and 20 inputs per run. Each file becomes one output file. Leave every input empty for a free demo on built-in sample orders.

## `keyValueStoreId` (type: `string`):

Optional. ID or name of a key-value store that holds your files as records (for example files you uploaded in Apify Console, or files saved by another Actor). Converted after the URLs above.

## `keyValueStoreKeys` (type: `array`):

Optional. Keys of the records to convert from the key-value store above, e.g. 'orders.csv'. Leave empty to convert every record in the store (except INPUT), up to 20.

## `datasetId` (type: `string`):

Optional. Dataset to convert into one file, for example the results of a scraper run. You can paste a dataset ID or a dataset URL from Apify Console. Up to 2,000,000 items.

## `outputFormat` (type: `string`):

Format of the output files. Default Parquet. Pick CSV, JSON or JSONL to turn Parquet files back into text formats.

## `inputFormat` (type: `string`):

Default: detected from the file extension (.csv, .tsv, .json, .jsonl, .ndjson, .parquet), then from the content. Set it when your links have no extension.

## `delimiter` (type: `string`):

Character between the values in CSV inputs. Default: detected from the first lines (.tsv files use tab).

## `hasHeader` (type: `boolean`):

On: the first row holds the column names. Off: every row is data and the columns are named column_1, column_2, ...

## `inferTypes` (type: `boolean`):

On: numbers, true/false, dates and timestamps get real Parquet types (int64, double, bool, date, timestamp). A column whose later rows do not fit is kept as text and listed in notes. Off: every column is text (string).

## `encoding` (type: `string`):

Character encoding of CSV inputs. JSON inputs must be UTF-8.

## `compression` (type: `string`):

Compression codec inside the Parquet file. Snappy is the common default; zstd usually gives smaller files; gzip is read by almost every tool.

## `rowGroupSize` (type: `integer`):

Maximum rows per Parquet row group (1,000 to 1,000,000). Larger groups compress better; smaller groups let readers skip more data.

## `flattenNested` (type: `boolean`):

JSON inputs and datasets: nested objects become dot columns like address.city. Arrays, and objects when this is off, are stored as JSON text.

## Actor input object example

```json
{
  "fileUrls": [
    "https://raw.githubusercontent.com/vega/vega-datasets/main/data/seattle-weather.csv"
  ],
  "outputFormat": "parquet",
  "inputFormat": "auto",
  "delimiter": "auto",
  "hasHeader": true,
  "inferTypes": true,
  "encoding": "utf-8",
  "compression": "snappy",
  "rowGroupSize": 100000,
  "flattenNested": true
}
```

# Actor output Schema

## `summary` (type: `string`):

One item per input: output file name, download link, rows, columns, schema (column: type), size, or the error for inputs that failed.

## `files` (type: `string`):

The key-value store that holds the .parquet (or .csv / .json / .jsonl) files.

## `stats` (type: `string`):

Record STATS: inputs converted and failed, output format, files and megabytes charged.

# 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://raw.githubusercontent.com/vega/vega-datasets/main/data/seattle-weather.csv"
    ]
};

// Run the Actor and wait for it to finish
const run = await client.actor("ucchiii/csv-to-parquet").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://raw.githubusercontent.com/vega/vega-datasets/main/data/seattle-weather.csv"] }

# Run the Actor and wait for it to finish
run = client.actor("ucchiii/csv-to-parquet").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://raw.githubusercontent.com/vega/vega-datasets/main/data/seattle-weather.csv"
  ]
}' |
apify call ucchiii/csv-to-parquet --silent --output-dataset

```

## MCP server setup

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

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/HLduSfAn0t2lWHGRU/builds/VLUHruZnFajaPmgF5/openapi.json
