Universal Data Converter & JSON Flattener (CSV/XLSX/XML) avatar

Universal Data Converter & JSON Flattener (CSV/XLSX/XML)

Pricing

from $2.80 / 1,000 output format files generated

Go to Apify Store
Universal Data Converter & JSON Flattener (CSV/XLSX/XML)

Universal Data Converter & JSON Flattener (CSV/XLSX/XML)

Bi-directional format converter & nested JSON flattener/unflattener across JSON, NDJSON, CSV, TSV, multi-sheet XLSX with cell-limit rollover, XML, SQLite, legacy encodings, and Standby MCP.

Pricing

from $2.80 / 1,000 output format files generated

Rating

0.0

(0)

Developer

James Edmans

James Edmans

Maintained by Community

Actor stats

0

Bookmarked

1

Total users

0

Monthly active users

15 hours ago

Last modified

Categories

Features

Limited permissionsSingle-tenantServer interface

Share

Universal Data Converter & Nested JSON Flattener (JSON, CSV, XLSX, XML, NDJSON, SQLite)

Apify Store Actor: forgekit/universal-data-converter-flattener | Runtime: Node.js 22 (zero-browser deterministic converter, 256–1024 MB RAM) | Billing: Pay-Per-Event (PPE) + Standby MCP Server

Overview

Universal Data Converter & Nested JSON Flattener converts Apify Datasets, remote files, or inline payloads bi-directionally across JSON, NDJSON/JSONL, CSV, TSV, Multi-Sheet Excel XLSX, XML, and native SQLite (.sqlite) — with full nested JSON flattening, reverse unflattening (a.b.0.c dotted CSV → structured nested JSON), legacy encoding repair (iconv-lite), and an inferred column schema report (SCHEMA_REPORT).

Engineered directly around top user complaints on competing spreadsheet and dataset converters, it prevents 5M-cell spreadsheet crashes with automatic XLSX sheet rollover (maxCellsPerSheet), supports explicit sanitized worksheet names (xlsxSheetName), recovers gracefully from malformed CSV/NDJSON rows (onMalformedRow: "skip-and-log"), and ships with a native Standby MCP Server for Claude Desktop and Cursor.

Features vs Competitors

  • 7-Format Bi-Directional Engine: Auto-sniffs and converts between JSON, NDJSON, CSV, TSV, Multi-Sheet XLSX, XML, and native SQLite (node:sqlite DatabaseSync with typed INTEGER/REAL/TEXT columns and safe parameterized INSERT transactions).
  • Deep Flatten & Reverse Unflatten: Supports 4 nested array expansion strategies (join, indexed, json-string, and unwind row explosion) PLUS dotted-key reconstruction back into nested JSON objects and arrays.
  • Legacy Encoding Repair (iconv-lite): Decodes windows-1252, iso-8859-1, latin1, and utf-16le exports cleanly without mangling European accents or symbols, and optionally prepends UTF-8 BOM (csvUtf8Bom: true) so Microsoft Excel displays Unicode flawlessly.
  • Voice-of-Customer Upgrades:
    • Automatic XLSX Cell-Limit & Row-Limit Rollover (maxCellsPerSheet): Splits oversized spreadsheets cleanly into <Sheet>_1, <Sheet>_2, ... before hitting Google Sheets' 5M-cell or Excel's 1,048,576-row ceiling.
    • Custom xlsxSheetName + Multi-Sheet xlsxSheetSplitField: Name Excel tabs explicitly (sanitized against [:\\/?*[\]] and 31-char Excel limits) or split 1 dataset into 1 tab per country/category with auto-sized column widths and autofilters.
    • Lenient Malformed-Row Recovery (onMalformedRow: "skip-and-log"): Logs malformed CSV/NDJSON line details in SUMMARY.warnings[] instead of crashing the entire run.
    • Native Standby MCP Server: Tested JSON-RPC 2.0 + SSE tools (convert_data_format, flatten_json_records) for Claude Desktop, Cursor, and AI workflows.
CapabilityUniversal Data Converter & Flattenerhumble-echidna/dataset-transformgazidev/dataset-filter-transformthecfmarketing/csv-xlsx-merger
Output FormatsJSON, NDJSON, CSV, TSV, Multi-Sheet XLSX, XML, SQLiteJSON, CSV, XLSXJSON, CSV, XLSXCSV, XLSX only
Price per 1,000 Rows (FREE)$0.20 ($0.0002/row)$1.00 (5x pricier!)$0.20 + $0.002/1k read$3.00 + $0.10 start!
Flatten + Reverse UnflattenBoth (join, indexed, json-string, unwind)Flatten onlyFlatten onlyNone
Auto XLSX Cell-Limit RolloverBuilt-in (maxCellsPerSheet)Crashes at limitCrashes at limitNone
Legacy windows-1252 DecodingBuilt-in (iconv-lite)UTF-8 onlyUTF-8 onlyUTF-8 only
Standby MCP ServerNative JSON-RPC 2.0 + SSE (2 tools)NoneNoneNone

