{
  "openapi": "3.0.1",
  "info": {
    "title": "Kaggle Scraper",
    "description": "Scrape Kaggle datasets, competitions, notebooks, and user profiles. Datasets are open via the public API; competitions and notebooks need Kaggle API credentials.",
    "version": "1.0",
    "x-build-id": "2RI92AWXNHHP3k7Qc"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/crawlerbros~kaggle-scraper/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-crawlerbros-kaggle-scraper",
        "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/crawlerbros~kaggle-scraper/runs": {
      "post": {
        "operationId": "runs-sync-crawlerbros-kaggle-scraper",
        "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/crawlerbros~kaggle-scraper/run-sync": {
      "post": {
        "operationId": "run-sync-crawlerbros-kaggle-scraper",
        "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",
        "required": [
          "mode"
        ],
        "properties": {
          "mode": {
            "title": "Mode",
            "enum": [
              "search",
              "byDataset",
              "byCompetition",
              "byNotebook",
              "byUser",
              "trendingDatasets",
              "trendingNotebooks",
              "byUrl"
            ],
            "type": "string",
            "description": "What to fetch from Kaggle. Choose `search` for the most common case (free-text dataset search). Modes prefixed with `by` lookup specific records by ref/URL. Modes marked `(auth required)` need a Kaggle API token.",
            "default": "search"
          },
          "searchQuery": {
            "title": "Search query (mode=search / trendingNotebooks)",
            "type": "string",
            "description": "Free-text query (matches titles, descriptions, tags). Example: `titanic`, `covid`, `weather forecast`.",
            "default": "titanic"
          },
          "datasetRefs": {
            "title": "Dataset refs (mode=byDataset)",
            "type": "array",
            "description": "Kaggle dataset refs like `heptapod/titanic`, or full kaggle.com URLs.",
            "default": [],
            "items": {
              "type": "string"
            }
          },
          "competitionRefs": {
            "title": "Competition refs (mode=byCompetition)",
            "type": "array",
            "description": "Competition slugs like `titanic`. Requires Kaggle API credentials.",
            "default": [],
            "items": {
              "type": "string"
            }
          },
          "kernelRefs": {
            "title": "Notebook refs (mode=byNotebook)",
            "type": "array",
            "description": "Notebook refs like `alexisbcook/titanic-tutorial`. Requires Kaggle API credentials.",
            "default": [],
            "items": {
              "type": "string"
            }
          },
          "userSlugs": {
            "title": "User slugs (mode=byUser)",
            "type": "array",
            "description": "Kaggle usernames or profile URLs.",
            "default": [],
            "items": {
              "type": "string"
            }
          },
          "startUrls": {
            "title": "Start URLs (mode=byUrl)",
            "type": "array",
            "description": "Full kaggle.com URLs (datasets / competitions / notebooks / users) — kind auto-detected.",
            "default": [],
            "items": {
              "type": "string"
            }
          },
          "ownerSlug": {
            "title": "Owner slug filter",
            "type": "string",
            "description": "Constrain results to a specific user/org slug. Example: `heptapod`, `googleai`, `kaggle`."
          },
          "sortBy": {
            "title": "Sort by (datasets)",
            "enum": [
              "hottest",
              "votes",
              "updated",
              "active",
              "published"
            ],
            "type": "string",
            "description": "Server-side sort key for dataset search and listing.",
            "default": "hottest"
          },
          "fileType": {
            "title": "File type filter (datasets)",
            "enum": [
              "all",
              "csv",
              "sqlite",
              "json",
              "bigQuery"
            ],
            "type": "string",
            "description": "Constrain dataset results to a specific primary file type.",
            "default": "all"
          },
          "licenseGroup": {
            "title": "License family filter (datasets)",
            "enum": [
              "all",
              "cc",
              "gpl",
              "odb",
              "other"
            ],
            "type": "string",
            "description": "Constrain dataset results to a license family. Fine-grained licenses still appear in `licenseName`.",
            "default": "all"
          },
          "minVotes": {
            "title": "Min vote count (post-filter)",
            "minimum": 0,
            "maximum": 1000000,
            "type": "integer",
            "description": "Drop datasets with fewer votes than this."
          },
          "minDownloads": {
            "title": "Min download count (post-filter)",
            "minimum": 0,
            "maximum": 1000000000,
            "type": "integer",
            "description": "Drop datasets with fewer downloads than this."
          },
          "minUsability": {
            "title": "Min usability rating (0-1)",
            "minimum": 0,
            "maximum": 10,
            "type": "integer",
            "description": "Drop datasets below this usability rating (Kaggle 0-1 scale; values >1 clamped)."
          },
          "maxSizeBytes": {
            "title": "Max dataset size in bytes",
            "minimum": 0,
            "maximum": 10000000000000,
            "type": "integer",
            "description": "Drop datasets larger than this. Also forwarded to API as `maxSize`."
          },
          "kernelSortBy": {
            "title": "Sort by (notebooks)",
            "enum": [
              "hotness",
              "commentCount",
              "dateCreated",
              "dateRun",
              "scoreAscending",
              "scoreDescending",
              "viewCount",
              "voteCount"
            ],
            "type": "string",
            "description": "Sort key for notebook (kernel) listing.",
            "default": "hotness"
          },
          "kernelLanguage": {
            "title": "Notebook language",
            "enum": [
              "all",
              "python",
              "r",
              "sqlite",
              "julia"
            ],
            "type": "string",
            "description": "Filter notebooks by programming language.",
            "default": "all"
          },
          "kernelType": {
            "title": "Notebook kernel type",
            "enum": [
              "all",
              "script",
              "notebook"
            ],
            "type": "string",
            "description": "Filter notebooks by kernel type (script vs full notebook).",
            "default": "all"
          },
          "kaggleUsername": {
            "title": "Kaggle username (for competitions / notebooks)",
            "type": "string",
            "description": "Your Kaggle username (the `username` field in `kaggle.json`). Get a token at https://www.kaggle.com/settings -> API -> Create New Token. Only required for `byCompetition`, `byNotebook`, and `trendingNotebooks` modes."
          },
          "kaggleApiKey": {
            "title": "Kaggle API key (for competitions / notebooks)",
            "type": "string",
            "description": "Your Kaggle API key (the `key` field in `kaggle.json`). Only required for competition/notebook modes; stored as a secret."
          },
          "maxItems": {
            "title": "Max items",
            "minimum": 1,
            "maximum": 10000,
            "type": "integer",
            "description": "Hard cap on emitted records across all pages. The actor stops as soon as this many records have been pushed.",
            "default": 50
          }
        }
      },
      "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
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}