Universal Data Converter & JSON Flattener (CSV/XLSX/XML)
Pricing
from $2.80 / 1,000 output format files generated
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
Maintained by CommunityActor stats
0
Bookmarked
1
Total users
0
Monthly active users
15 hours ago
Last modified
Categories
Features
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:sqliteDatabaseSyncwith typedINTEGER/REAL/TEXTcolumns and safe parameterizedINSERTtransactions). - Deep Flatten & Reverse Unflatten: Supports 4 nested array expansion strategies (
join,indexed,json-string, andunwindrow explosion) PLUS dotted-key reconstruction back into nested JSON objects and arrays. - Legacy Encoding Repair (
iconv-lite): Decodeswindows-1252,iso-8859-1,latin1, andutf-16leexports 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-SheetxlsxSheetSplitField: 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 inSUMMARY.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.
- Automatic XLSX Cell-Limit & Row-Limit Rollover (
| Capability | Universal Data Converter & Flattener | humble-echidna/dataset-transform | gazidev/dataset-filter-transform | thecfmarketing/csv-xlsx-merger |
|---|---|---|---|---|
| Output Formats | JSON, NDJSON, CSV, TSV, Multi-Sheet XLSX, XML, SQLite | JSON, CSV, XLSX | JSON, CSV, XLSX | CSV, 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 Unflatten | Both (join, indexed, json-string, unwind) | Flatten only | Flatten only | None |
| Auto XLSX Cell-Limit Rollover | Built-in (maxCellsPerSheet) | Crashes at limit | Crashes at limit | None |
Legacy windows-1252 Decoding | Built-in (iconv-lite) | UTF-8 only | UTF-8 only | UTF-8 only |
| Standby MCP Server | Native JSON-RPC 2.0 + SSE (2 tools) | None | None | None |
Input Configuration
| Field | Type | Required | Default | Description |
|---|---|---|---|---|
inputFormat | string | No | "auto" | Source format: "auto", "json", "ndjson", "csv", "tsv", "xlsx", or "xml". |
outputFormats | string[] | No | ["csv"] | Target KV export formats ("json", "ndjson", "csv", "tsv", "xlsx", "xml", "sqlite"). |
datasetId | string | No | "" | Apify Dataset ID to ingest. |
fileUrl | string | No | "" | Public file URL (SSRF-protected, up to 50 MB). |
rawInput | string | No | "" | Inline CSV, TSV, JSON, NDJSON, or XML string payload (up to 10 MB). |
rows | object[] | No | [] | Inline JSON row array (up to 100,000 rows). |
inputEncoding | string | No | "utf-8" | Character encoding decoded via iconv-lite ("utf-8", "utf-16le", "latin1", "windows-1252", "iso-8859-1"). |
jsonRootPath | string | No | "" | Dot path to extract record array from a nested JSON/XML envelope (e.g. "data.items"). |
structureMode | string | No | "flatten" | "preserve", "flatten", or "unflatten". |
flattenSeparator | string | No | "." | Key separator used during flatten/unflatten (1–4 chars). |
arrayMode | string | No | "join" | Nested array strategy: "join", "indexed", "json-string", or "unwind". |
arrayJoinDelimiter | string | No | ", " | Delimiter used when arrayMode="join". |
unwindField | string | No | "" | Specific array path to explode when arrayMode="unwind". |
csvDelimiter | string | No | "," | Column delimiter for CSV output. |
csvUtf8Bom | boolean | No | true | Prepend UTF-8 BOM to CSV output for clean Microsoft Excel Unicode rendering. |
csvFormulaSafe | boolean | No | true | Prefix leading =, +, -, @, \t, \r cells with ' in CSV/XLSX outputs. |
xlsxSheetSplitField | string | No | "" | Optional column splitting rows into separate Excel tabs (1 tab per unique value). |
xlsxSheetName | string | No | "Data" | Custom base Excel worksheet name (1–31 chars, auto-sanitized). |
maxCellsPerSheet | integer | No | 4000000 | Automatic sheet rollover threshold (10–5,000,000 cells) creating <Name>_1, <Name>_2, etc. |
onMalformedRow | string | No | "skip-and-log" | "skip-and-log" records warnings without aborting; "fail" throws immediately. |
xmlRootTag | string | No | "dataset" | Root XML element name. |
xmlRowTag | string | No | "item" | Row XML element name. |
sqliteTableName | string | No | "records" | SQL-safe table name (^[a-zA-Z_][a-zA-Z0-9_]{0,62}$) for SQLite export. |
pushRowsToDataset | boolean | No | true | Also push transformed rows to the default Apify Dataset. |
maxRows | integer | No | 100000 | Hard 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 Key | Event Title | Price (USD) | Billing Trigger |
|---|---|---|---|
actor-start | Actor run start | $0.005 | Charged once per non-empty conversion run (waived on 0-row runs). |
file-converted | Output format file generated | $0.004 | Charged per generated KV export artifact (OUTPUT_CSV, OUTPUT_XLSX, OUTPUT_SQLITE, etc.). |
row-converted | Row processed & converted | $0.0002 | Charged per transformed output row. |
mcp-tool-call | Standby MCP tool execution | $0.003 | Charged 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 /mcpandGET /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:
sqliteTableNameis strictly validated against^[a-zA-Z_][a-zA-Z0-9_]{0,62}$with double-quoted identifiers and parameterized?value bindings (zero SQL injection surface).fileUrlenforces SSRF protection (http:/https:only, blocking private/loopback/metadata IPs) and a50 MBfile cap. - Temporary File Hygiene: SQLite databases are built inside isolated OS temp files, buffered into KV storage, and removed in a
finallyblock 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)
- Open
forgekit/universal-data-converter-flattenerin Apify Console and click Try for free. - Paste or adjust the ready-to-run input JSON below (safe defaults are pre-filled).
- 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 ApifyClientimport osclient = 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.
Related forgekit Actors
Explore companion Actors in Data Pipeline & ETL and core ETL utilities to chain end-to-end pipelines:
| Actor | Store Slug | Mode |
|---|---|---|
| Dataset Merge, Fuzzy Dedupe & Cross-Join Pro | forgekit/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-dispatcher | Batch 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 |