{
  "openapi": "3.0.1",
  "info": {
    "title": "Dataset Transformer: Filter, Dedupe, JSON to CSV",
    "description": "Clean, flatten and deduplicate data: Apify datasets, pasted JSON, JSONL, CSV, Excel (.xlsx) and public Google Sheets. Filter rows, remove duplicates, and keep only new rows across runs. $0.0001 per row saved, same price on every plan. Removed rows and failed files are free.",
    "version": "1.0",
    "x-build-id": "G0dSvrY4PYn0dnNf7"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/tidybytetools~json-to-csv-flattener/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-tidybytetools-json-to-csv-flattener",
        "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/tidybytetools~json-to-csv-flattener/runs": {
      "post": {
        "operationId": "runs-sync-tidybytetools-json-to-csv-flattener",
        "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/tidybytetools~json-to-csv-flattener/run-sync": {
      "post": {
        "operationId": "run-sync-tidybytetools-json-to-csv-flattener",
        "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": {
          "fileUrls": {
            "title": "File or Sheet links",
            "type": "array",
            "description": "Links to .json, .jsonl, .csv or Excel (.xlsx) files, or a public Google Sheets share link (set to 'Anyone with the link can view'). You can also paste data or pick a dataset below.",
            "items": {
              "type": "string"
            }
          },
          "jsonText": {
            "title": "Or paste JSON, JSONL or CSV",
            "type": "string",
            "description": "Paste JSON, JSON Lines or CSV."
          },
          "separator": {
            "title": "Column name separator",
            "type": "string",
            "description": "Provide Column name separator for this run. Used as input for: Convert JSON to CSV.",
            "default": "."
          },
          "arrays": {
            "title": "Lists",
            "enum": [
              "join",
              "index",
              "json"
            ],
            "type": "string",
            "description": "How to put lists in cells.",
            "default": "join"
          },
          "csvDelimiter": {
            "title": "CSV delimiter",
            "enum": [
              "comma",
              "semicolon",
              "tab"
            ],
            "type": "string",
            "description": "Use semicolon for Excel in many EU countries.",
            "default": "comma"
          },
          "datasetIds": {
            "title": "Dataset from another run",
            "type": "array",
            "description": "Optional. Pick the dataset of another Apify run (for example a scraper's results), or paste its ID. This tool only reads it. Up to 200,000 items per dataset."
          },
          "filterRules": {
            "title": "Keep only rows that match",
            "type": "array",
            "description": "Optional. One rule per line. A row is kept only if it matches every rule. Use the CSV column name, like: price > 10, country = US, email contains @, phone not empty. Words you can use: =, !=, >, >=, <, <=, contains, not contains, empty, not empty.",
            "default": [],
            "items": {
              "type": "string"
            }
          },
          "removeDuplicates": {
            "title": "Remove duplicate rows",
            "type": "boolean",
            "description": "Drop rows that are the same as an earlier row (in any file of this run). Removed rows are not charged.",
            "default": false
          },
          "dedupeColumns": {
            "title": "Duplicate check columns",
            "type": "array",
            "description": "Optional. Only compare these columns when looking for duplicates, like url or email. Leave empty to compare the whole row. Not case-sensitive.",
            "default": [],
            "items": {
              "type": "string"
            }
          },
          "keepOnlyNew": {
            "title": "Keep only new rows",
            "type": "boolean",
            "description": "When on, this run remembers the rows it saved, and later runs with the same memory name skip those rows. Skipped rows are free. Uses the Duplicate check columns, or the whole row if those are empty.",
            "default": false
          },
          "memoryName": {
            "title": "Memory name",
            "type": "string",
            "description": "Name of the saved list of seen rows, like my-leads. Letters, digits and hyphens, at most 63 characters. Used when Keep only new rows is on. If you leave this empty, the name dataset-transformer-seen is used."
          },
          "resetMemory": {
            "title": "Reset memory",
            "type": "boolean",
            "description": "When on, forget rows saved under this memory name and start over. Only used when Keep only new rows is on.",
            "default": false
          }
        }
      },
      "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
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}