{
  "openapi": "3.0.1",
  "info": {
    "title": "Dataset Transformer — Filter, Dedupe, Sort & Reshape Data",
    "description": "Transform Apify datasets or JSON / CSV links: filter rows, remove duplicates, sort, flatten nested fields, unwind lists, pick and rename columns. Merge several datasets into one clean result for export as JSON, CSV or Excel. Part of NexGen Signal — data tools and official-source data products",
    "version": "0.1",
    "x-build-id": "tg7iiJbefXezYB4U6"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/nexgensignal~dataset-transformer-api/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-nexgensignal-dataset-transformer-api",
        "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/nexgensignal~dataset-transformer-api/runs": {
      "post": {
        "operationId": "runs-sync-nexgensignal-dataset-transformer-api",
        "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/nexgensignal~dataset-transformer-api/run-sync": {
      "post": {
        "operationId": "run-sync-nexgensignal-dataset-transformer-api",
        "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": "Source datasets",
            "minItems": 1,
            "type": "array",
            "description": "Apify datasets to read (merged in order). Pick them here so this run is allowed to read them."
          },
          "dataUrls": {
            "title": "Data links",
            "type": "array",
            "description": "Links to JSON (array, or an object holding one list), JSON Lines or CSV. Up to 100.",
            "items": {
              "type": "string"
            }
          },
          "rows": {
            "title": "Rows (pasted)",
            "type": "array",
            "description": "A JSON array of rows to transform, up to 100,000."
          },
          "rowsPath": {
            "title": "Rows path (JSON links)",
            "type": "string",
            "description": "Where the list of rows sits inside a JSON object, e.g. data.items. Empty = the array itself, or the object's only list of objects."
          },
          "unwind": {
            "title": "Unwind field",
            "type": "string",
            "description": "A list field to split into one row per element, e.g. tags or offers."
          },
          "flatten": {
            "title": "Flatten nested fields",
            "type": "boolean",
            "description": "Turn nested objects and lists into dot-named columns, e.g. properties.mag, tags.0.",
            "default": false
          },
          "filters": {
            "title": "Filters",
            "type": "array",
            "description": "Conditions like {\"field\": \"price\", \"op\": \"lt\", \"value\": 50}. op: eq, ne, gt, gte, lt, lte, contains, notContains, startsWith, endsWith, in, notIn, exists, notExists, empty, notEmpty, regex. Text matching ignores case unless \"caseSensitive\": true. Fields use dot paths.",
            "default": []
          },
          "filterMode": {
            "title": "Filter mode",
            "enum": [
              "all",
              "any"
            ],
            "type": "string",
            "description": "How several filters combine.",
            "default": "all"
          },
          "dedupeBy": {
            "title": "De-duplicate by",
            "type": "array",
            "description": "Keep the first row for each combination of these fields.",
            "default": [],
            "items": {
              "type": "string"
            }
          },
          "sortBy": {
            "title": "Sort by",
            "type": "string",
            "description": "Field to sort on (numbers sort as numbers). Rows without it go last."
          },
          "sortDescending": {
            "title": "Sort descending",
            "type": "boolean",
            "description": "Largest / latest first.",
            "default": false
          },
          "fields": {
            "title": "Output fields",
            "type": "array",
            "description": "Keep only these fields, in this order (dot paths allowed). Empty = all fields.",
            "default": [],
            "items": {
              "type": "string"
            }
          },
          "rename": {
            "title": "Rename fields",
            "type": "object",
            "description": "Old name -> new name, e.g. {\"properties.mag\": \"magnitude\"}.",
            "default": {}
          },
          "dropFields": {
            "title": "Drop fields",
            "type": "array",
            "description": "Remove these fields from the output.",
            "default": [],
            "items": {
              "type": "string"
            }
          },
          "offset": {
            "title": "Skip first rows",
            "minimum": 0,
            "maximum": 10000000,
            "type": "integer",
            "description": "Skip this many result rows (after sorting).",
            "default": 0
          },
          "maxRows": {
            "title": "Maximum output rows",
            "minimum": 1,
            "maximum": 2000000,
            "type": "integer",
            "description": "Stop after this many output rows. Each output row is billed.",
            "default": 100000
          },
          "maxInputRows": {
            "title": "Maximum input rows",
            "minimum": 1,
            "maximum": 2000000,
            "type": "integer",
            "description": "Read at most this many rows across all sources.",
            "default": 200000
          }
        }
      },
      "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
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}