# Parquet Viewer & Converter API

> Open Apache Parquet files without DuckDB or Python: schema, row groups and statistics, rows as JSON / CSV / NDJSON with filters, and CSV / JSON to Parquet.

- Endpoint: `POST https://apibox.io.vn/v1/parquet-tools`
- Category: Data & JSON
- HTML docs: https://apibox.io.vn/docs/parquet-tools/ (Vietnamese: https://apibox.io.vn/vi/docs/parquet-tools/)
- Online tool: https://apibox.io.vn/tools/parquet-tools/
- Authentication: `Authorization: Bearer <API key>` or `X-API-Key: <API key>` (free key: https://apibox.io.vn/dashboard/#signup)

Parquet is the column format of data lakes and exports from BigQuery, Snowflake, Databricks, AWS Cost and Usage Reports or Stripe Data Pipeline, but you need special software to open it. Upload a `.parquet` file (or give a public `url`) and the default `action=info` returns the row count, schema (logical types such as DECIMAL(12,2), TIMESTAMP, UTF8, nested groups), row groups with each column's codec, encodings, compressed size and min / max / null statistics, key-value metadata and a 10-row preview.

`action=read` returns rows as JSON with `columns` (selection), `offset` / `limit` paging (up to 10,000 rows per call), a MongoDB-style `filter` (`{"country":"VN","amount":{"$gt":100}}`) and `order_by`; `action=convert` downloads CSV (UTF-8 with BOM, opens in Excel) or NDJSON (up to 200,000 rows per call). 64-bit integers that do not fit in JavaScript numbers are returned as strings, dates as ISO 8601, binary as base64.

`action=write` builds a Parquet file from JSON rows (`rows`), NDJSON or CSV (`csv`, types inferred: INT32 / INT64 / DOUBLE / BOOLEAN / STRING / JSON, or set `types`), compressed with SNAPPY (default), GZIP, BROTLI or none. Reading supports SNAPPY, GZIP, BROTLI and uncompressed files (ZSTD / LZ4 only where the runtime provides them). Built on hyparquet and hyparquet-writer (MIT). The file size limit follows your plan; files are processed in memory and not stored.

## Parameters

| Name | In | Type | Required | Default | Description |
|---|---|---|---|---|---|
| `file` | body | file | no |  | The Parquet file (multipart, raw body or `file_base64`); for `write`, a CSV / JSON file. |
| `url` | body | string | no |  | Public URL of a Parquet file instead of an upload. |
| `action` | body | string | no | `info` | `info` (schema + preview), `schema`, `read`, `convert` or `write` (alias `op`). |
| `columns` | body | string | no |  | Comma-separated columns to read. |
| `offset` | body | number | no | `0` | First row (after filtering). |
| `limit` | body | number | no | `100` | Rows to return (JSON max 10,000; CSV / NDJSON max 200,000). |
| `filter` | body | object | no |  | MongoDB-style filter: `$eq $ne $gt $gte $lt $lte $in $nin $and $or $not`. |
| `order_by` | body | string | no |  | Sort by this column. |
| `format` | body | string | no |  | read / convert: `json`, `ndjson` or `csv`. |
| `rows` | body | array | no |  | write: JSON array of objects (or `csv` text). |
| `response` | body | string | no |  | write: `json` returns `parquet_base64` in JSON instead of the .parquet file. |
| `compression` | body | string | no | `snappy` | write: `snappy`, `gzip`, `brotli` or `uncompressed`. |

## Example request

```bash
curl -X POST "https://apibox.io.vn/v1/parquet-tools" \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -F "file=@./my-file"
```

## Example response

```json
{
  "rows": 3,
  "columns": 3,
  "leaf_columns": 3,
  "row_groups": 1,
  "version": 2,
  "created_by": "APIBox parquet-tools (hyparquet-writer)",
  "file_bytes": 453,
  "footer_bytes": 296,
  "codecs": [
    "SNAPPY"
  ],
  "schema": [
    {
      "name": "id",
      "type": "INT32",
      "physical_type": "INT32",
      "repetition": "OPTIONAL"
    },
    {
      "name": "city",
      "type": "UTF8",
      "physical_type": "BYTE_ARRAY",
      "repetition": "OPTIONAL"
    },
    {
      "name": "amount",
      "type": "DOUBLE",
      "physical_type": "DOUBLE",
      "repetition": "OPTIONAL"
    }
  ],
  "key_value_metadata": [],
  "row_group_details": [
    {
      "index": 0,
      "rows": 3,
      "total_byte_size": 143,
      "columns": [
        {
          "path": "id",
          "codec": "SNAPPY",
          "encodings": [
            "PLAIN"
          ],
          "compressed_bytes": 37,
          "uncompressed_bytes": 35,
          "values": 3,
          "min": 1,
          "max": 3,
          "null_count": 0
        },
        {
          "path": "city",
          "codec": "SNAPPY",
          "encodings": [
            "PLAIN"
          ],
          "compressed_bytes": 61,
          "uncompressed_bytes": 61,
          "values": 3,
          "min": "Hà Nội",
          "max": "Đà Nẵng",
          "null_count": 0
        },
        {
          "path": "amount",
          "codec": "SNAPPY",
          "encodings": [
            "PLAIN"
          ],
          "compressed_bytes": 47,
          "uncompressed_bytes": 47,
          "values": 3,
          "min": 99,
          "max": 250,
          "null_count": 0
        }
      ]
    }
  ],
  "preview": [
    {
      "id": 1,
      "city": "Hà Nội",
      "amount": 120.5
    },
    {
      "id": 2,
      "city": "Đà Nẵng",
      "amount": 99
    },
    {
      "id": 3,
      "city": "TP.HCM",
      "amount": 250
    }
  ]
}
```

## Use cases

- Look inside a Parquet export from BigQuery, Snowflake or AWS CUR without installing anything
- Convert Parquet to CSV for Excel or Google Sheets
- Turn a CSV or JSON export into compact Parquet for a data lake
- Read a page of rows or filtered records from a Parquet file in a no-code workflow

## FAQ

### How big a file can I open?

Up to your plan's file limit (Free 5 MB, Starter 20 MB, Pro 50 MB). Select fewer columns for wide files; filters and sorting need the selected columns in memory.

### My file uses ZSTD and fails.

ZSTD and LZ4 decompression depend on the runtime and may not be available. Re-export with SNAPPY or GZIP, or convert with another tool.

### Are big integers exact?

Yes: INT64 values beyond ±2^53 are returned as strings so no digit is lost.
