SKILL.md
Kaggle API Guide
Overview
Kaggle is the world's largest data science and machine learning community, hosting thousands of datasets, competitions, and computational notebooks. The Kaggle API provides programmatic access to these resources, enabling researchers to download datasets, submit competition entries, manage kernels (notebooks), and explore the Kaggle ecosystem from the command line or scripts.
For academic researchers, Kaggle is a valuable resource for accessing curated, well-documented datasets across diverse domains including healthcare, natural language processing, computer vision, economics, and social sciences. Many published research papers use Kaggle datasets as benchmarks, and the platform's competition infrastructure provides standardized evaluation frameworks for comparing methods.
The Kaggle API is available as a Python CLI tool and library. It requires a free Kaggle account and API token for authentication. The API supports dataset search and download, competition data retrieval, kernel management, and model access.
Authentication
A free Kaggle API token is required. Generate one from your Kaggle account settings at https://www.kaggle.com/settings.
Download the kaggle.json credentials file and place it in the standard location:
# The kaggle.json file should be at ~/.kaggle/kaggle.json
# It contains your username and key from your Kaggle account settings
mkdir -p ~/.kaggle
# Move your downloaded kaggle.json to ~/.kaggle/kaggle.json
chmod 600 ~/.kaggle/kaggle.json
Alternatively, use environment variables:
export KAGGLE_USERNAME=$KAGGLE_USERNAME
export KAGGLE_KEY=$KAGGLE_KEY
Install the CLI tool:
pip install kaggle
Core Endpoints
Search Datasets
Find datasets by keyword, file type, or license.
# Search for datasets
kaggle datasets list -s "climate change" --sort-by votes
# Search with specific criteria
kaggle datasets list -s "medical imaging" --file-type csv --max-size 1000000
