canonical: https://jentic.com/apis/kaggle.com/kaggle

# Kaggle API

Jentic publishes the only available OpenAPI specification for Kaggle API, keeping it validated and agent-ready. The Kaggle API gives programmatic access to Kaggle competitions, datasets, notebooks (kernels), and models. Across 25 endpoints it lists and downloads competition data and submissions, manages datasets and dataset versions, pushes and pulls kernels, retrieves kernel outputs and execution status, and creates or updates models. Authentication uses HTTP Basic with the Kaggle username and API key, the same credentials produced by the official Kaggle CLI.

## For AI agents

Drive Kaggle competitions, datasets, notebooks (kernels), and models from code: list, download, submit, push, and pull resources via 25 REST endpoints.

## Scope

Does not handle Kaggle Discussions, user account administration, or paid model hosting - use for competition, dataset, kernel, and model resource management only.

## Capabilities

- List and download competition data files and submit predictions through /competitions/* endpoints
- View and download competition leaderboards via `/competitions/{id}/leaderboard/view` and /download
- List, download, create, version, and delete datasets through /datasets/* endpoints
- Push and pull kernels (notebooks), inspect their execution status, and retrieve their outputs via /kernels/* endpoints
- List, retrieve, create, update, and delete models through /models/* endpoints
- Inspect dataset metadata before downloading large archives with GET `/datasets/view/{ownerSlug}/{datasetSlug}`

## Use cases

### Automated Competition Submission Loop

ML engineers training models for an active competition need a tight loop that submits the latest predictions and reads the resulting leaderboard position. POST `/competitions/submissions/submit/{id}` uploads the predictions file and GET `/competitions/{id}/leaderboard/view` returns the current ranking. This replaces dragging files into the web UI on every iteration.

Example prompt: After each training run, call POST `/competitions/submissions/submit/{competition_id}` with the predictions file and GET `/competitions/{competition_id}/leaderboard/view` to log the new rank.

### Dataset Versioning Pipeline

Teams publishing reusable datasets on Kaggle script the version bump rather than uploading manually. POST `/datasets/create/version/{ownerSlug}/{datasetSlug}` pushes a new version with a changelog message, while GET `/datasets/view/{ownerSlug}/{datasetSlug}` confirms metadata. CI then validates schema and triggers downstream notebooks.

Example prompt: After data validation passes, call POST `/datasets/create/version/{ownerSlug}/{datasetSlug}` with the new files and a versionNotes message.

### Kernel-Based Reproducible Reports

Analytics teams using Kaggle kernels (notebooks) for shareable reports use POST `/kernels/push` to upload a new version, GET `/kernels/status/{ownerSlug}/{kernelSlug}` to wait for execution, and GET `/kernels/output/{ownerSlug}/{kernelSlug}` to retrieve charts and CSVs once the run completes. This keeps the reporting cycle reproducible and auditable.

Example prompt: Call POST `/kernels/push` with the notebook payload, poll GET `/kernels/status/{ownerSlug}/{kernelSlug}` until status is 'complete', then call GET `/kernels/output/{ownerSlug}/{kernelSlug}.`

### Agent-Driven Competition Research

An AI assistant exploring a problem space can list competitions, pull a relevant dataset, and start a notebook run via Jentic. The agent searches 'list Kaggle competitions', loads `/competitions/list`, and chains to `/datasets/download/{ownerSlug}/{datasetSlug}` for the underlying data. This puts a full ML research kickoff behind a chat prompt.

Example prompt: Through Jentic, search 'list active Kaggle competitions', call GET `/competitions/list`, pick a relevant competition, then call GET `/competitions/data/list/{competition_id}.`

## Key endpoints

| Method | Path | Description |
| --- | --- | --- |
| GET | `/competitions/list` | List competitions |
| POST | `/competitions/submissions/submit/{id}` | Submit predictions to a competition |
| GET | `/competitions/{id}/leaderboard/view` | View competition leaderboard |
| GET | `/datasets/download/{ownerSlug}/{datasetSlug}` | Download a dataset |
| POST | `/datasets/create/new` | Create a new dataset |
| POST | `/datasets/create/version/{ownerSlug}/{datasetSlug}` | Create a dataset version |
| POST | `/kernels/push` | Push a kernel |
| GET | `/kernels/status/{ownerSlug}/{kernelSlug}` | Get kernel execution status |

## Key resources

- **Competitions** — List competitions, download data, submit predictions, and view leaderboards
- **Datasets** — List, download, create, version, and delete datasets
- **Kernels** — Push and pull notebooks, retrieve outputs, and check execution status
- **Models** — List, retrieve, create, update, and delete models

## Why Jentic

- **Setup:** Wiring the Kaggle API by hand means learning its basic auth from username and key, navigating competition, dataset, kernel, and model surfaces, and threading owner and dataset slugs through each call yourself. Through Jentic you install once, import the Kaggle API from the API Directory, store the credentials once, and your agent calls it.
- **Permission scoping:** Kaggle puts the owner and dataset slugs in the URL path (`/datasets/download/{ownerSlug}/{datasetSlug}`), so a rule can pin your agent to one dataset: it can download or version that dataset and nothing else. You choose the operations it may call, so ones like submitting to a competition or pushing a kernel are not included unless you add them.
- **Credential handling:** Your Kaggle username and API key are stored once, encrypted, by your own Jentic One instance and injected at execution time. They never enter the agent's prompt, logs, or context.
- **Discovery method:** Agents search Jentic by intent such as 'download a Kaggle dataset' or 'submit predictions to a competition', and Jentic returns the matching Kaggle operation with its input schema so the agent calls the right endpoint without browsing the reference docs.

## Related APIs

- **Hugging Face Hub API** — Hub for datasets, models, and inference with broader generative-AI focus than Kaggle.
- **Comet API** — Experiment tracking that pairs with Kaggle competition submissions and kernels.
- **GitHub API** — GitHub holds the training code that produces submissions to Kaggle competitions.

## FAQ

### Why is there no official OpenAPI spec for Kaggle API?

Kaggle does not publish an OpenAPI specification (the official integration is the Kaggle CLI). Jentic generates and maintains this spec so that AI agents and developers can call Kaggle API via structured tooling. It is validated against the live API and kept up to date. Get started with Jentic One, the self-hosted execution layer.

### What authentication does the Kaggle API use?

The Kaggle API uses HTTP Basic authentication with your Kaggle username and API key (the same credentials downloaded from the Account page as kaggle.json). Through Jentic these credentials sit in the encrypted vault and are injected at request time.

### Can I submit predictions to a competition with the Kaggle API?

Yes. POST `/competitions/submissions/submit/{id}` uploads a predictions file to the named competition, and GET `/competitions/submissions/list/{id}` lists prior submissions. The leaderboard is then available via GET `/competitions/{id}/leaderboard/view.`

### What are the rate limits for the Kaggle API?

Kaggle does not document strict per-endpoint rate limits in the spec but throttles abusive usage. Treat 429 responses with exponential backoff and avoid tight polling on `/kernels/status/{ownerSlug}/{kernelSlug}.`

### How do I download a Kaggle dataset through Jentic?

Search Jentic for 'download a Kaggle dataset', load GET `/datasets/download/{ownerSlug}/{datasetSlug}`, and execute with the owner and dataset slugs. Jentic resolves Basic auth and streams the dataset archive.

### Can I push and run a notebook (kernel) on Kaggle?

Yes. POST `/kernels/push` uploads a kernel, GET `/kernels/status/{ownerSlug}/{kernelSlug}` reports execution status, and GET `/kernels/output/{ownerSlug}/{kernelSlug}` returns the produced files once the run completes.

### Can I limit what my agent is allowed to do with the Kaggle API?

Yes. Because you run Jentic One yourself, your own rules decide which Kaggle operations and credentials the agent may use. Since Kaggle puts the owner and dataset slugs in the URL path, such as GET `/datasets/download/{ownerSlug}/{datasetSlug}`, you can pin the agent to a single dataset so it downloads or versions that one and nothing else. You also choose the exact operations it may call, so higher-impact actions like POST `/competitions/submissions/submit/{id}` or POST `/kernels/push` stay off unless you add them.
