{
  "openapi": "3.0.1",
  "info": {
    "title": "CSV Splitter: Split by Rows, Column or Size",
    "description": "CSV splitter for files over CRM and Google Sheets limits: cut a CSV or JSON file or an Apify dataset by rows, parts, column value or size. One download link per part. Empty input = free demo.",
    "version": "0.1",
    "x-build-id": "KLzKsxyRYv8NZYaSO"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/ucchiii~dataset-splitter/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-ucchiii-dataset-splitter",
        "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/ucchiii~dataset-splitter/runs": {
      "post": {
        "operationId": "runs-sync-ucchiii-dataset-splitter",
        "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/ucchiii~dataset-splitter/run-sync": {
      "post": {
        "operationId": "run-sync-ucchiii-dataset-splitter",
        "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": {
          "fileUrl": {
            "title": "File URL",
            "type": "string",
            "description": "Public link to a CSV, TSV, JSON or NDJSON file. Or use Apify datasets under More options."
          },
          "splitMode": {
            "title": "Split mode",
            "enum": [
              "rows",
              "parts",
              "column",
              "size",
              "sample"
            ],
            "type": "string",
            "description": "How to cut: rows, parts, column, size or sample. Fields for each mode are under More options.",
            "default": "rows"
          },
          "rowsPerPart": {
            "title": "Rows per part",
            "minimum": 1,
            "maximum": 2000000,
            "type": "integer",
            "description": "Mode rows: maximum rows per part, for example 10000 for CRM imports."
          },
          "datasetIds": {
            "title": "Apify datasets",
            "type": "array",
            "description": "Apify datasets to split (several are joined as one table). Clear the File URL above first: use one or the other."
          },
          "datasetId": {
            "title": "Or one Apify dataset",
            "type": "string",
            "description": "One Apify dataset ID or URL (kept for existing tasks). Clear the File URL above first."
          },
          "partCount": {
            "title": "Number of parts",
            "minimum": 1,
            "maximum": 500,
            "type": "integer",
            "description": "Mode parts: how many parts of nearly equal size (up to 500)."
          },
          "column": {
            "title": "Column",
            "type": "string",
            "description": "Mode column: the column whose values define the parts."
          },
          "maxParts": {
            "title": "Max parts (split by column)",
            "minimum": 1,
            "maximum": 500,
            "type": "integer",
            "description": "Mode column: the run fails before charging if the column has more values than this.",
            "default": 500
          },
          "targetSizeMb": {
            "title": "Target size per part (MB)",
            "minimum": 0.01,
            "maximum": 1000,
            "type": "number",
            "description": "Mode size: approximate size of each part in MB.",
            "default": 5
          },
          "sampleRows": {
            "title": "Sample rows",
            "minimum": 1,
            "maximum": 2000000,
            "type": "integer",
            "description": "Mode sample: number of rows to draw at random."
          },
          "samplePercent": {
            "title": "Sample percent",
            "minimum": 0.0001,
            "maximum": 100,
            "type": "number",
            "description": "Mode sample: share of rows to draw, for example 10 for 10 percent."
          },
          "seed": {
            "title": "Random seed",
            "minimum": 0,
            "maximum": 2147483647,
            "type": "integer",
            "description": "Mode sample: the same seed and data give the same sample. Empty = random, reported in the output."
          },
          "outputFormat": {
            "title": "Output format",
            "enum": [
              "csv",
              "json",
              "ndjson",
              "xlsx"
            ],
            "type": "string",
            "description": "Format of the part files: csv, json, ndjson or xlsx.",
            "default": "csv"
          },
          "saveToKeyValueStore": {
            "title": "Save part files",
            "type": "boolean",
            "description": "Save every part as a file with a download link.",
            "default": true
          },
          "saveToDatasets": {
            "title": "Also save parts as new datasets",
            "type": "boolean",
            "description": "Also write every part into its own new named dataset.",
            "default": false
          },
          "datasetNamePrefix": {
            "title": "Dataset name prefix",
            "type": "string",
            "description": "Prefix for the new datasets (lowercase letters, digits, dashes). Empty = split- plus run ID."
          },
          "inputFormat": {
            "title": "Input format",
            "enum": [
              "auto",
              "csv",
              "tsv",
              "json",
              "ndjson"
            ],
            "type": "string",
            "description": "Format of the source file. auto uses the extension and content. Ignored for datasets.",
            "default": "auto"
          },
          "encoding": {
            "title": "Input text encoding",
            "enum": [
              "auto",
              "utf-8",
              "utf-8-sig",
              "cp1252",
              "shift_jis"
            ],
            "type": "string",
            "description": "Text encoding of the source file. auto tries UTF-8, then Shift_JIS, then Windows-1252.",
            "default": "auto"
          },
          "detectNumbers": {
            "title": "Detect numbers in CSV",
            "type": "boolean",
            "description": "Turn plain numbers in a CSV into real numbers (useful for XLSX and JSON).",
            "default": false
          },
          "csvBom": {
            "title": "CSV: add UTF-8 BOM for Excel",
            "type": "boolean",
            "description": "Add a UTF-8 byte-order mark to CSV parts so Excel shows non-English text correctly.",
            "default": false
          },
          "fileName": {
            "title": "File name",
            "type": "string",
            "description": "Start of every part file name, for example leads gives leads-part-001.csv."
          }
        }
      },
      "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
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}