Input Configuration

FieldTypeRequiredDefaultDescription
inputFormatstringNo"auto"Source format: "auto", "json", "ndjson", "csv", "tsv", "xlsx", or "xml".
outputFormatsstring[]No["csv"]Target KV export formats ("json", "ndjson", "csv", "tsv", "xlsx", "xml", "sqlite").
datasetIdstringNo""Apify Dataset ID to ingest.
fileUrlstringNo""Public file URL (SSRF-protected, up to 50 MB).
rawInputstringNo""Inline CSV, TSV, JSON, NDJSON, or XML string payload (up to 10 MB).
rowsobject[]No[]Inline JSON row array (up to 100,000 rows).
inputEncodingstringNo"utf-8"Character encoding decoded via iconv-lite ("utf-8", "utf-16le", "latin1", "windows-1252", "iso-8859-1").
jsonRootPathstringNo""Dot path to extract record array from a nested JSON/XML envelope (e.g. "data.items").
structureModestringNo"flatten""preserve", "flatten", or "unflatten".
flattenSeparatorstringNo"."Key separator used during flatten/unflatten (1–4 chars).
arrayModestringNo"join"Nested array strategy: "join", "indexed", "json-string", or "unwind".
arrayJoinDelimiterstringNo", "Delimiter used when arrayMode="join".
unwindFieldstringNo""Specific array path to explode when arrayMode="unwind".
csvDelimiterstringNo","Column delimiter for CSV output.
csvUtf8BombooleanNotruePrepend UTF-8 BOM to CSV output for clean Microsoft Excel Unicode rendering.
csvFormulaSafebooleanNotruePrefix leading =, +, -, @, \t, \r cells with ' in CSV/XLSX outputs.
xlsxSheetSplitFieldstringNo""Optional column splitting rows into separate Excel tabs (1 tab per unique value).
xlsxSheetNamestringNo"Data"Custom base Excel worksheet name (1–31 chars, auto-sanitized).
maxCellsPerSheetintegerNo4000000Automatic sheet rollover threshold (10–5,000,000 cells) creating <Name>_1, <Name>_2, etc.
onMalformedRowstringNo"skip-and-log""skip-and-log" records warnings without aborting; "fail" throws immediately.
xmlRootTagstringNo"dataset"Root XML element name.
xmlRowTagstringNo"item"Row XML element name.
sqliteTableNamestringNo"records"SQL-safe table name (^[a-zA-Z_][a-zA-Z0-9_]{0,62}$) for SQLite export.
pushRowsToDatasetbooleanNotrueAlso push transformed rows to the default Apify Dataset.
maxRowsintegerNo100000Hard upper cap on transformed rows (1–500,000).

Output Example

Captured directly from a local end-to-end test run flattening nested JSON records and exporting simultaneously to csv, xlsx, xml, and sqlite:

{
"id": 1,
"company.name": "Acme Corp",
"company.hq.city": "Berlin",
"company.hq.country": "DE",
"tags": "saas, b2b",
"arr": 125000
}

Inferred SCHEMA_REPORT persisted to the Key-Value Store:

{
"inputFormat": "json",
"rowCount": 2,
"columnCount": 6,
"columns": [
{ "name": "id", "inferredType": "integer", "nullCount": 0, "uniqueSampleCount": 2, "min": 1, "max": 2 },
{ "name": "company.name", "inferredType": "string", "nullCount": 0, "uniqueSampleCount": 2, "min": "Acme Corp", "max": "Globex Ltd" },
{ "name": "company.hq.city", "inferredType": "string", "nullCount": 0, "uniqueSampleCount": 2, "min": "Berlin", "max": "London" },
{ "name": "company.hq.country", "inferredType": "string", "nullCount": 0, "uniqueSampleCount": 2, "min": "DE", "max": "GB" },
{ "name": "tags", "inferredType": "string", "nullCount": 0, "uniqueSampleCount": 2, "min": "etl", "max": "saas, b2b" },
{ "name": "arr", "inferredType": "integer", "nullCount": 0, "uniqueSampleCount": 2, "min": 85000, "max": 125000 }
],
"exportedFiles": [
{ "format": "csv", "kvsKey": "OUTPUT_CSV", "filename": "OUTPUT.csv", "bytes": 137 },
{ "format": "xlsx", "kvsKey": "OUTPUT_XLSX", "filename": "OUTPUT.xlsx", "bytes": 16962, "sheets": ["RevenueQ4"] },
{ "format": "xml", "kvsKey": "OUTPUT_XML", "filename": "OUTPUT.xml", "bytes": 494 },
{ "format": "sqlite", "kvsKey": "OUTPUT_SQLITE", "filename": "OUTPUT.sqlite", "bytes": 8192 }
],
"warnings": [],
"durationMs": 38
}

