{
  "openapi": "3.0.1",
  "info": {
    "title": "Excel & CSV Merger: Consolidate, Pivot & Batch Convert",
    "description": "Combine, pivot, and batch convert, rename, or format many Excel and CSV files in one run.",
    "version": "0.1",
    "x-build-id": "Q2cgu3Bu8y2etHcsa"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/dws_build~excel-csv-merger-consolidate-pivot-batch-convert/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-dws_build-excel-csv-merger-consolidate-pivot-batch-convert",
        "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/dws_build~excel-csv-merger-consolidate-pivot-batch-convert/runs": {
      "post": {
        "operationId": "runs-sync-dws_build-excel-csv-merger-consolidate-pivot-batch-convert",
        "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/dws_build~excel-csv-merger-consolidate-pivot-batch-convert/run-sync": {
      "post": {
        "operationId": "run-sync-dws_build-excel-csv-merger-consolidate-pivot-batch-convert",
        "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",
        "required": [
          "operation"
        ],
        "properties": {
          "operation": {
            "title": "Operation",
            "enum": [
              "consolidate",
              "pivot",
              "convert",
              "rename_columns",
              "format"
            ],
            "type": "string",
            "description": "What to do with the files. consolidate: combine sheets into one. pivot: group and aggregate across all sheets. convert, rename_columns, format: apply to each file separately; in any of these three, Rename columns and Format options both apply when filled in (rename first, then format)."
          },
          "files": {
            "title": "Files (URL or base64)",
            "type": "array",
            "description": "Files to process (.xlsx, .xlsm, .xls, .csv), as direct-download links. Each item is {\"url\": \"https://...\", \"name\": \"optional label\"} or {\"base64\": \"...\", \"name\": \"jan.csv\"}. Up to 50 files and 30 MB in total. Base64 is limited to 5 MB per file and 10 MB per run. Example: [{\"url\": \"https://example.com/jan.xlsx\"}, {\"url\": \"https://example.com/feb.csv\", \"name\": \"February\"}]."
          },
          "sheets": {
            "title": "Sheets",
            "type": "array",
            "description": "Sheet names to read from each workbook. Leave empty to read all sheets. A CSV is one sheet named after the file.",
            "items": {
              "type": "string"
            }
          },
          "outputFormat": {
            "title": "Output format",
            "enum": [
              "xlsx",
              "csv",
              "json"
            ],
            "type": "string",
            "description": "File format of every output, for all operations (convert uses it as the target format). json is an array of row objects per sheet. The format operation requires xlsx.",
            "default": "xlsx"
          },
          "consolidate": {
            "title": "Consolidate options",
            "type": "object",
            "description": "Used when operation is consolidate. stack_rows appends rows and aligns columns by header name. merge_on_key joins sheets side by side on a key column."
          },
          "pivot": {
            "title": "Pivot options",
            "type": "object",
            "description": "Used when operation is pivot. groupBy: key columns. values: numeric columns to aggregate. aggregations: any of sum, count, mean, min, max."
          },
          "renameColumns": {
            "title": "Rename columns",
            "type": "object",
            "description": "A map of old header name to new header name, applied to every file, such as {\"Cust ID\": \"customer_id\"}. Required for rename_columns. Also applies in convert and format runs when filled in."
          },
          "format": {
            "title": "Format options",
            "type": "object",
            "description": "Excel formatting applied to every file: boldHeader, freezeHeader, autoWidth (true or false, all default to true), and columnFormats, a map of column name to Excel number format, such as {\"Revenue\": \"#,##0.00\", \"Date\": \"yyyy-mm-dd\"}. Used by the format operation, and also by convert and rename_columns when filled in. Needs xlsx output."
          }
        }
      },
      "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
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}