{
  "openapi": "3.0.1",
  "info": {
    "title": "Dataset Filter & Transform: Filter, Pick, Rename, Flatten",
    "description": "Clean any Apify dataset without code: filter rows (equals, contains, regex, greater than, empty…), keep or drop columns, rename fields, flatten nested JSON, split list fields into rows, add tags. Chain it between a scraper and Google Sheets, CSV export or alerts.",
    "version": "0.0",
    "x-build-id": "hxJj94y0O4CTmaFa4"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/charlesmarkette~dataset-filter-transform-rename-flatten-fields/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-charlesmarkette-dataset-filter-transform-rename-flatten-fields",
        "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/charlesmarkette~dataset-filter-transform-rename-flatten-fields/runs": {
      "post": {
        "operationId": "runs-sync-charlesmarkette-dataset-filter-transform-rename-flatten-fields",
        "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/charlesmarkette~dataset-filter-transform-rename-flatten-fields/run-sync": {
      "post": {
        "operationId": "run-sync-charlesmarkette-dataset-filter-transform-rename-flatten-fields",
        "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": "One or more datasets to clean up, read in order (usually a scraper run's output). In an integration, use [\"{{resource.defaultDatasetId}}\"]. Leave empty to use 'Items' below instead."
          },
          "datasetIdList": {
            "title": "Dataset IDs (typed)",
            "type": "array",
            "description": "Optional. Dataset IDs (or username~dataset-name) typed by hand, one per line. Read after the picked datasets.",
            "items": {
              "type": "string"
            }
          },
          "items": {
            "title": "Items (instead of datasets)",
            "type": "array",
            "description": "Optional. A JSON list of objects to filter and transform, used only when no dataset is given above. Handy for quick tests and for calling this Actor from code."
          },
          "filters": {
            "title": "Filters",
            "type": "array",
            "description": "Keep only rows that match these conditions. Each condition is {\"field\", \"op\", \"value\"}. Ops: equals, notEquals, contains, notContains, startsWith, endsWith, regex, greaterThan, lessThan, greaterOrEqual, lessOrEqual, in, notIn (value: a list or \"a, b, c\"), and exists, notExists, isEmpty, isNotEmpty (no value). Dots reach nested fields (address.city); on a list, a condition matches if any element matches. Numbers and ISO dates compare as numbers and dates. Leave empty to keep every row."
          },
          "filterMode": {
            "title": "Filter mode",
            "enum": [
              "all",
              "any"
            ],
            "type": "string",
            "description": "How the filter conditions combine: all of them must match (AND), or at least one (OR).",
            "default": "all"
          },
          "caseSensitive": {
            "title": "Case-sensitive text matching",
            "type": "boolean",
            "description": "Off: 'ACME' equals 'acme'. A single condition can override this with \"caseSensitive\": true.",
            "default": false
          },
          "unwindField": {
            "title": "Split a list field into rows",
            "type": "string",
            "description": "Optional. A field holding a list (e.g. emails). Each element becomes its own row, with the other fields copied. Dots for nested fields."
          },
          "pickFields": {
            "title": "Keep only these fields",
            "type": "array",
            "description": "Optional. Output only these fields, in this order (handy for spreadsheet columns). Dots for nested fields; the column is then named 'address.city'. Empty = keep all.",
            "items": {
              "type": "string"
            }
          },
          "omitFields": {
            "title": "Remove these fields",
            "type": "array",
            "description": "Optional. Fields to drop. Dots for nested fields (images.thumbnail removes it from every image).",
            "items": {
              "type": "string"
            }
          },
          "renameFields": {
            "title": "Rename fields",
            "type": "object",
            "description": "Optional. {\"old name\": \"New Name\"}, applied in order. Renamed columns keep their position. Example: {\"title\": \"Company Name\", \"phone\": \"Phone Number\"}."
          },
          "flatten": {
            "title": "Flatten nested fields",
            "type": "boolean",
            "description": "Nested objects become columns like 'address.city'. Lists stay lists unless you join them below.",
            "default": false
          },
          "joinArrays": {
            "title": "Join lists into text",
            "type": "boolean",
            "description": "Lists of plain values (text, numbers) become one text value, e.g. [\"a\", \"b\"] → \"a, b\". Lists of objects are kept.",
            "default": false
          },
          "arrayJoiner": {
            "title": "List separator",
            "type": "string",
            "description": "Text placed between joined list elements.",
            "default": ", "
          },
          "addFields": {
            "title": "Add fields",
            "type": "object",
            "description": "Optional. Fixed values added to every row (overwriting a field with the same name), e.g. {\"source\": \"google-maps\", \"campaign\": \"october\"}."
          },
          "trimStrings": {
            "title": "Trim spaces",
            "type": "boolean",
            "description": "Remove leading and trailing whitespace from every text value.",
            "default": false
          },
          "emptyToNull": {
            "title": "Empty values to null",
            "type": "boolean",
            "description": "Empty text, empty lists and empty objects become null.",
            "default": false
          },
          "lowercaseFields": {
            "title": "Lowercase these fields",
            "type": "array",
            "description": "Optional. Output fields whose text is lowercased, e.g. email. Use the output name (after renaming).",
            "items": {
              "type": "string"
            }
          },
          "sortBy": {
            "title": "Sort by field",
            "type": "string",
            "description": "Optional. An output field name (after renaming). Numbers, dates and text sort naturally; empty values go last. Without 'Max results', sorting is limited to 200,000 rows."
          },
          "sortDesc": {
            "title": "Sort descending",
            "type": "boolean",
            "description": "Largest, latest or Z first.",
            "default": false
          },
          "maxResults": {
            "title": "Max results",
            "minimum": 1,
            "type": "integer",
            "description": "Optional cap on output rows."
          },
          "offset": {
            "title": "Skip first rows",
            "minimum": 0,
            "type": "integer",
            "description": "Optional. Skip this many output rows (after filtering and sorting) before writing. Skipped rows are free."
          }
        }
      },
      "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
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}