{
  "openapi": "3.0.1",
  "info": {
    "title": "Dataset Dedupe by Rules: URL, E-mail, Phone + Review",
    "description": "Remove duplicates from Apify datasets and JSON, JSONL or CSV files with ordered rules: exact, text, URL, domain, phone, e-mail and number tolerance. See which rule matched. Fuzzy matches are never merged: they go to a review list with score and reason.",
    "version": "0.1",
    "x-build-id": "QSUZgLfA3btDniv10"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/bardach_technologies~dataset-dedupe-match-rules/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-bardach_technologies-dataset-dedupe-match-rules",
        "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/bardach_technologies~dataset-dedupe-match-rules/runs": {
      "post": {
        "operationId": "runs-sync-bardach_technologies-dataset-dedupe-match-rules",
        "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/bardach_technologies~dataset-dedupe-match-rules/run-sync": {
      "post": {
        "operationId": "run-sync-bardach_technologies-dataset-dedupe-match-rules",
        "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": {
          "datasetIds": {
            "title": "Dataset IDs",
            "maxItems": 20,
            "type": "array",
            "description": "Apify datasets to read, in this order, up to 20. Through the API pass dataset IDs or username~dataset-name. Datasets are read before files."
          },
          "fileUrls": {
            "title": "File URLs",
            "maxItems": 20,
            "type": "array",
            "description": "Public http(s) links to JSON (array of objects), JSONL or CSV files, up to 20. Standard ports and host names only: IP addresses, private hosts and links with a user name are refused, also after a redirect. Compressed files are not supported.",
            "items": {
              "type": "string"
            }
          },
          "fileFormat": {
            "title": "File format",
            "enum": [
              "auto",
              "json",
              "jsonl",
              "csv"
            ],
            "type": "string",
            "description": "Auto looks at the first bytes of each file.",
            "default": "auto"
          },
          "csvDelimiter": {
            "title": "CSV delimiter",
            "enum": [
              ",",
              ";",
              "\t",
              "|"
            ],
            "type": "string",
            "description": "Comma, semicolon, tab or pipe.",
            "default": ","
          },
          "rules": {
            "title": "Match rules (in order)",
            "type": "array",
            "description": "1 to 10 rules; earlier rules are applied first. Each rule: type (exact, normalized_text, normalized_url, domain, phone, email, numeric, fuzzy_review) and fields (1 to 5; dots reach nested values, all fields must have a value). numeric also needs tolerance and blockFields. fuzzy_review never merges: it lists similar pairs for review, and takes threshold (0.70 to 0.99, default 0.85) and optional blockFields. Optional id names the rule in the output."
          },
          "survivor": {
            "title": "Which row stays",
            "enum": [
              "first",
              "latest",
              "most_complete"
            ],
            "type": "string",
            "description": "first: earliest row read. latest: newest value in the date field below. most_complete: most filled fields, earliest row on a tie.",
            "default": "first"
          },
          "latestField": {
            "title": "Date field for 'latest'",
            "type": "string",
            "description": "Field with an ISO date or a Unix time. Needed when the latest row should stay."
          },
          "mergeEmptyFields": {
            "title": "Fill empty fields from duplicates",
            "type": "boolean",
            "description": "Empty fields of the kept row are filled from its duplicates. Existing values are never changed.",
            "default": false
          },
          "outputDuplicateGroups": {
            "title": "Write duplicate-group rows",
            "type": "boolean",
            "description": "Adds one row per group: its members and which rule joined them, and why.",
            "default": true
          },
          "defaultCountryCode": {
            "title": "Default phone country code",
            "type": "string",
            "description": "Calling code such as 49 or +1, for phone numbers written without one. Without it, such numbers only match each other."
          },
          "maxInputRows": {
            "title": "Maximum input rows",
            "minimum": 1,
            "maximum": 5000000,
            "type": "integer",
            "description": "Reading stops here and the result covers the rows read so far.",
            "default": 1000000
          },
          "maxInputMegabytes": {
            "title": "Maximum input size (MB)",
            "minimum": 1,
            "maximum": 4096,
            "type": "integer",
            "description": "Reading stops at this many megabytes of input.",
            "default": 1024
          },
          "maxRowKilobytes": {
            "title": "Maximum row size (KB)",
            "minimum": 1,
            "maximum": 5120,
            "type": "integer",
            "description": "Larger rows are counted as invalid and reported.",
            "default": 1024
          }
        }
      },
      "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
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}