{
  "openapi": "3.0.1",
  "info": {
    "title": "Data Ops: Convert, Clean, Validate, Compare Files",
    "description": "Convert CSV, Excel, JSON, XML, PDF and Office files. Clean CSV data, validate rows with rules or JSON Schema, compare two files by key columns, and make PDF or DOCX documents from templates. Works in bulk.",
    "version": "0.1",
    "x-build-id": "UhOxLEiDEksCEDoEK"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/apizilla~data-ops-api/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-apizilla-data-ops-api",
        "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/apizilla~data-ops-api/runs": {
      "post": {
        "operationId": "runs-sync-apizilla-data-ops-api",
        "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/apizilla~data-ops-api/run-sync": {
      "post": {
        "operationId": "run-sync-apizilla-data-ops-api",
        "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": [
              "convert",
              "clean",
              "validate",
              "compare",
              "generate-document"
            ],
            "type": "string",
            "description": "What to do with your files or records. Every operation works in bulk.",
            "default": "convert"
          },
          "fileUrls": {
            "title": "File links",
            "type": "array",
            "description": "Public links (http or https) to your files. Add one link per line. For compare, files are used in pairs: 1st with 2nd, 3rd with 4th.",
            "items": {
              "type": "string"
            }
          },
          "inlineFiles": {
            "title": "Inline files",
            "type": "array",
            "description": "Small files pasted into the input. Each item: {\"name\": \"data.csv\", \"content\": \"...\"}. For binary files add \"encoding\": \"base64\"."
          },
          "records": {
            "title": "Records",
            "type": "array",
            "description": "Rows as a JSON list of objects. Example: [{\"id\": 1, \"name\": \"Anna\"}]. Used as one table."
          },
          "keyValueStoreId": {
            "title": "Key-value store",
            "type": "string",
            "description": "ID or name of a key-value store that holds your files. Leave empty to use this run's default store."
          },
          "keyValueStoreKeys": {
            "title": "Key-value store keys",
            "type": "array",
            "description": "Keys of the files in the key-value store above. One key per line.",
            "items": {
              "type": "string"
            }
          },
          "datasetId": {
            "title": "Dataset",
            "type": "string",
            "description": "ID or name of an Apify dataset to use as a table."
          },
          "secondDatasetId": {
            "title": "Second dataset",
            "type": "string",
            "description": "A second dataset. Useful for compare: the first dataset is the old data, this one is the new data."
          },
          "inputDelimiter": {
            "title": "CSV delimiter of input files",
            "enum": [
              "auto",
              ",",
              ";",
              "tab",
              "|"
            ],
            "type": "string",
            "description": "Leave on auto. The delimiter and the text encoding are found for you.",
            "default": "auto"
          },
          "sheetName": {
            "title": "Sheet name",
            "type": "string",
            "description": "For Excel or ODS input. Leave empty to read the first sheet."
          },
          "targetFormat": {
            "title": "Convert to",
            "enum": [
              "csv",
              "tsv",
              "xlsx",
              "json",
              "jsonl",
              "xml",
              "html",
              "parquet",
              "pdf",
              "txt",
              "docx",
              "odt",
              "rtf",
              "pptx",
              "odp",
              "ods"
            ],
            "type": "string",
            "description": "The output format for convert. Tables: csv, tsv, xlsx, json, jsonl, xml, html, parquet, pdf. Office files: pdf, docx, odt, rtf, pptx, odp, ods. PDF input (BETA): txt for text, or csv, xlsx, json, html for tables.",
            "default": "json"
          },
          "outputDelimiter": {
            "title": "CSV delimiter of output",
            "enum": [
              ",",
              ";",
              "tab",
              "|"
            ],
            "type": "string",
            "description": "Delimiter for CSV output.",
            "default": ","
          },
          "inferTypes": {
            "title": "Detect numbers and true/false",
            "type": "boolean",
            "description": "For JSON, Excel and Parquet output made from text files: turn \"42\" into 42 and \"true\" into true. Values with leading zeros, like zip codes, stay text.",
            "default": true
          },
          "excelFriendlyCsv": {
            "title": "Excel friendly CSV",
            "type": "boolean",
            "description": "Add a BOM mark so Excel opens UTF-8 CSV files with the right characters.",
            "default": false
          },
          "maxPdfPages": {
            "title": "Max PDF pages",
            "minimum": 1,
            "maximum": 2000,
            "type": "integer",
            "description": "Read at most this many pages of each PDF.",
            "default": 50
          },
          "pdfTableMode": {
            "title": "PDF table detection (BETA)",
            "enum": [
              "lines",
              "text"
            ],
            "type": "string",
            "description": "How to find tables in PDF files. Use text for tables that have no lines. Text mode can split normal text into columns, so check the result.",
            "default": "lines"
          },
          "trimWhitespace": {
            "title": "Trim spaces",
            "type": "boolean",
            "description": "Remove spaces at the start and end of each value.",
            "default": true
          },
          "collapseSpaces": {
            "title": "Collapse spaces",
            "type": "boolean",
            "description": "Turn many spaces and odd space characters into one normal space.",
            "default": true
          },
          "fixEncoding": {
            "title": "Fix broken characters",
            "type": "boolean",
            "description": "Repair text like \"cafÃ©\" to \"café\" and remove invisible characters.",
            "default": true
          },
          "removeEmptyRows": {
            "title": "Remove empty rows",
            "type": "boolean",
            "description": "Drop rows where every value is empty.",
            "default": true
          },
          "removeEmptyColumns": {
            "title": "Remove empty columns",
            "type": "boolean",
            "description": "Drop columns where every value is empty.",
            "default": false
          },
          "removeDuplicates": {
            "title": "Remove duplicates",
            "enum": [
              "none",
              "exact",
              "columns"
            ],
            "type": "string",
            "description": "exact: rows that are the same in every column. columns: rows that are the same in the columns you list below. The first row is kept.",
            "default": "exact"
          },
          "duplicateColumns": {
            "title": "Duplicate columns",
            "type": "array",
            "description": "Columns used to find duplicates when Remove duplicates is columns.",
            "items": {
              "type": "string"
            }
          },
          "duplicatesIgnoreCase": {
            "title": "Ignore case for duplicates",
            "type": "boolean",
            "description": "Treat \"Anna\" and \"ANNA\" as the same.",
            "default": true
          },
          "headerStyle": {
            "title": "Column names",
            "enum": [
              "keep",
              "trim",
              "snake_case",
              "lower",
              "Title Case"
            ],
            "type": "string",
            "description": "How to write the column names.",
            "default": "trim"
          },
          "emailColumns": {
            "title": "Email columns",
            "type": "array",
            "description": "Make emails lower case and count values that do not look like emails.",
            "items": {
              "type": "string"
            }
          },
          "phoneColumns": {
            "title": "Phone columns",
            "type": "array",
            "description": "Rewrite phone numbers in one format.",
            "items": {
              "type": "string"
            }
          },
          "phoneRegion": {
            "title": "Default phone country",
            "type": "string",
            "description": "Two letter country code used for numbers without a + prefix. Example: US, GB, DE, PT.",
            "default": "US"
          },
          "phoneFormat": {
            "title": "Phone format",
            "enum": [
              "E164",
              "INTERNATIONAL",
              "NATIONAL"
            ],
            "type": "string",
            "description": "E164: +14155550123. INTERNATIONAL: +1 415-555-0123. NATIONAL: (415) 555-0123.",
            "default": "E164"
          },
          "dateColumns": {
            "title": "Date columns",
            "type": "array",
            "description": "Rewrite dates in these columns in one format.",
            "items": {
              "type": "string"
            }
          },
          "dateFormat": {
            "title": "Date format",
            "enum": [
              "YYYY-MM-DD",
              "DD/MM/YYYY",
              "MM/DD/YYYY",
              "DD.MM.YYYY",
              "YYYY-MM-DD HH:mm:ss",
              "ISO 8601"
            ],
            "type": "string",
            "description": "Format for cleaned dates.",
            "default": "YYYY-MM-DD"
          },
          "dayFirst": {
            "title": "Day comes first",
            "type": "boolean",
            "description": "Read 05/02/2026 as 5 February, not May 2.",
            "default": false
          },
          "lowercaseColumns": {
            "title": "Lower case columns",
            "type": "array",
            "description": "Make all text in these columns lower case.",
            "items": {
              "type": "string"
            }
          },
          "uppercaseColumns": {
            "title": "Upper case columns",
            "type": "array",
            "description": "Make all text in these columns upper case.",
            "items": {
              "type": "string"
            }
          },
          "titleCaseColumns": {
            "title": "Title case columns",
            "type": "array",
            "description": "Make Each Word Start With A Capital Letter.",
            "items": {
              "type": "string"
            }
          },
          "outputFormat": {
            "title": "Output format for cleaned or split data",
            "enum": [
              "same",
              "csv",
              "tsv",
              "xlsx",
              "json",
              "jsonl",
              "xml",
              "parquet"
            ],
            "type": "string",
            "description": "same keeps the input format (old Excel and ODS become xlsx).",
            "default": "same"
          },
          "rules": {
            "title": "Validation rules",
            "type": "array",
            "description": "One rule per column. Fields: column, required, type (string, integer, number, boolean, date, email, url, phone), pattern, min, max, minLength, maxLength, allowedValues, unique, dateFormat, phoneRegion, caseSensitive."
          },
          "jsonSchema": {
            "title": "JSON Schema",
            "type": "object",
            "description": "Optional JSON Schema (draft 2020-12). Each row is checked against it. Text values are turned into numbers or true/false when the schema asks for them."
          },
          "requiredColumns": {
            "title": "Required columns",
            "type": "array",
            "description": "Columns that must exist in the file.",
            "items": {
              "type": "string"
            }
          },
          "splitValidRows": {
            "title": "Save valid and invalid rows",
            "type": "boolean",
            "description": "Also save two files: valid rows and invalid rows.",
            "default": false
          },
          "maxErrorsInReport": {
            "title": "Max problems listed in the report",
            "minimum": 1,
            "maximum": 1000000,
            "type": "integer",
            "description": "All problems are counted. Only this many are listed.",
            "default": 10000
          },
          "keyColumns": {
            "title": "Key columns",
            "type": "array",
            "description": "Columns that identify a row, like id or sku. Rows with the same key are compared cell by cell. Leave empty to match whole rows.",
            "items": {
              "type": "string"
            }
          },
          "ignoreColumns": {
            "title": "Ignore columns",
            "type": "array",
            "description": "Columns to skip when comparing.",
            "items": {
              "type": "string"
            }
          },
          "ignoreCase": {
            "title": "Ignore case",
            "type": "boolean",
            "description": "Treat \"Anna\" and \"ANNA\" as the same.",
            "default": false
          },
          "trimValues": {
            "title": "Ignore spaces at start and end",
            "type": "boolean",
            "description": "Treat \" 5\" and \"5\" as the same.",
            "default": true
          },
          "numericTolerance": {
            "title": "Number tolerance",
            "type": "string",
            "description": "Numbers that differ by this much or less count as the same. Example: 0.01.",
            "default": "0"
          },
          "includeUnchanged": {
            "title": "Show unchanged rows",
            "type": "boolean",
            "description": "Also list rows that did not change in the report.",
            "default": false
          },
          "templateHtml": {
            "title": "HTML template",
            "type": "string",
            "description": "An HTML template with Jinja2 placeholders, like <h1>Invoice {{ id }}</h1>. Use {{ row['Full Name'] }} for column names with spaces. In single mode, loop with {% for r in rows %}."
          },
          "templateUrl": {
            "title": "Template link",
            "type": "string",
            "description": "Link to a DOCX, XLSX or HTML template. DOCX templates use {{ placeholders }} (docxtpl). XLSX templates replace {{ placeholders }} in cells."
          },
          "templateKey": {
            "title": "Template key",
            "type": "string",
            "description": "Key of the template in the key-value store set above."
          },
          "templateInline": {
            "title": "Inline template",
            "type": "object",
            "description": "A small template pasted into the input: {\"name\": \"invoice.docx\", \"content\": \"<base64>\", \"encoding\": \"base64\"}. For HTML you can use \"encoding\": \"text\"."
          },
          "documentFormat": {
            "title": "Document format",
            "enum": [
              "pdf",
              "docx",
              "xlsx",
              "html"
            ],
            "type": "string",
            "description": "pdf works with all templates. docx needs a DOCX template. xlsx needs an XLSX template. html needs an HTML template.",
            "default": "pdf"
          },
          "documentMode": {
            "title": "Documents",
            "enum": [
              "per-row",
              "single"
            ],
            "type": "string",
            "description": "per-row: one document per data row. single: one document with all rows (use the rows list in the template).",
            "default": "per-row"
          },
          "fileNameTemplate": {
            "title": "File name",
            "type": "string",
            "description": "Name for each document, without extension. Placeholders work, like invoice-{{ id }}.",
            "default": "document-{{ _index }}"
          },
          "maxDocuments": {
            "title": "Max documents",
            "minimum": 1,
            "maximum": 100000,
            "type": "integer",
            "description": "Stop after this many documents.",
            "default": 1000
          },
          "maxFiles": {
            "title": "Max input files",
            "minimum": 1,
            "maximum": 10000,
            "type": "integer",
            "description": "Safety limit for the number of inputs in one run.",
            "default": 100
          },
          "maxFileSizeMb": {
            "title": "Max file size (MB)",
            "minimum": 1,
            "maximum": 500,
            "type": "integer",
            "description": "Bigger files are skipped. Packed files (xlsx, docx) may unpack to at most 20 times this size.",
            "default": 50
          },
          "maxRowsPerFile": {
            "title": "Max rows per file",
            "minimum": 1,
            "maximum": 10000000,
            "type": "integer",
            "description": "Files with more rows are skipped.",
            "default": 1000000
          }
        }
      },
      "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
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}