{
  "openapi": "3.0.1",
  "info": {
    "title": "Dataset Merge and JavaScript Deduplication",
    "description": "Merge platform Datasets, select distinct or repeated rows, and apply async JavaScript transformations with durable delivery receipts.",
    "version": "0.1",
    "x-build-id": "XQBNOA43KT85Qfilm"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/peerless_columbine~dataset-merge-js/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-peerless_columbine-dataset-merge-js",
        "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/peerless_columbine~dataset-merge-js/runs": {
      "post": {
        "operationId": "runs-sync-peerless_columbine-dataset-merge-js",
        "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/peerless_columbine~dataset-merge-js/run-sync": {
      "post": {
        "operationId": "run-sync-peerless_columbine-dataset-merge-js",
        "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": "Input Datasets or runs",
            "type": "array",
            "description": "Dataset IDs or names, or run IDs resolved to their default Datasets. Repeated inputs remain repeated.",
            "items": {
              "type": "string"
            }
          },
          "fields": {
            "title": "Identity fields",
            "type": "array",
            "description": "Literal property names for duplicate membership. Omit or leave empty to merge without deduplication.",
            "items": {
              "type": "string"
            }
          },
          "output": {
            "title": "Rows to deliver",
            "enum": [
              "unique-items",
              "duplicate-items",
              "nothing"
            ],
            "type": "string",
            "description": "Keep first occurrences, later duplicates, or inspect membership without output writes.",
            "default": "unique-items"
          },
          "mode": {
            "title": "Processing mode",
            "enum": [
              "dedup-after-load",
              "dedup-as-loading"
            ],
            "type": "string",
            "description": "Transform all loaded rows together, or transform and commit each source page.",
            "default": "dedup-after-load"
          },
          "outputDatasetId": {
            "title": "Destination Dataset",
            "type": "string",
            "description": "Append to this Dataset ID or name. Omit to use the run default Dataset."
          },
          "fieldsToLoad": {
            "title": "Projection",
            "type": "array",
            "description": "Optional source property projection. Include every property required by your transforms.",
            "items": {
              "type": "string"
            }
          },
          "preDedupTransformFunction": {
            "title": "Before deduplication",
            "type": "string",
            "description": "Async JavaScript expression evaluating to a function (items, context). Runs with Node and SDK privileges; not sandboxed."
          },
          "postDedupTransformFunction": {
            "title": "After deduplication",
            "type": "string",
            "description": "Async JavaScript row-array transform after selection. It may expand or change selected rows."
          },
          "actorOrTaskId": {
            "title": "History source",
            "type": "string",
            "description": "Actor or Task ID/name whose run default Datasets are added after explicit datasetIds."
          },
          "onlyRunsNewerThan": {
            "title": "History starts on or after",
            "type": "string",
            "description": "Inclusive run startedAt lower bound, as a date or timestamp."
          },
          "onlyRunsOlderThan": {
            "title": "History starts on or before",
            "type": "string",
            "description": "Inclusive run startedAt upper bound, as a date or timestamp. Date-only values mean midnight, not end of day."
          },
          "outputTo": {
            "title": "Output storage",
            "enum": [
              "dataset",
              "key-value-store"
            ],
            "type": "string",
            "description": "Append rows to one Dataset, or store complete arrays in OUTPUT-* KVS records.",
            "default": "dataset"
          },
          "parallelLoads": {
            "title": "Concurrent source reads",
            "maximum": 100,
            "type": "integer",
            "description": "Source pages fetched concurrently. Commit order remains deterministic. Nonpositive values request all finite planned pages.",
            "default": 10
          },
          "parallelPushes": {
            "title": "Concurrent output writes",
            "minimum": 1,
            "maximum": 50,
            "type": "integer",
            "description": "More than one permits parallel appends and does not promise backend row order. Supplied values above one become one in as-loading mode.",
            "default": 5
          },
          "uploadBatchSize": {
            "title": "Rows per upload slice",
            "minimum": 10,
            "maximum": 1000,
            "type": "integer",
            "description": "UI/schema default is 500. A raw input omitting this field uses runtime 1000. Byte-size splitting may create smaller writes.",
            "default": 500
          },
          "batchSizeLoad": {
            "title": "Rows per source page",
            "type": "integer",
            "description": "Positive page size. In as-loading mode supplied values are normalized against supplied uploadBatchSize before runtime defaults.",
            "default": 50000
          },
          "offset": {
            "title": "Starting source row",
            "type": "integer",
            "description": "Applied independently per Dataset by default. Select combined slicing to count across concatenated inputs."
          },
          "limit": {
            "title": "Maximum source rows",
            "type": "integer",
            "description": "Per Dataset by default; combined makes this a single limit over the ordered input plan. Applies before transforms."
          },
          "verboseLog": {
            "title": "Progress logging",
            "type": "boolean",
            "description": "Log source ranges and acknowledged output chunks without printing row bodies.",
            "default": false
          },
          "nullAsUnique": {
            "title": "Keep null/missing identities distinct",
            "type": "boolean",
            "description": "A null or missing identity component gives each occurrence a distinct internal identity, without random-string collisions.",
            "default": false
          },
          "datasetIdsOfFilterItems": {
            "title": "Membership-only Datasets",
            "type": "array",
            "description": "Loaded first to seed duplicate membership. After-load skips filter transforms; as-loading applies its pre transform to filter pages.",
            "items": {
              "type": "string"
            }
          },
          "customInputData": {
            "title": "Transform data",
            "type": "object",
            "description": "JSON object exposed unchanged as context.customInputData."
          },
          "appendDatasetIds": {
            "title": "Attach source Dataset ID",
            "type": "boolean",
            "description": "Add __datasetId__ to source rows before transforms.",
            "default": false
          },
          "slicingScope": {
            "title": "Slicing scope",
            "enum": [
              "per-dataset",
              "combined"
            ],
            "type": "string",
            "description": "per-dataset preserves each input’s offset/limit. combined slices the concatenated ordered inputs.",
            "default": "per-dataset"
          }
        }
      },
      "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
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}