CSV to JSON Converter with Schema Inference & Validation avatar

CSV to JSON Converter with Schema Inference & Validation

Pricing

from $2.00 / 1,000 converted files

Go to Apify Store
CSV to JSON Converter with Schema Inference & Validation

CSV to JSON Converter with Schema Inference & Validation

Convert CSV files to clean, typed JSON. Auto-detects delimiter, infers a JSON Schema, and validates rows against your own schema. Ideal for APIs, data pipelines and AI agents.

Pricing

from $2.00 / 1,000 converted files

Rating

0.0

(0)

Developer

Simon Fletcher

Simon Fletcher

Maintained by Community

Actor stats

0

Bookmarked

2

Total users

1

Monthly active users

3 days ago

Last modified

Categories

Share

What does the CSV to JSON Converter do?

CSV to JSON Converter turns messy CSV files into clean, typed JSON you can drop straight into an API, a database, or an AI agent. It auto-detects the delimiter (comma, semicolon, tab or pipe), infers value types (integer, number, boolean, null), builds a JSON Schema describing your data, and can validate every row against a schema you provide. Give it a URL, an uploaded file, or raw CSV text — it gives back structured records, not a wall of strings.

Running on Apify means you get an HTTP API, scheduling, integrations (Make, Zapier, n8n, Google Drive), run history, and access from the Apify MCP server so AI agents can call it directly.

Why use the CSV to JSON Converter?

  • Feed APIs and pipelines — convert exports from spreadsheets, banks, CRMs and analytics tools into JSON your code can consume.
  • Give AI agents clean data — the output is compact structured JSON (no HTML, no nested junk), ideal for LLM tool use over the Apify MCP.
  • Catch bad data early — supply a target JSON Schema and get a per-row validation report instead of silent corruption.
  • Stop hand-writing parsers — delimiter sniffing, quoted fields, embedded newlines, ragged rows and encodings are handled for you.

How to use the CSV to JSON Converter

  1. Open the Input tab.
  2. Provide your CSV one of three ways: paste inline CSV text, add file URLs, or upload files (delivered via key-value-store keys).
  3. (Optional) Set a delimiter, toggle header/type inference, or paste a target JSON Schema to validate against.
  4. Click Start. Each input file becomes one dataset item you can download as JSON, CSV, Excel or HTML.

Input

FieldTypeDescription
csvUrlsarrayPublic URLs of CSV files to download and convert.
keyValueStoreKeysarrayKeys of uploaded files in the run's key-value store.
csvTextarrayRaw CSV strings passed inline (great for API / agent callers).
delimiterstringForce a delimiter. Blank = auto-detect , ; \t |.
hasHeaderbooleanTreat the first row as column names (default true).
inferTypesbooleanCoerce to integer/number/boolean/null (default true).
trimWhitespacebooleanStrip whitespace from every cell (default true).
nullValuesarrayValues to treat as null (replaces the default set: empty, NA, N/A, null, nan, none).
maxRowsintegerCap data rows per file (0/blank = no cap).
targetSchemaobjectJSON Schema (Draft 2020-12) for a single row; enables per-row validation.

Example input

{
"csvText": ["id,name,active,score\n1,Ada,true,9.5\n2,Grace,false,8.0"],
"inferTypes": true
}

Output

Each input file produces one dataset item. You can download the dataset as JSON, CSV, Excel or HTML.

{
"source": "csvText[0]",
"status": "ok",
"error": null,
"rowCount": 2,
"columnCount": 4,
"columns": ["id", "name", "active", "score"],
"records": [
{ "id": 1, "name": "Ada", "active": true, "score": 9.5 },
{ "id": 2, "name": "Grace", "active": false, "score": 8.0 }
],
"inferredSchema": {
"$schema": "https://json-schema.org/draft/2020-12/schema",
"type": "array",
"items": {
"type": "object",
"properties": {
"id": { "type": "integer" },
"name": { "type": "string" },
"active": { "type": "boolean" },
"score": { "type": "number" }
}
}
},
"validation": { "checked": false, "valid": true, "validRows": 2, "invalidRows": 0, "errors": [] },
"meta": { "delimiter": ",", "hasHeader": true, "typesInferred": true, "encoding": "utf-8", "emptyRowsSkipped": 0, "raggedRows": 0 }
}

Output fields

FieldDescription
sourceWhere the file came from (URL, KVS key, or csvText[i]).
statusok when converted, error when unreadable/empty.
rowCount / columnCountConverted data-row and column counts.
columnsOrdered column names (header names or field_N).
recordsThe converted rows as typed JSON objects.
inferredSchemaJSON Schema describing the records.
validationPer-row report vs your targetSchema (checked=false when none).
metaDelimiter, encoding, header flag, blank/ragged row counts.

Pricing / How much does it cost?

This Actor is billed pay-per-result: one charge per file that converts into non-empty data. A file that is empty, unreadable, or has no data rows is returned with status: "error" and is never charged. See the Pricing tab for the current per-result rate. Converting a handful of files costs a fraction of a cent of platform compute; the value is in never writing another CSV parser.

Tips & advanced options

  • Leading zeros are preserved. Values like 01234 or 00080 stay strings so zip codes, phone numbers and IDs are never corrupted into integers. Type inference is per cell, so a column with mixed values (e.g. 01234 and 90210) can contain both strings and integers — set inferTypes: false to keep every value a string.
  • Ragged rows are lossless. Rows with more cells than the header get extra columns named field_N rather than dropping data.
  • Validation. Paste a targetSchema to get a validation block flagging exactly which rows and fields don't match — without failing the whole run.
  • Big files. Each file is returned as one dataset item, and Apify caps a single item at ~9 MB. A file whose converted JSON would exceed that is returned as a clear (unbilled) size-cap error — use maxRows to convert it in smaller batches, or sample the top of a large file cheaply.

FAQ & support

  • What formats can I export? JSON, CSV, Excel and HTML, from the dataset.
  • Does it store my data? Only in your run's own dataset/key-value store, under your account.
  • Known limitation: type inference is per-cell (see Tips). Column-level type unification is a planned option.
  • Found a bug or want a feature? Use the Issues tab.