{
  "openapi": "3.0.1",
  "info": {
    "title": "Universal Data Converter & JSON Flattener (CSV/XLSX/XML)",
    "description": "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.",
    "version": "1.0",
    "x-build-id": "NlSFaWhBhMUdEmAtp"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/forgekit~universal-data-converter-flattener/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-forgekit-universal-data-converter-flattener",
        "x-openai-isConsequential": false,
        "summary": "Executes an Actor, waits for its completion, and returns Actor's dataset items in response.",
        "tags": [
          "Run Actor"
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/inputSchema"
              }
            }
          }
        },
        "parameters": [
          {
            "name": "token",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "Enter your Apify token here"
          }
        ],
        "responses": {
          "200": {
            "description": "OK"
          }
        }
      }
    },
    "/acts/forgekit~universal-data-converter-flattener/runs": {
      "post": {
        "operationId": "runs-sync-forgekit-universal-data-converter-flattener",
        "x-openai-isConsequential": false,
        "summary": "Executes an Actor and returns information about the initiated run in response.",
        "tags": [
          "Run Actor"
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/inputSchema"
              }
            }
          }
        },
        "parameters": [
          {
            "name": "token",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "Enter your Apify token here"
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/runsResponseSchema"
                }
              }
            }
          }
        }
      }
    },
    "/acts/forgekit~universal-data-converter-flattener/run-sync": {
      "post": {
        "operationId": "run-sync-forgekit-universal-data-converter-flattener",
        "x-openai-isConsequential": false,
        "summary": "Executes an Actor, waits for completion, and returns the OUTPUT from Key-value store in response.",
        "tags": [
          "Run Actor"
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/inputSchema"
              }
            }
          }
        },
        "parameters": [
          {
            "name": "token",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "Enter your Apify token here"
          }
        ],
        "responses": {
          "200": {
            "description": "OK"
          }
        }
      }
    }
  },
  "components": {
    "schemas": {
      "inputSchema": {
        "type": "object",
        "properties": {
          "inputFormat": {
            "title": "Input Format",
            "enum": [
              "auto",
              "json",
              "ndjson",
              "csv",
              "tsv",
              "xlsx",
              "xml"
            ],
            "type": "string",
            "description": "Source data format (auto sniffs file extension, MIME type, or magic bytes).",
            "default": "auto"
          },
          "outputFormats": {
            "title": "Target Output Formats",
            "minItems": 1,
            "maxItems": 7,
            "type": "array",
            "description": "One or more target output formats written to Key-Value Store (json, ndjson, csv, tsv, xlsx, xml, sqlite).",
            "items": {
              "type": "string"
            },
            "default": [
              "csv"
            ]
          },
          "datasetId": {
            "title": "Apify Dataset ID",
            "maxLength": 128,
            "type": "string",
            "description": "Apify Dataset ID to convert.",
            "default": ""
          },
          "fileUrl": {
            "title": "Public File URL",
            "maxLength": 2048,
            "type": "string",
            "description": "Public URL to a JSON, NDJSON, CSV, TSV, XLSX, or XML file (SSRF-protected).",
            "default": ""
          },
          "rawInput": {
            "title": "Raw Input Payload String",
            "maxLength": 10485760,
            "type": "string",
            "description": "Inline CSV, TSV, JSON, NDJSON, or XML string payload (up to 10 MB).",
            "default": ""
          },
          "rows": {
            "title": "Inline JSON Rows",
            "maxItems": 100000,
            "type": "array",
            "description": "Inline JSON array of records to convert/flatten.",
            "default": []
          },
          "inputEncoding": {
            "title": "Input Character Encoding",
            "enum": [
              "utf-8",
              "utf-16le",
              "latin1",
              "windows-1252",
              "iso-8859-1"
            ],
            "type": "string",
            "description": "Character encoding decoded via iconv-lite (fixes broken Windows-1252 / Latin-1 / UTF-16 exports).",
            "default": "utf-8"
          },
          "jsonRootPath": {
            "title": "JSON / XML Root Path",
            "maxLength": 256,
            "type": "string",
            "description": "Optional dot-notation path extracting the record array from a nested envelope (e.g. \"data.items\").",
            "default": ""
          },
          "structureMode": {
            "title": "Structure Transformation Mode",
            "enum": [
              "preserve",
              "flatten",
              "unflatten"
            ],
            "type": "string",
            "description": "Flatten nested objects to flat columns, reconstruct nested JSON from dotted keys (unflatten), or preserve.",
            "default": "flatten"
          },
          "flattenSeparator": {
            "title": "Flatten Key Separator",
            "minLength": 1,
            "maxLength": 4,
            "type": "string",
            "description": "Delimiter joining nested path segments during flatten/unflatten (default \".\").",
            "default": "."
          },
          "arrayMode": {
            "title": "Nested Array Strategy",
            "enum": [
              "join",
              "indexed",
              "json-string",
              "unwind"
            ],
            "type": "string",
            "description": "How nested arrays are handled during flattening (join, indexed columns, JSON string, or unwind rows).",
            "default": "join"
          },
          "arrayJoinDelimiter": {
            "title": "Array Join Delimiter",
            "maxLength": 10,
            "type": "string",
            "description": "Delimiter used when arrayMode is \"join\".",
            "default": ", "
          },
          "unwindField": {
            "title": "Specific Array Path to Unwind",
            "maxLength": 128,
            "type": "string",
            "description": "Optional dot path to explode when arrayMode is \"unwind\" (empty unwinds the first top-level/nested array encountered).",
            "default": ""
          },
          "csvDelimiter": {
            "title": "CSV Output Delimiter",
            "minLength": 1,
            "maxLength": 2,
            "type": "string",
            "description": "Column separator used for CSV serialization (default \",\").",
            "default": ","
          },
          "csvUtf8Bom": {
            "title": "Include UTF-8 BOM in CSV",
            "type": "boolean",
            "description": "Prepend UTF-8 Byte Order Mark so Microsoft Excel opens accented and Unicode characters cleanly.",
            "default": true
          },
          "csvFormulaSafe": {
            "title": "Spreadsheet Formula Injection Protection",
            "type": "boolean",
            "description": "Prefix string cells starting with =, +, -, @, tab, or CR with an apostrophe in CSV/XLSX outputs.",
            "default": true
          },
          "xlsxSheetSplitField": {
            "title": "Multi-Sheet Split Column",
            "maxLength": 64,
            "type": "string",
            "description": "Optional column name to split rows into separate XLSX worksheets (1 tab per unique value, sanitized <= 31 chars).",
            "default": ""
          },
          "xlsxSheetName": {
            "title": "Custom XLSX Worksheet Name",
            "minLength": 1,
            "maxLength": 31,
            "type": "string",
            "description": "Base Excel worksheet name (automatically sanitized against Excel forbidden characters and 31-char limit).",
            "default": "Data"
          },
          "maxCellsPerSheet": {
            "title": "Max Cells Per XLSX Sheet (Auto-Rollover)",
            "minimum": 10,
            "maximum": 5000000,
            "type": "integer",
            "description": "Automatic sheet rollover threshold (Data_1, Data_2, ...) preventing Google Sheets/Excel 5M-cell crashes.",
            "default": 4000000
          },
          "onMalformedRow": {
            "title": "Malformed Row Handling",
            "enum": [
              "skip-and-log",
              "fail"
            ],
            "type": "string",
            "description": "Skip malformed CSV/NDJSON lines and record index warnings in SUMMARY.warnings[] instead of crashing.",
            "default": "skip-and-log"
          },
          "xmlRootTag": {
            "title": "XML Root Element Tag",
            "maxLength": 64,
            "type": "string",
            "description": "Root XML wrapper tag name for XML output.",
            "default": "dataset"
          },
          "xmlRowTag": {
            "title": "XML Row Element Tag",
            "maxLength": 64,
            "type": "string",
            "description": "Per-record XML tag name for XML output.",
            "default": "item"
          },
          "sqliteTableName": {
            "title": "SQLite Table Name",
            "pattern": "^[a-zA-Z_][a-zA-Z0-9_]{0,62}$",
            "maxLength": 63,
            "type": "string",
            "description": "SQL-safe table identifier used when exporting SQLite database files.",
            "default": "records"
          },
          "pushRowsToDataset": {
            "title": "Push Converted Rows to Default Dataset",
            "type": "boolean",
            "description": "Also emit transformed rows to the default Apify Dataset in addition to KV Store export files.",
            "default": true
          },
          "maxRows": {
            "title": "Max Output Rows",
            "minimum": 1,
            "maximum": 500000,
            "type": "integer",
            "description": "Hard upper cap on rows processed and exported.",
            "default": 100000
          }
        }
      },
      "runsResponseSchema": {
        "type": "object",
        "properties": {
          "data": {
            "type": "object",
            "properties": {
              "id": {
                "type": "string"
              },
              "actId": {
                "type": "string"
              },
              "userId": {
                "type": "string"
              },
              "startedAt": {
                "type": "string",
                "format": "date-time",
                "example": "2025-01-08T00:00:00.000Z"
              },
              "finishedAt": {
                "type": "string",
                "format": "date-time",
                "example": "2025-01-08T00:00:00.000Z"
              },
              "status": {
                "type": "string",
                "example": "READY"
              },
              "meta": {
                "type": "object",
                "properties": {
                  "origin": {
                    "type": "string",
                    "example": "API"
                  },
                  "userAgent": {
                    "type": "string"
                  }
                }
              },
              "stats": {
                "type": "object",
                "properties": {
                  "inputBodyLen": {
                    "type": "integer",
                    "example": 2000
                  },
                  "rebootCount": {
                    "type": "integer",
                    "example": 0
                  },
                  "restartCount": {
                    "type": "integer",
                    "example": 0
                  },
                  "resurrectCount": {
                    "type": "integer",
                    "example": 0
                  },
                  "computeUnits": {
                    "type": "integer",
                    "example": 0
                  }
                }
              },
              "options": {
                "type": "object",
                "properties": {
                  "build": {
                    "type": "string",
                    "example": "latest"
                  },
                  "timeoutSecs": {
                    "type": "integer",
                    "example": 300
                  },
                  "memoryMbytes": {
                    "type": "integer",
                    "example": 1024
                  },
                  "diskMbytes": {
                    "type": "integer",
                    "example": 2048
                  }
                }
              },
              "buildId": {
                "type": "string"
              },
              "defaultKeyValueStoreId": {
                "type": "string"
              },
              "defaultDatasetId": {
                "type": "string"
              },
              "defaultRequestQueueId": {
                "type": "string"
              },
              "buildNumber": {
                "type": "string",
                "example": "1.0.0"
              },
              "containerUrl": {
                "type": "string"
              },
              "usage": {
                "type": "object",
                "properties": {
                  "ACTOR_COMPUTE_UNITS": {
                    "type": "integer",
                    "example": 0
                  },
                  "DATASET_READS": {
                    "type": "integer",
                    "example": 0
                  },
                  "DATASET_WRITES": {
                    "type": "integer",
                    "example": 0
                  },
                  "KEY_VALUE_STORE_READS": {
                    "type": "integer",
                    "example": 0
                  },
                  "KEY_VALUE_STORE_WRITES": {
                    "type": "integer",
                    "example": 1
                  },
                  "KEY_VALUE_STORE_LISTS": {
                    "type": "integer",
                    "example": 0
                  },
                  "REQUEST_QUEUE_READS": {
                    "type": "integer",
                    "example": 0
                  },
                  "REQUEST_QUEUE_WRITES": {
                    "type": "integer",
                    "example": 0
                  },
                  "DATA_TRANSFER_INTERNAL_GBYTES": {
                    "type": "integer",
                    "example": 0
                  },
                  "DATA_TRANSFER_EXTERNAL_GBYTES": {
                    "type": "integer",
                    "example": 0
                  },
                  "PROXY_RESIDENTIAL_TRANSFER_GBYTES": {
                    "type": "integer",
                    "example": 0
                  },
                  "PROXY_SERPS": {
                    "type": "integer",
                    "example": 0
                  },
                  "PROXY_UNBLOCKER_UNITS": {
                    "type": "integer",
                    "example": 0
                  }
                }
              },
              "usageTotalUsd": {
                "type": "number",
                "example": 0.00005
              },
              "usageUsd": {
                "type": "object",
                "properties": {
                  "ACTOR_COMPUTE_UNITS": {
                    "type": "integer",
                    "example": 0
                  },
                  "DATASET_READS": {
                    "type": "integer",
                    "example": 0
                  },
                  "DATASET_WRITES": {
                    "type": "integer",
                    "example": 0
                  },
                  "KEY_VALUE_STORE_READS": {
                    "type": "integer",
                    "example": 0
                  },
                  "KEY_VALUE_STORE_WRITES": {
                    "type": "number",
                    "example": 0.00005
                  },
                  "KEY_VALUE_STORE_LISTS": {
                    "type": "integer",
                    "example": 0
                  },
                  "REQUEST_QUEUE_READS": {
                    "type": "integer",
                    "example": 0
                  },
                  "REQUEST_QUEUE_WRITES": {
                    "type": "integer",
                    "example": 0
                  },
                  "DATA_TRANSFER_INTERNAL_GBYTES": {
                    "type": "integer",
                    "example": 0
                  },
                  "DATA_TRANSFER_EXTERNAL_GBYTES": {
                    "type": "integer",
                    "example": 0
                  },
                  "PROXY_RESIDENTIAL_TRANSFER_GBYTES": {
                    "type": "integer",
                    "example": 0
                  },
                  "PROXY_SERPS": {
                    "type": "integer",
                    "example": 0
                  },
                  "PROXY_UNBLOCKER_UNITS": {
                    "type": "integer",
                    "example": 0
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}