{
  "openapi": "3.0.1",
  "info": {
    "title": "JSON to CSV & Excel Converter – Flatten Nested JSON & JSONL",
    "description": "Convert JSON, JSONL/NDJSON or API responses to CSV or Excel in bulk, and CSV/Excel back to JSON. Nested objects are flattened to dot columns and arrays are joined or exploded to rows. Choose and order the columns and pick a delimiter, with UTF-8 BOM for Excel. Input from URLs, text or datasets.",
    "version": "0.1",
    "x-build-id": "cdjnbyHzSuB7DYXxf"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/gazidev~json-to-csv-converter/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-gazidev-json-to-csv-converter",
        "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/gazidev~json-to-csv-converter/runs": {
      "post": {
        "operationId": "runs-sync-gazidev-json-to-csv-converter",
        "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/gazidev~json-to-csv-converter/run-sync": {
      "post": {
        "operationId": "run-sync-gazidev-json-to-csv-converter",
        "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": {
          "jsonUrls": {
            "title": "File or API URLs",
            "type": "array",
            "description": "Public URLs of JSON / JSON Lines (NDJSON) files or REST API endpoints (one output file per URL). In the 'CSV / Excel to JSON' direction: CSV or XLSX URLs. GitHub 'blob', Dropbox, Google Drive and Google Sheets share links are turned into direct downloads. Leave everything empty to convert an example API.",
            "items": {
              "type": "string"
            }
          },
          "jsonText": {
            "title": "Or paste JSON / JSON Lines (or CSV)",
            "type": "string",
            "description": "Paste a JSON document, a JSON array or JSON Lines directly. Handy for n8n / Make steps and AI agents. In the reverse direction paste CSV text."
          },
          "datasetId": {
            "title": "Apify dataset",
            "type": "string",
            "description": "An Apify dataset, e.g. the output of a scraper run, converted to one CSV / XLSX file. In an integration use {{resource.defaultDatasetId}}. The Actor can read your own datasets and public ones."
          },
          "direction": {
            "title": "Direction",
            "enum": [
              "json-to-table",
              "table-to-json"
            ],
            "type": "string",
            "description": "JSON to CSV / Excel (default), or CSV / Excel to JSON (dot columns such as address.city become nested objects again).",
            "default": "json-to-table"
          },
          "outputFormat": {
            "title": "Output format",
            "enum": [
              "csv",
              "xlsx",
              "both"
            ],
            "type": "string",
            "description": "CSV, Excel (XLSX with real numbers and dates, bold frozen header, autofilter) or both. Ignored in the CSV / Excel to JSON direction (the output is a JSON file).",
            "default": "csv"
          },
          "recordsPath": {
            "title": "Path to the records array (JMESPath)",
            "type": "string",
            "description": "Where the list of records is inside the JSON, e.g. 'data.items' or 'response.results'. Empty = automatic: a top-level array, or the 'items' / 'data' / 'results' / 'records' / 'rows' array of an API response, or the only array of objects."
          },
          "arrays": {
            "title": "Arrays",
            "enum": [
              "join",
              "explode",
              "index-columns"
            ],
            "type": "string",
            "description": "Join: ['a','b'] becomes 'a; b' (arrays of objects become JSON text in one cell). Explode: one row per element of each array of objects, with the parent fields repeated (e.g. one row per order line). Indexed columns: tags.0, tags.1, items.0.sku...",
            "default": "join"
          },
          "explodePath": {
            "title": "Explode only this array",
            "type": "string",
            "description": "With 'Explode to rows': the flattened name of the one array to explode, e.g. 'lineItems' or 'order.items'. Arrays of plain values can be exploded this way too. Empty = explode every array of objects."
          },
          "separator": {
            "title": "Nested key separator",
            "type": "string",
            "description": "Joins nested key names into column names: address.city, company.name. In the reverse direction it splits column names back into nested objects.",
            "default": "."
          },
          "arrayJoiner": {
            "title": "Array joiner",
            "type": "string",
            "description": "Text placed between joined array values.",
            "default": "; "
          },
          "columns": {
            "title": "Columns (choose and order)",
            "type": "array",
            "description": "Only these columns, in this order, using the flattened names (e.g. id, name, address.city). Empty = every column found in any record (column union).",
            "items": {
              "type": "string"
            }
          },
          "columnOrder": {
            "title": "Column order (when no columns are listed)",
            "enum": [
              "first-seen",
              "alphabetical"
            ],
            "type": "string",
            "description": "First-seen keeps the order of the fields in the records; new fields of later records are appended.",
            "default": "first-seen"
          },
          "delimiter": {
            "title": "CSV delimiter",
            "enum": [
              ",",
              ";",
              "tab",
              "|"
            ],
            "type": "string",
            "description": "Comma, semicolon (European Excel), tab (TSV) or pipe.",
            "default": ","
          },
          "excelBom": {
            "title": "UTF-8 BOM (for Excel)",
            "type": "boolean",
            "description": "Starts the CSV with a byte-order mark so Excel shows accents, emoji and non-Latin text correctly. Turn off for tools that dislike the BOM.",
            "default": true
          },
          "convertDates": {
            "title": "ISO dates as Excel dates",
            "type": "boolean",
            "description": "In the XLSX, write values like 2026-11-14 or 2026-11-14T10:30:00 as real Excel dates.",
            "default": true
          },
          "pushRows": {
            "title": "Also put the table rows in the dataset",
            "type": "boolean",
            "description": "Off (default): the dataset has one summary row per input with the download links. On: the dataset holds the converted rows themselves (for the next step of an integration) and the summary goes to the OUTPUT record. Charged per row.",
            "default": false
          },
          "maxRows": {
            "title": "Max rows per input",
            "minimum": 0,
            "type": "integer",
            "description": "Stop each input after this many rows (0 = no limit). Useful for a preview.",
            "default": 0
          },
          "inferTypes": {
            "title": "Detect numbers and true/false (CSV to JSON)",
            "type": "boolean",
            "description": "In the reverse direction, turn '42', '3.5', 'true' into JSON numbers and booleans. Codes with leading zeros and long digit strings stay text.",
            "default": true
          },
          "unflatten": {
            "title": "Nest dot columns (CSV to JSON)",
            "type": "boolean",
            "description": "In the reverse direction, turn 'address.city' columns into {\"address\": {\"city\": ...}} and tags.0, tags.1 into arrays.",
            "default": true
          },
          "inputDelimiter": {
            "title": "Input CSV delimiter (CSV to JSON)",
            "enum": [
              "auto",
              ",",
              ";",
              "tab",
              "|"
            ],
            "type": "string",
            "description": "Delimiter of the CSV you convert to JSON. Auto-detect works for comma, semicolon, tab and pipe.",
            "default": "auto"
          },
          "httpHeaders": {
            "title": "HTTP headers for the URLs",
            "type": "object",
            "description": "Optional headers sent with every URL request, e.g. {\"Authorization\": \"Bearer ...\"} for a private API. They are stored in the run input, so prefer a short-lived token."
          },
          "maxFileSizeMb": {
            "title": "Max download size (MB)",
            "minimum": 1,
            "maximum": 1000,
            "type": "integer",
            "description": "Larger downloads are rejected (not charged). Raise the run memory for files above ~100 MB.",
            "default": 100
          }
        }
      },
      "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
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}