JSONL / NDJSON to CSV — streaming converter avatar

JSONL / NDJSON to CSV — streaming converter

Pricing

Pay per usage

Go to Apify Store
JSONL / NDJSON to CSV — streaming converter

JSONL / NDJSON to CSV — streaming converter

Stream a JSONL/NDJSON document (inline text or public URL) into a CSV. Auto-discovers columns from the union of all keys in document order of first appearance. No scraping required when text is provided inline.

Pricing

Pay per usage

Rating

0.0

(0)

Developer

Nikita S

Nikita S

Maintained by Community

Actor stats

0

Bookmarked

2

Total users

1

Monthly active users

6 days ago

Last modified

Share

JSONL / NDJSON to CSV Converter

Stream a JSONL/NDJSON document (inline text or public URL) into a CSV. Auto-discovers columns from the union of all keys in document order of first appearance, with optional explicit column list and stable ordering. Pure data utility, no HTTP scraping required when text is provided inline.

  • Inputs: text (inline JSONL) or textUrl (public JSONL file), columns (optional explicit list), delimiter (default ,), maxRows, maxChars, includeSummary.
  • Per-row output:
    • _kind: "header" — first dataset row, with the CSV header line and resolved columns array.
    • _kind: "row" — one dataset row per data row of the converted CSV.
    • _kind: "summary" (optional) — columns, counts, and a 5-line CSV preview.
  • Output (SUMMARY): columns, counts (parsed, bad, written, lines). OUTPUT key-value store holds the full CSV body.

Quick start

apify call stellar_ballet_0bu/jsonl-to-csv -i '{
"text": "{\"id\":1,\"name\":\"alice\",\"email\":\"a@x.com\"}\n{\"id\":2,\"name\":\"bob\",\"team\":\"ops\"}\n{\"id\":3,\"name\":\"carol\",\"email\":\"c@x.com\",\"team\":\"sales\"}\n",
"columns": ["id","name","email","team"],
"includeSummary": true
}'

The default dataset will have ~5 items: 1 header + 3 row + 1 summary. OUTPUT key-value record holds the full CSV text.

Inputs

  • text — inline JSONL/NDJSON body. If set, textUrl is ignored.
  • textUrl — public URL of a JSONL/NDJSON file. Used only if text is empty.
  • columns — optional explicit column list. If empty, columns are auto-discovered from the union of all keys in document order of first appearance.
  • delimiter — CSV delimiter character (default ,).
  • includeSummary — if true, push a _kind: "summary" row with totals + column list.
  • maxRows — stop after this many converted rows. 0 means unlimited.
  • maxChars — truncate the input body at this many characters before parsing. Default 5,000,000.

Use cases

  • Convert a JSONL API export into CSV for Google Sheets / Airtable / Supabase (one line per dataset row, plus the full CSV in the OUTPUT key-value record).
  • Pre-process logs before loading into a warehouse or feeding into csv-join-enricher or csv-statistical-summary.
  • Materialise a flattened JSON dataset as CSV after json-flatten-normalizer.
  • Cleanup step for apify-dataset-export-batch when the source platform only emits JSONL.

API notes

  • Pure data utility, no scraping when text is supplied inline.
  • Blank lines and lines starting with # are skipped (comment-aware).
  • Lines that fail to parse are counted as bad and skipped, not crashed on.
  • CSV escaping: fields containing the delimiter, a quote, or a newline are quoted and embedded quotes are doubled ("").
  • Header row is the resolved columns array; for a row missing a key, the cell is empty.
  • Nested objects/arrays in the JSONL are stringified to JSON for the CSV cell (no flattening here — use json-flatten-normalizer first if you need a flat schema).

Pricing (Pay per event)

EventDescriptionUSD
apify-actor-startBuilt-in start charge, per Apify platform usageper pricing tier
row_convertedOne charge per converted data row (skips blank lines and # comments).$0.0001
apify-actor-start is auto-charged by Apify platform; row_converted is the only domain-specific event.

currentPricingInfo activates on 2026-07-22T00:00:00Z. The Actor's code calls Actor.charge({ eventName: 'row_converted', count }) only for successfully converted data rows.

Cost expectations

A 100k-line JSONL input will cost roughly $10 of usage credits on top of the standard start charge. Set maxRows to cap the run if you only need a preview.

FAQ

Does it preserve key ordering? Yes — columns are emitted in document order of first appearance, or in the explicit order you pass via columns.

What happens if a row is missing a key present in another row? The cell is left empty. No crash, no implicit null placeholder.

What happens if a row has a key not present in other rows? That key is added to the resolved columns list at the position of its first appearance.

Can I split a big JSONL file into chunks? Yes — run this Actor N times with maxRows: <chunk-size> and chain via apify-dataset-export-batch for downstream consumers.

What about arrays/objects in cells? They are stringified to JSON. Use json-flatten-normalizer first if you need each array element as its own column.

Does the output CSV escape special characters? Yes — RFC 4180: fields containing the delimiter, a quote, or a newline are wrapped in quotes; embedded quotes are doubled.

Limits

  • Best for inputs up to ~5M characters per run. For larger inputs, split into chunks or fetch via textUrl (subject to the platform's fetch limits).
  • Single-pass streaming: the entire input is held in memory while parsing. For multi-GB JSONL, run in shards.
  • json-flatten-normalizer — flatten nested objects before CSV conversion
  • jsonl-stream-validator — validate a JSONL stream against a JSON Schema before conversion
  • json-schema-validator — validate an array of records against a schema
  • csv-join-enricher — join the resulting CSV with another CSV by key
  • csv-quality-scorecard — score the resulting CSV's quality
  • csv-dedupe-normalizer — dedupe the resulting CSV
  • csv-statistical-summary — column-level stats on the resulting CSV
  • apify-dataset-export-batch — batch export multiple Apify datasets to JSON/JSONL/CSV

Support

  • Source: hidden (paid Actor pattern; not exposed by default).
  • Issues / feature requests: open a thread on the public Apify Store Actor page (button on the right of the Store listing) or message the maintainer through the Apify Console.
  • For paid-pilot bulk runs (multi-GB JSONL files, scheduled conversion pipelines, custom output formats), contact the maintainer via the Apify Console.

License

MIT-style Apify Actor Source-Available License. You may use the public Actor output and integrate the public results; you may not re-host the Actor source or re-publish it as a competing Actor.