{
  "openapi": "3.0.1",
  "info": {
    "title": "Data Cleaner: Normalize Phone, URL, Price & Date Fields",
    "description": "Data cleaner from $0.50 per 1,000 rows ($0.80 on the Free plan): normalizes 6 field types in datasets, CSV, JSON or Excel: phone to E.164, email, URL, price and currency, date to ISO, company names. Works on nested fields and flags new, changed and removed rows since the last run.",
    "version": "0.1",
    "x-build-id": "GHK1PGv3AO45j6dO2"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/tamatama~data-normalizer/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-tamatama-data-normalizer",
        "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/tamatama~data-normalizer/runs": {
      "post": {
        "operationId": "runs-sync-tamatama-data-normalizer",
        "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/tamatama~data-normalizer/run-sync": {
      "post": {
        "operationId": "run-sync-tamatama-data-normalizer",
        "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": {
          "data": {
            "title": "Rows (JSON array)",
            "type": "array",
            "description": "The rows to clean, as a JSON array of objects. Nested objects are fine (e.g. contact.phone). Use this, or a dataset ID, or a file URL below."
          },
          "datasetId": {
            "title": "Apify dataset ID",
            "type": "string",
            "description": "Clean the items of an Apify dataset, e.g. the output of a scraper run. Overrides the rows above."
          },
          "fileUrl": {
            "title": "File URL (CSV, JSON, JSON Lines or XLSX)",
            "type": "string",
            "description": "A public URL of a CSV, JSON, JSON Lines or Excel (.xlsx, first sheet) file, up to 50 MB. Overrides the rows above."
          },
          "fields": {
            "title": "Fields and their types",
            "type": "object",
            "description": "Which fields to clean and how: {\"field name\": \"type\"}. Types: phone, email, url, price, date, company. Use dots for nested fields, e.g. {\"contact.tel\": \"phone\", \"cost\": \"price\"}. Leave empty to detect by field name."
          },
          "autoDetect": {
            "title": "Detect fields by name",
            "type": "boolean",
            "description": "Also clean fields whose names say what they are (phone, tel, email, url, website, price, cost, salary, date, createdAt, company, employer...). Fields you name above win.",
            "default": true
          },
          "defaultCountry": {
            "title": "Country for phone numbers without +",
            "type": "string",
            "description": "Two-letter country code used for numbers written without a country code, e.g. US, GB, DE, JP. Numbers starting with + are read as written.",
            "default": "US"
          },
          "dateOrder": {
            "title": "Order of numeric dates",
            "enum": [
              "MDY",
              "DMY",
              "YMD"
            ],
            "type": "string",
            "description": "How to read dates like 03/04/2026: MDY = March 4 (US), DMY = 3 April (UK, EU), YMD. Values where day and month could be swapped get a note in _issues.",
            "default": "MDY"
          },
          "defaultCurrency": {
            "title": "Currency for $, ¥, kr and plain numbers",
            "type": "string",
            "description": "Three-letter code used when the symbol is shared by several currencies ($, ¥, kr) or missing, e.g. USD, CAD, JPY, CNY. Empty = leave the currency null and note it in _issues.",
            "default": "USD"
          },
          "decimalSeparator": {
            "title": "Decimal separator in prices",
            "enum": [
              "",
              ".",
              ","
            ],
            "type": "string",
            "description": "Leave on auto unless your prices are all written one way: \".\" (1,299.50) or \",\" (1.299,50).",
            "default": ""
          },
          "removeTrackingParams": {
            "title": "Remove tracking parameters from URLs",
            "type": "boolean",
            "description": "Drop utm_*, gclid, fbclid and similar parameters.",
            "default": true
          },
          "removeWww": {
            "title": "Remove www. from URLs",
            "type": "boolean",
            "description": "Treat www.example.com and example.com as the same site.",
            "default": true
          },
          "companyMatchThreshold": {
            "title": "Company name match (0-100)",
            "minimum": 0,
            "maximum": 100,
            "type": "integer",
            "description": "Company names whose cleaned keys are at least this similar get the same <field>_group (e.g. \"Acme Corp.\" and \"ACME Corporation\"). 100 = exact keys only, 0 = off.",
            "default": 90
          },
          "keyField": {
            "title": "Key field to compare with the last run",
            "type": "string",
            "description": "A field that identifies a row (e.g. id, sku, url). Each row then gets _change: new, changed or unchanged against the last run with the same compare name, and rows that are gone are added with _change: removed (not charged)."
          },
          "compareName": {
            "title": "Compare name",
            "type": "string",
            "description": "Separate comparisons by name, e.g. one per supplier feed. Runs with the same name are compared.",
            "default": "default"
          },
          "onlyChanges": {
            "title": "Output only new and changed rows",
            "type": "boolean",
            "description": "With a key field: leave out unchanged rows (they are not charged).",
            "default": false
          },
          "maxRows": {
            "title": "Max rows",
            "minimum": 0,
            "type": "integer",
            "description": "Stop after this many rows. 0 = all (up to 100,000 per run).",
            "default": 0
          }
        }
      },
      "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
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}