{
  "openapi": "3.0.1",
  "info": {
    "title": "Dataset Filter & Transform",
    "description": "Filter rows by rule (AND/OR conditions, 14 operators) and transform them (rename, drop/keep fields, trim/case, computed fields, type casting, regex extraction) for any Apify dataset or JSON array, then download as CSV/Excel. No scraping, works on data you already have.",
    "version": "0.1",
    "x-build-id": "9c2tm8LtnAHPkyGIZ"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/nerolabs~dataset-filter-transform/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-nerolabs-dataset-filter-transform",
        "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/nerolabs~dataset-filter-transform/runs": {
      "post": {
        "operationId": "runs-sync-nerolabs-dataset-filter-transform",
        "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/nerolabs~dataset-filter-transform/run-sync": {
      "post": {
        "operationId": "run-sync-nerolabs-dataset-filter-transform",
        "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": {
          "datasetId": {
            "title": "Dataset to process",
            "type": "string",
            "description": "Pick an existing Apify dataset (for example the output of any scraper run). Use this OR 'Data (inline)' below, not both. Declaring it this way is what lets this Actor run with limited permissions: it may read the dataset you point at, and nothing else on your account."
          },
          "data": {
            "title": "Data (inline)",
            "type": "array",
            "description": "A JSON array of records to filter and transform, for ad-hoc data instead of a dataset ID."
          },
          "transforms": {
            "title": "Transform steps (applied in order, before filtering)",
            "type": "array",
            "description": "A list of steps applied to every row, top to bottom, before any filtering happens. Each step reads/writes top-level fields (dotted paths like 'address.city' can still be READ inside a template or expression, just not written directly). Steps: {\"op\":\"rename\",\"from\":\"a\",\"to\":\"b\"}, {\"op\":\"drop\",\"fields\":[\"a\"]}, {\"op\":\"keep\",\"fields\":[\"a\",\"b\"]} (keep only these, drop everything else), {\"op\":\"trim\"|\"uppercase\"|\"lowercase\",\"field\":\"a\"}, {\"op\":\"cast\",\"field\":\"a\",\"to\":\"number\"|\"string\"|\"boolean\"}, {\"op\":\"addField\",\"field\":\"c\",\"template\":\"{{a}} {{b}}\"} (string template, {{dotted.path}} placeholders), {\"op\":\"compute\",\"field\":\"c\",\"expression\":\"price * qty\",\"round\":2} (arithmetic +-*/ over numeric fields, dotted paths allowed as variable names), {\"op\":\"regexExtract\",\"field\":\"a\",\"pattern\":\"...\",\"flags\":\"i\",\"group\":1,\"into\":\"b\"} (defaults to overwriting 'field' if 'into' is omitted)."
          },
          "filters": {
            "title": "Filter conditions (applied after transforms)",
            "type": "array",
            "description": "Rows are kept only if they pass these conditions (combined per 'Combine filters with' below). Each item: {\"field\": \"revenue\", \"operator\": \"greaterOrEqual\", \"value\": 1000}. Operators: equals, notEquals, contains, notContains, startsWith, endsWith, greaterThan, lessThan, greaterOrEqual, lessOrEqual, isEmpty, isNotEmpty, matchesRegex (value = pattern), in, notIn (value = array). Leave empty to keep every row (transform-only mode). 'caseSensitive' can be set per-condition to override the global default below."
          },
          "filterCombineMode": {
            "title": "Combine filters with",
            "enum": [
              "AND",
              "OR"
            ],
            "type": "string",
            "description": "AND: a row must pass every condition. OR: a row passes if it matches any one condition.",
            "default": "AND"
          },
          "caseSensitiveFilters": {
            "title": "Case-sensitive filters by default",
            "type": "boolean",
            "description": "Off (default) treats 'US', 'us' and ' US ' as the same value for equals/contains/startsWith/endsWith/in, which is what scraped or hand-entered data usually needs. Turn on to require an exact, byte-for-byte match. Override per-condition with a 'caseSensitive' key on that condition.",
            "default": false
          },
          "lenientNumbers": {
            "title": "Lenient numbers",
            "type": "boolean",
            "description": "Read numbers stored as text, like '$1,234.50', '49 USD' or '(300)', as numbers for numeric filters, 'cast to number', and 'compute'. Scraped prices almost always need this. Turn off to only accept real numbers and plain numeric strings.",
            "default": true
          },
          "exportFormats": {
            "title": "Export file formats",
            "uniqueItems": true,
            "type": "array",
            "description": "Also save the kept, transformed rows as a real downloadable file in the run's key-value store. CSV opens anywhere; XLSX opens in Excel and Google Sheets with a bold, frozen header row.",
            "items": {
              "type": "string",
              "enum": [
                "csv",
                "xlsx"
              ],
              "enumTitles": [
                "CSV (.csv)",
                "Excel (.xlsx)"
              ]
            }
          },
          "maxItems": {
            "title": "Maximum input rows",
            "minimum": 1,
            "type": "integer",
            "description": "Stop loading after this many rows from the dataset (a cost guard for large datasets). There is a hard safety ceiling of 200,000 rows per run regardless."
          }
        }
      },
      "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
                  }
                }
              },
              "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
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}