Pay-Per-Event (PPE) Pricing

Event KeyEvent TitlePrice (USD)Billing Trigger
actor-startActor run start$0.005Charged once per non-empty conversion run (waived on 0-row runs).
file-convertedOutput format file generated$0.004Charged per generated KV export artifact (OUTPUT_CSV, OUTPUT_XLSX, OUTPUT_SQLITE, etc.).
row-convertedRow processed & converted$0.0002Charged per transformed output row.
mcp-tool-callStandby MCP tool execution$0.003Charged per successful Standby MCP JSON-RPC tool invocation.

Cost Example: Converting 1,000 nested JSON records into 1 Excel .xlsx workbook + 1 .sqlite database costs $0.005 + (1,000 × $0.0002) + (2 × $0.004) = $0.213 USD.

Standby MCP Server & AI Agent Integration

Enable Apify Standby Mode (APIFY_META_ORIGIN=STANDBY) to connect forgekit/universal-data-converter-flattener to Claude Desktop, Cursor, or any MCP client:

  • Health Endpoint: GET /health
  • MCP Endpoint: POST /mcp and GET /mcp (Streamable HTTP + SSE)
  • Exposed MCP Tools:
    • convert_data_format — Converts inline JSON, NDJSON, CSV, TSV, or XML strings between formats and returns formatted text + inferred schema.
    • flatten_json_records — Flattens or unflattens nested JSON arrays (join, indexed, json-string, unwind) with inferred column profiles.
{
"mcpServers": {
"universal-data-converter-flattener": {
"url": "https://forgekit--universal-data-converter-flattener.apify.actor/mcp",
"headers": {
"Authorization": "Bearer YOUR_APIFY_TOKEN"
}
}
}
}

Error Handling, Rate Limits & Limitations

  • SQL & SSRF Safety: sqliteTableName is strictly validated against ^[a-zA-Z_][a-zA-Z0-9_]{0,62}$ with double-quoted identifiers and parameterized ? value bindings (zero SQL injection surface). fileUrl enforces SSRF protection (http:/https: only, blocking private/loopback/metadata IPs) and a 50 MB file cap.
  • Temporary File Hygiene: SQLite databases are built inside isolated OS temp files, buffered into KV storage, and removed in a finally block so zero temporary files ever leak.
  • Unflatten Safety: Prototype-pollution keys (__proto__, constructor, prototype) are ignored during nested reconstruction.

Quick Start & Example Input

1. Run in Apify Console (No Code)

  1. Open forgekit/universal-data-converter-flattener in Apify Console and click Try for free.
  2. Paste or adjust the ready-to-run input JSON below (safe defaults are pre-filled).
  3. Click Start and export results as JSON, CSV, Excel, or NDJSON from the Output tab.
{
"rows": [
{
"id": 1,
"company": {
"name": "Acme Corp",
"region": "EU"
},
"tags": [
"saas",
"b2b"
],
"revenue": 125000
}
],
"maxRows": 100000
}

2. Run via API (apify-client — Node.js & Python)

import { ApifyClient } from 'apify-client';
const client = new ApifyClient({ token: process.env.APIFY_TOKEN });
const run = await client.actor('forgekit/universal-data-converter-flattener').call({"rows":[{"id":1,"company":{"name":"Acme Corp","region":"EU"},"tags":["saas","b2b"],"revenue":125000}],"maxRows":100000});
const { items } = await client.dataset(run.defaultDatasetId).listItems();
console.log(items);
from apify_client import ApifyClient
import os
client = ApifyClient(os.environ["APIFY_TOKEN"])
run = client.actor("forgekit/universal-data-converter-flattener").call(run_input={"rows":[{"id":1,"company":{"name":"Acme Corp","region":"EU"},"tags":["saas","b2b"],"revenue":125000}],"maxRows":100000})
items = list(client.dataset(run["defaultDatasetId"]).iterate_items())
print(items)

