{
  "openapi": "3.0.1",
  "info": {
    "title": "Data Cleaning & Transformation Toolkit",
    "description": "A powerful, multi-mode Apify actor that transforms messy, unstructured data into clean, structured JSON — ready for APIs, databases, or downstream processing.",
    "version": "0.0",
    "x-build-id": "U3HDOIjThX89PE5Db"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/moving_beacon-owner1~my-actor-66/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-moving_beacon-owner1-my-actor-66",
        "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/moving_beacon-owner1~my-actor-66/runs": {
      "post": {
        "operationId": "runs-sync-moving_beacon-owner1-my-actor-66",
        "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/moving_beacon-owner1~my-actor-66/run-sync": {
      "post": {
        "operationId": "run-sync-moving_beacon-owner1-my-actor-66",
        "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": [
          "mode"
        ],
        "properties": {
          "mode": {
            "title": "Transformation Mode",
            "enum": [
              "messy_text",
              "excel_csv",
              "html_scrape",
              "key_value",
              "url_fetch"
            ],
            "type": "string",
            "description": "Select the type of data transformation to perform.",
            "default": "messy_text"
          },
          "inputText": {
            "title": "Input Text / Raw Data",
            "type": "string",
            "description": "Paste your messy text, key-value config, or raw HTML here. Not needed if uploading a file or fetching a URL.",
            "default": "Name: John Doe | Age: 29 | City: New York | Active: yes\nName: Jane Smith | Age: 32 | City: Los Angeles | Active: true\nName: Bob Johnson | Age: 45 | City: Chicago | Active: no"
          },
          "fileUrl": {
            "title": "File URL (Excel / CSV / HTML)",
            "type": "string",
            "description": "Direct URL to an .xlsx, .csv, or .html file to download and process.",
            "default": ""
          },
          "urls": {
            "title": "URLs to Scrape",
            "type": "array",
            "description": "List of web page URLs to fetch and extract data from (for url_fetch and html_scrape modes).",
            "items": {
              "type": "object",
              "required": [
                "url"
              ],
              "properties": {
                "url": {
                  "type": "string",
                  "title": "URL",
                  "description": "The web page URL to fetch and process."
                }
              }
            },
            "default": [
              {
                "url": "https://books.toscrape.com/"
              }
            ]
          },
          "textParseStrategy": {
            "title": "Text Parsing Strategy",
            "enum": [
              "auto",
              "delimited",
              "key_value",
              "block"
            ],
            "type": "string",
            "description": "How to parse the messy text. 'auto' detects the format automatically.",
            "default": "auto"
          },
          "kvFormat": {
            "title": "Key-Value Format",
            "enum": [
              "auto",
              "env",
              "ini",
              "log",
              "yaml"
            ],
            "type": "string",
            "description": "Format of the key-value input. 'auto' detects automatically.",
            "default": "auto"
          },
          "htmlExtractMode": {
            "title": "HTML Extraction Mode",
            "enum": [
              "tables",
              "elements",
              "links",
              "text",
              "auto"
            ],
            "type": "string",
            "description": "What to extract from the HTML content.",
            "default": "tables"
          },
          "cssSelector": {
            "title": "CSS Container Selector",
            "type": "string",
            "description": "CSS selector for repeating items (e.g., 'div.product-card', 'li.item'). Used in 'elements' HTML mode.",
            "default": "article.product_pod"
          },
          "fieldMap": {
            "title": "Field Mapping (JSON)",
            "type": "string",
            "description": "JSON object mapping output field names to CSS selectors within each container. Example: {\"title\": \"h3 a\", \"price\": \".price_color\"}",
            "default": "{\n  \"title\": \"h3 a\",\n  \"price\": \".price_color\",\n  \"availability\": \".availability\",\n  \"rating\": \"p.star-rating\"\n}"
          },
          "sheetName": {
            "title": "Sheet Name",
            "type": "string",
            "description": "Specific Excel sheet to read. Leave empty to read all sheets.",
            "default": ""
          },
          "skipEmptyRows": {
            "title": "Skip Empty Rows",
            "type": "boolean",
            "description": "Remove rows that are entirely blank from the output.",
            "default": true
          },
          "forwardFillColumns": {
            "title": "Forward-Fill Columns",
            "type": "string",
            "description": "Comma-separated list of column names to forward-fill (for merged cells in Excel). Leave empty to skip.",
            "default": ""
          },
          "pageSize": {
            "title": "Page Size (Pagination)",
            "minimum": 0,
            "maximum": 10000,
            "type": "integer",
            "description": "Number of records per page in the output. Set to 0 for no pagination.",
            "default": 0
          },
          "outputFormat": {
            "title": "Output Format",
            "enum": [
              "records",
              "wrapped",
              "flat"
            ],
            "type": "string",
            "description": "How to structure the final output in the dataset.",
            "default": "records"
          },
          "proxyConfiguration": {
            "title": "Proxy Configuration",
            "type": "object",
            "description": "Proxy settings for fetching URLs. Uses Apify Proxy by default.",
            "default": {
              "useApifyProxy": true
            }
          },
          "maxRequestRetries": {
            "title": "Max Request Retries",
            "minimum": 0,
            "maximum": 10,
            "type": "integer",
            "description": "Maximum number of retries for failed HTTP requests.",
            "default": 3
          }
        }
      },
      "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
                  }
                }
              },
              "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
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}