{
  "openapi": "3.0.1",
  "info": {
    "title": "Merge & Dedup Datasets - Only New Items, Filter, Transform",
    "description": "Merge any number of datasets into one clean list: remove duplicates by any field (smart URL matching), return only items that are new since the last run, filter rows and pick/rename columns. Streams millions of rows.",
    "version": "0.1",
    "x-build-id": "qptmU36GwzufK0qu0"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/radarweb~dataset-merge-dedup/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-radarweb-dataset-merge-dedup",
        "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/radarweb~dataset-merge-dedup/runs": {
      "post": {
        "operationId": "runs-sync-radarweb-dataset-merge-dedup",
        "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/radarweb~dataset-merge-dedup/run-sync": {
      "post": {
        "operationId": "run-sync-radarweb-dataset-merge-dedup",
        "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 to merge",
            "type": "array",
            "description": "IDs or names of the datasets to read, in order. Paste the dataset ID from any previous run (Storage → Datasets). Pick a dataset (ID or name). Leave empty to try it with built-in sample data."
          },
          "deduplicate": {
            "title": "Remove duplicates",
            "type": "boolean",
            "description": "Keep only the first occurrence of each item.",
            "default": true
          },
          "dedupFields": {
            "title": "Duplicate key fields",
            "type": "array",
            "description": "Fields that identify a duplicate, e.g. url or email. Supports nested paths like address.city. Leave empty to compare whole items.",
            "default": [],
            "items": {
              "type": "string"
            }
          },
          "onlyNewSinceLastRun": {
            "title": "Only new items (remember previous runs)",
            "type": "boolean",
            "description": "Skip items already delivered in earlier runs of this Actor with the same memory name. Perfect for scheduled monitoring: each run returns only what is new.",
            "default": false
          },
          "stateKey": {
            "title": "Memory name",
            "type": "string",
            "description": "Use a different name per project (e.g. 'rome-restaurants'). Stored in the key-value store 'dedup-memory' in your account; delete it to start fresh.",
            "default": "default"
          },
          "normalizeUrls": {
            "title": "Smart URL matching",
            "type": "boolean",
            "description": "Treat http/https, www., trailing slashes and utm_/gclid/fbclid parameters as the same URL.",
            "default": true
          },
          "caseSensitive": {
            "title": "Case-sensitive matching",
            "type": "boolean",
            "description": "By default 'ACME Inc' and 'acme inc' are duplicates. Turn on to treat them as different.",
            "default": false
          },
          "filters": {
            "title": "Filters",
            "type": "array",
            "description": "Keep only rows matching these conditions. Each: {\"field\": \"price\", \"operator\": \"lt\", \"value\": 100}. Operators: eq, ne, contains, notContains, exists, notExists, gt, gte, lt, lte, regex, in.",
            "default": []
          },
          "filterMode": {
            "title": "Filter mode",
            "enum": [
              "all",
              "any"
            ],
            "type": "string",
            "description": "'all' = every condition must match (AND). 'any' = at least one (OR).",
            "default": "all"
          },
          "fields": {
            "title": "Keep only these fields",
            "type": "array",
            "description": "Leave empty to keep all fields.",
            "default": [],
            "items": {
              "type": "string"
            }
          },
          "omitFields": {
            "title": "Remove these fields",
            "type": "array",
            "description": "Fields to drop from the output.",
            "default": [],
            "items": {
              "type": "string"
            }
          },
          "renameFields": {
            "title": "Rename fields",
            "type": "object",
            "description": "Map of old name → new name, e.g. {\"title\": \"name\"}.",
            "default": {}
          },
          "addSourceField": {
            "title": "Add source dataset column",
            "type": "string",
            "description": "If set (e.g. _source), each row gets a column with the dataset it came from."
          },
          "maxItems": {
            "title": "Max output items",
            "minimum": 0,
            "type": "integer",
            "description": "Stop after writing this many items. 0 = no limit.",
            "default": 0
          },
          "outputDatasetName": {
            "title": "Output dataset name (optional)",
            "type": "string",
            "description": "Write to a named dataset instead of the run's default dataset — handy for building one master list across many runs."
          }
        }
      },
      "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
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}