3. Connect to n8n, Make, Zapier & Webhooks

  • n8n / Make / Zapier: Add the official Apify module, choose Run Actor, select forgekit/universal-data-converter-flattener, and pass the JSON payload above.
  • Schedules & Webhooks: Attach an Apify Schedule for recurring runs and trigger downstream webhooks automatically on ACTOR.RUN.SUCCEEDED.

Use Cases — What Can You Do With This Data?

  • Automated RevOps & CRM Hygiene: Chain Universal Data Converter & Nested JSON Flattener (JSON, CSV, XLSX, XML, NDJSON, SQLite) directly after any Apify scraper via Apify Integrations, Make, or n8n so clean, schema-validated records land straight in HubSpot, Salesforce, Airtable, or Google Sheets.
  • Scheduled Pipeline Automation: Trigger runs automatically on dataset completion webhooks with deterministic, zero-hallucination TypeScript logic and predictable per-row Pay-Per-Event pricing.
  • AI & RAG Data Preparation: Clean, deduplicate, diff, or chunk raw web extractions before embedding into Pinecone, Qdrant, Weaviate, or pgvector without burning LLM tokens on boilerplate.
  • Zero-Code Agency Workflows: Replace brittle local Python scripts and manual Excel cleanup with reproducible, audit-logged cloud runs exported directly to JSON, CSV, NDJSON, or Excel.

Frequently Asked Questions (FAQ)

How much does Universal Data Converter & Nested JSON Flattener (JSON, CSV, XLSX, XML, NDJSON, SQLite) cost to run?

You only pay for actual output via transparent Pay-Per-Event billing (starting at $0.004 per file-converted (Output format file generated); see the PPE Pricing table above). Runs that produce zero billable results or fail upstream incur $0.00 — including zero actor-start fee — and Apify's built-in Max total charge (ACTOR_MAX_TOTAL_CHARGE_USD) hard-caps spend automatically.

Does this Actor require proxies, logins, or CAPTCHA solving?

No. This Actor performs 100% deterministic local data processing on the inputs you provide (Apify Datasets, Key-Value Stores, inline JSON, or public file URLs). It requires zero proxies, zero headless browsers, and never depends on scraping fragile third-party websites.

What export formats and integrations are supported?

Every run stores structured results in an Apify Dataset downloadable as JSON, CSV, Excel (XLSX), NDJSON, XML, or HTML Table via Console or REST API, plus native connectors for n8n, Make, Zapier, Google Sheets, Airtable, Slack, and webhooks.

Can AI agents (Claude Desktop, Cursor, ChatGPT, LangChain) call this Actor directly via MCP?

Yes! Universal Data Converter & Nested JSON Flattener (JSON, CSV, XLSX, XML, NDJSON, SQLite) includes a built-in Standby MCP Server at https://forgekit--universal-data-converter-flattener.apify.actor/mcp supporting JSON-RPC 2.0 (initialize, ping, tools/list, tools/call) with Claude-compliant ^[a-zA-Z0-9_.-]{1,64}$ tool schemas.

How does it protect against runaway costs or bad inputs?

Every input is strictly validated upfront with Zod schemas before any work starts, user-supplied URLs pass SSRF protection blocking private/cloud-metadata IPs, and streaming BudgetGuard enforcement stops immediately once your result or USD budget cap is reached.

How fast and lightweight is it compared to browser scrapers?

It runs on lightweight Node.js 22 (256–512 MB RAM, zero headless browser) so typical runs finish in seconds with high reliability and low platform compute cost.

Explore companion Actors in Data Pipeline & ETL and core ETL utilities to chain end-to-end pipelines:

ActorStore SlugMode
Dataset Merge, Fuzzy Dedupe & Cross-Join Proforgekit/dataset-merge-dedupe-pro✅ Standby MCP
Dataset Diff & Change Detector (Added / Removed / Modified)forgekit/dataset-diff-change-detector✅ Standby MCP
Lead List Cleaner, Schema Validator & Normalizer (B2B CRM Prep)forgekit/lead-cleaner-schema-normalizer✅ Standby MCP
Bulk Webhook & Rate-Limited HTTP Batch Dispatcher (Retries, Auth & Capture)forgekit/bulk-webhook-http-dispatcherBatch REST API
RSS, Atom & JSON-Feed Aggregator + New-Item Monitor (MCP Ready)forgekit/rss-atom-json-feed-monitor✅ Standby MCP
PDF-to-Markdown, Clean Text & Metadata Extractor (LLM & RAG Ready + MCP)forgekit/pdf-to-markdown-text-extractor✅ Standby MCP
Bulk Domain Availability, RDAP/WHOIS Expiry & Multi-TLD Matrix Checker (MCP)forgekit/bulk-domain-availability-rdap-matrix✅ Standby MCP