{
  "openapi": "3.0.1",
  "info": {
    "title": "Merge, Deduplicate & Transform Datasets",
    "description": "Combines datasets from your actor runs into one, without duplicates. Match rows on any fields exactly, ignoring case, as URLs without tracking parameters or by similar text, then filter rows, rename fields and flatten nested objects.",
    "version": "0.1",
    "x-build-id": "r3l2feNU3m65ArVNT"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/deriverge~dataset-merge-deduplicate/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-deriverge-dataset-merge-deduplicate",
        "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/deriverge~dataset-merge-deduplicate/runs": {
      "post": {
        "operationId": "runs-sync-deriverge-dataset-merge-deduplicate",
        "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/deriverge~dataset-merge-deduplicate/run-sync": {
      "post": {
        "operationId": "run-sync-deriverge-dataset-merge-deduplicate",
        "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": "Datasets",
            "type": "array",
            "description": "Datasets to merge, in this order: pick them from your storage or enter dataset IDs or names such as username~my-dataset. The actor may read only the datasets listed here. In an integration of another actor or task, enter {{resource.defaultDatasetId}} to merge the dataset of the run that finished."
          },
          "dedupeFields": {
            "title": "Deduplicate by fields",
            "type": "array",
            "description": "Rows with the same values in all of these fields are duplicates. Use dot notation for nested fields, such as company.name. Enter * to compare whole rows. Leave it empty to merge without removing duplicates. Rows where all of these fields are empty are always kept.",
            "items": {
              "type": "string"
            }
          },
          "matchMode": {
            "title": "Match values",
            "enum": [
              "exact",
              "trimmed",
              "caseInsensitive"
            ],
            "type": "string",
            "description": "How text values are compared. Numbers match their text form, so 42 and \"42\" are the same.",
            "default": "exact"
          },
          "normalizeUrls": {
            "title": "Treat URL variants as the same",
            "type": "boolean",
            "description": "Values that are web addresses match when they differ only in http or https, www., a trailing slash, a #fragment, the order of query parameters, or tracking parameters such as utm_source, gclid, fbclid and msclkid.",
            "default": false
          },
          "urlParamsToRemove": {
            "title": "More URL parameters to ignore",
            "type": "array",
            "description": "Extra query parameters that do not change the page on your sites, such as ref or source. Used with Treat URL variants as the same.",
            "items": {
              "type": "string"
            }
          },
          "fuzzyField": {
            "title": "Similar text field",
            "type": "string",
            "description": "A text field compared by similarity instead of exact match, such as title or name. With Deduplicate by fields filled in, those fields must match exactly and this one only needs to be similar: same company, similar job title."
          },
          "fuzzyThreshold": {
            "title": "Similarity threshold",
            "minimum": 0.5,
            "maximum": 1,
            "type": "number",
            "description": "From 0.5 to 1. At 0.85, \"Senior Software Engineer\" and \"Senior Software Engineer (Remote)\" match (0.87) while \"iPhone 15 Pro 128GB\" and \"iPhone 15 Pro 256GB\" do not (0.80). Letter case, accents and punctuation are ignored.",
            "default": 0.85
          },
          "keep": {
            "title": "Keep",
            "enum": [
              "first",
              "last"
            ],
            "type": "string",
            "description": "Which copy stays. Datasets are read in the order of Datasets, so Last keeps the copy from the latest dataset, for example the newest run. Last reads the datasets twice.",
            "default": "first"
          },
          "outputMode": {
            "title": "Output",
            "enum": [
              "unique",
              "duplicates"
            ],
            "type": "string",
            "description": "Unique rows is the merged result. Only the duplicates writes the rows that would be removed, to check what the settings do.",
            "default": "unique"
          },
          "filters": {
            "title": "Keep only rows where",
            "type": "array",
            "description": "One condition per line: field, condition, value. Conditions: exists, not exists, = (or equals), !=, contains, not contains, >, >=, <, <=. Examples: price > 100, title contains engineer, email exists, postedAt >= 2026-10-01. Text is compared ignoring letter case; dates in the form 2026-10-01 compare as dates.",
            "items": {
              "type": "string"
            }
          },
          "filterMode": {
            "title": "Rows must match",
            "enum": [
              "all",
              "any"
            ],
            "type": "string",
            "description": "With several conditions: all of them, or at least one.",
            "default": "all"
          },
          "outputFields": {
            "title": "Fields to keep",
            "type": "array",
            "description": "Write only these fields, in this order. Nested fields such as company.name keep their nesting. Empty keeps every field.",
            "items": {
              "type": "string"
            }
          },
          "omitFields": {
            "title": "Fields to remove",
            "type": "array",
            "description": "Fields left out of the output, such as long descriptions or HTML.",
            "items": {
              "type": "string"
            }
          },
          "renameFields": {
            "title": "Rename fields",
            "type": "array",
            "description": "Old field name and new field name. Over the API this can also be an object such as {\"title\": \"jobTitle\"}.",
            "items": {
              "type": "object",
              "required": [
                "key",
                "value"
              ],
              "properties": {
                "key": {
                  "type": "string",
                  "title": "Key"
                },
                "value": {
                  "type": "string",
                  "title": "Value"
                }
              }
            }
          },
          "flatten": {
            "title": "Flatten nested objects",
            "type": "boolean",
            "description": "Turns {\"company\": {\"name\": \"Acme\"}} into {\"company.name\": \"Acme\"}, one column per value in CSV and Excel. Lists stay as lists.",
            "default": false
          },
          "flattenSeparator": {
            "title": "Separator for flattened names",
            "type": "string",
            "description": "Character between the parts of a flattened field name, such as . or _.",
            "default": "."
          },
          "addSourceDataset": {
            "title": "Add the source dataset ID",
            "type": "boolean",
            "description": "Adds sourceDatasetId to every row, the dataset the row came from.",
            "default": false
          },
          "maxItems": {
            "title": "Maximum output rows",
            "minimum": 0,
            "type": "integer",
            "description": "Stop after writing this many rows. Leave it empty or 0 for no limit."
          }
        }
      },
      "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
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}