{
  "openapi": "3.0.1",
  "info": {
    "title": "Dataset Deduplicate & Merge (Fuzzy)",
    "description": "Merge multiple Apify datasets or CSV/JSON/XLSX files and remove duplicates with normalised or fuzzy matching. Only-new mode returns just items you have not seen before.",
    "version": "0.1",
    "x-build-id": "ziuAVXbzTvVfIrlSD"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/larchrow~dataset-dedupe-merge-fuzzy/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-larchrow-dataset-dedupe-merge-fuzzy",
        "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/larchrow~dataset-dedupe-merge-fuzzy/runs": {
      "post": {
        "operationId": "runs-sync-larchrow-dataset-dedupe-merge-fuzzy",
        "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/larchrow~dataset-dedupe-merge-fuzzy/run-sync": {
      "post": {
        "operationId": "run-sync-larchrow-dataset-dedupe-merge-fuzzy",
        "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",
            "type": "array",
            "description": "Apify datasets to merge (IDs or names). Read in order; earlier datasets win with mergeStrategy=first."
          },
          "sourceUrls": {
            "title": "JSON/CSV URLs",
            "type": "array",
            "description": "Optional public JSON, JSONL, CSV or XLSX files to merge in.",
            "items": {
              "type": "object",
              "required": [
                "url"
              ],
              "properties": {
                "url": {
                  "type": "string",
                  "title": "URL of a web page",
                  "format": "uri"
                }
              }
            }
          },
          "items": {
            "title": "Inline items",
            "type": "array",
            "description": "Optional items passed directly."
          },
          "fields": {
            "title": "Dedupe key fields",
            "type": "array",
            "description": "Fields forming the key, dot paths allowed. Optional normaliser after a colon: exact, text, url, phone, email, company. Example: website:url or name:company, city:text. Empty = whole item.",
            "items": {
              "type": "string"
            }
          },
          "normalize": {
            "title": "Default normaliser",
            "enum": [
              "exact",
              "text",
              "url",
              "phone",
              "email",
              "company"
            ],
            "type": "string",
            "description": "Default normaliser.",
            "default": "text"
          },
          "mergeStrategy": {
            "title": "Merge strategy",
            "enum": [
              "first",
              "last",
              "most-complete",
              "fill",
              "fill-and-combine"
            ],
            "type": "string",
            "description": "first/last keep one item; most-complete keeps the duplicate with the most filled fields; fill fills empty fields from duplicates; fill-and-combine also unions list fields.",
            "default": "first"
          },
          "fuzzyField": {
            "title": "Fuzzy field (optional)",
            "type": "string",
            "description": "e.g. name:company – near-identical values (typos, punctuation) are merged. Different words such as other city names are never merged."
          },
          "fuzzyThreshold": {
            "title": "Fuzzy threshold",
            "type": "string",
            "description": "Fuzzy threshold.",
            "default": "0.92"
          },
          "onlyNewAcrossRuns": {
            "title": "Only new items across runs",
            "type": "boolean",
            "description": "Remembers keys in a named key-value store and outputs only items never seen in earlier runs (monitoring).",
            "default": false
          },
          "stateKey": {
            "title": "State store name",
            "type": "string",
            "description": "State store name.",
            "default": "dedupe-merge-state"
          },
          "skipEmptyKeys": {
            "title": "Items with empty key are kept unmerged",
            "type": "boolean",
            "description": "Items with empty key are kept unmerged.",
            "default": true
          },
          "keepEmptyKeyItems": {
            "title": "Keep items with empty key",
            "type": "boolean",
            "description": "Keep items with empty key.",
            "default": true
          },
          "addSourceField": {
            "title": "Add __source field",
            "type": "boolean",
            "description": "Add __source field.",
            "default": true
          },
          "addDupeCount": {
            "title": "Add __dupes count",
            "type": "boolean",
            "description": "Add __dupes count.",
            "default": true
          },
          "renameFields": {
            "title": "Rename fields",
            "type": "object",
            "description": "e.g. {\"Firma\":\"company\"}. Applied before dedupe, so key fields use the new names.",
            "default": {}
          },
          "fieldsToKeep": {
            "title": "Keep only these fields",
            "type": "array",
            "description": "Output only these fields (after renaming). Empty = all.",
            "items": {
              "type": "string"
            }
          },
          "fieldsToDrop": {
            "title": "Drop fields",
            "type": "array",
            "description": "Drop fields.",
            "items": {
              "type": "string"
            }
          },
          "requiredFields": {
            "title": "Required fields",
            "type": "array",
            "description": "Items where any of these is empty are dropped.",
            "items": {
              "type": "string"
            }
          }
        }
      },
      "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
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}