Kaggle Notebook API Documentation
The Kaggle Notebook API returns one public Kaggle notebook by its ref or link: its title, author, language, type, votes, views, forks, comments, medal, tags, version count and, when Kaggle has them, its best public score, the notebook it was copied from and its collaborators.
It also returns the notebook's latest run, with its status, runtime, accelerator and has_internet flag, the files that run wrote, and the competitions, datasets, notebook outputs and models the notebook reads. Each source carries the id Kaggle uses for it, so a dataset's dataset_id or a competition's competition_id can be used to look further. Kaggle lists at most 500 output files for a run. A notebook that does not exist, is private or was deleted returns an error.
API Parameters
Notebook
-
- Name
-
notebook_id - Required
- Required
- Description
-
Parameter defines the notebook to look up: its ref, the author's username and the notebook's slug, such as
alexisbcook/titanic-tutorial, or its link on kaggle.com, such ashttps://www.kaggle.com/code/alexisbcook/titanic-tutorial. Thenotebook_idof a notebook source indata_sourcesworks here too. The notebook's latest version is returned. A notebook its author renamed is returned under its new ref.
Engine
-
- Name
-
engine - Required
- Required
- Description
-
Parameter defines an engine that will be used to retrieve real-time data. It must be set to
kaggle_notebook.
API key
-
- Name
-
api_key - Required
- Required
- Description
-
The
api_keyauthenticates your requests. Use it as a query parameter (https://www.searchapi.io/api/v1/search?api_key=YOUR_API_KEY) or in the Authorization header (Bearer YOUR_API_KEY).
Zero Data Retention
-
- Name
-
zero_retention - Enterprise Only
- Enterprise Only
- Required
- Optional
- Description
-
Set this parameter to
trueto disable all logging and persistent storage. No request parameters, HTML, or JSON responses are stored or logged. Suitable for high-compliance use cases. Debugging and support may be limited while enabled.
API Examples
Full Response
https://www.searchapi.io/api/v1/search?engine=kaggle_notebook¬ebook_id=alexisbcook%2Ftitanic-tutorial
- Python
- Node
- Ruby
- Java
- Go
- PHP
- Bash
- R
- Kotlin
- Swift
- C#
- C
- C++
- requests
import requests
url = "https://www.searchapi.io/api/v1/search"
params = {
"engine": "kaggle_notebook",
"notebook_id": "alexisbcook/titanic-tutorial"
}
response = requests.get(url, params=params)
print(response.text)
{
"search_metadata": {
"id": "search_U248a3WaiPYXag0rFZKxRGEn",
"status": "Success",
"created_at": "2026-11-26T21:49:23Z",
"request_time_taken": 1.05,
"parsing_time_taken": 0.0,
"total_time_taken": 1.05,
"request_url": "https://www.kaggle.com/code/alexisbcook/titanic-tutorial",
"html_url": "https://www.searchapi.io/api/v1/searches/search_U248a3WaiPYXag0rFZKxRGEn.html",
"json_url": "https://www.searchapi.io/api/v1/searches/search_U248a3WaiPYXag0rFZKxRGEn"
},
"search_parameters": {
"engine": "kaggle_notebook",
"notebook_id": "alexisbcook/titanic-tutorial"
},
"notebook": {
"notebook_id": "alexisbcook/titanic-tutorial",
"id": 5660537,
"title": "Titanic Tutorial",
"link": "https://www.kaggle.com/code/alexisbcook/titanic-tutorial",
"author": {
"username": "alexisbcook",
"name": "Alexis Cook",
"link": "https://www.kaggle.com/alexisbcook",
"tier": "grandmaster"
},
"language": "python",
"type": "notebook",
"votes": 62156,
"views": 3367962,
"forks": 53687,
"comments": 30668,
"medal": "gold",
"updated_at": "2022-06-24T00:25:16.106666700Z",
"version": 22,
"versions_count": 22
},
"run": {
"status": "complete",
"created_at": "2022-06-24T00:25:13.820Z",
"evaluated_at": "2022-06-24T00:25:16.107Z",
"runtime_seconds": 16.4148811,
"is_successful": true,
"output_size_bytes": 2839,
"accelerator": "none",
"has_internet": false
},
"outputs": [
{
"name": "submission.csv",
"path": "submission.csv",
"size_bytes": 2839,
"file_type": ".csv"
}
],
"data_sources": [
{
"type": "competition",
"name": "Titanic - Machine Learning from Disaster",
"link": "https://www.kaggle.com/competitions/titanic",
"competition_id": 3136
}
]
}
Datasets a Notebook Reads, by Link
https://www.searchapi.io/api/v1/search?engine=kaggle_notebook¬ebook_id=https%3A%2F%2Fwww.kaggle.com%2Fcode%2Fimdevskp%2Fcovid-19-analysis-visualization-comparisons
- Python
- Node
- Ruby
- Java
- Go
- PHP
- Bash
- R
- Kotlin
- Swift
- C#
- C
- C++
- requests
import requests
url = "https://www.searchapi.io/api/v1/search"
params = {
"engine": "kaggle_notebook",
"notebook_id": "https://www.kaggle.com/code/imdevskp/covid-19-analysis-visualization-comparisons"
}
response = requests.get(url, params=params)
print(response.text)
{
"search_metadata": {
"id": "search_ThltOVR18gvStIUcNFFFd2dM",
"status": "Success",
"created_at": "2026-11-26T21:49:24Z",
"request_time_taken": 1.24,
"parsing_time_taken": 0.0,
"total_time_taken": 1.24,
"request_url": "https://www.kaggle.com/code/imdevskp/covid-19-analysis-visualization-comparisons",
"html_url": "https://www.searchapi.io/api/v1/searches/search_ThltOVR18gvStIUcNFFFd2dM.html",
"json_url": "https://www.searchapi.io/api/v1/searches/search_ThltOVR18gvStIUcNFFFd2dM"
},
"search_parameters": {
"engine": "kaggle_notebook",
"notebook_id": "imdevskp/covid-19-analysis-visualization-comparisons"
},
"data_sources": [
{
"type": "dataset",
"name": "World Happiness Report",
"link": "https://www.kaggle.com/datasets/unsdsn/world-happiness",
"dataset_id": "unsdsn/world-happiness"
},
"..."
]
}
GPU Script with a Competition Score
https://www.searchapi.io/api/v1/search?engine=kaggle_notebook¬ebook_id=thousandvoices%2Fsimple-lstm
- Python
- Node
- Ruby
- Java
- Go
- PHP
- Bash
- R
- Kotlin
- Swift
- C#
- C
- C++
- requests
import requests
url = "https://www.searchapi.io/api/v1/search"
params = {
"engine": "kaggle_notebook",
"notebook_id": "thousandvoices/simple-lstm"
}
response = requests.get(url, params=params)
print(response.text)
{
"search_metadata": {
"id": "search_zuLDtAo3s6kZ6XV5WQ7ed4tr",
"status": "Success",
"created_at": "2026-11-26T21:49:25Z",
"request_time_taken": 0.69,
"parsing_time_taken": 0.0,
"total_time_taken": 0.69,
"request_url": "https://www.kaggle.com/code/thousandvoices/simple-lstm",
"html_url": "https://www.searchapi.io/api/v1/searches/search_zuLDtAo3s6kZ6XV5WQ7ed4tr.html",
"json_url": "https://www.searchapi.io/api/v1/searches/search_zuLDtAo3s6kZ6XV5WQ7ed4tr"
},
"search_parameters": {
"engine": "kaggle_notebook",
"notebook_id": "thousandvoices/simple-lstm"
},
"notebook": {
"notebook_id": "thousandvoices/simple-lstm",
"id": 3478400,
"title": "Simple LSTM",
"link": "https://www.kaggle.com/code/thousandvoices/simple-lstm",
"author": {
"username": "thousandvoices",
"name": "thousandvoices",
"link": "https://www.kaggle.com/thousandvoices",
"tier": "grandmaster"
},
"language": "python",
"type": "script",
"votes": 2157,
"views": 129973,
"forks": 2502,
"comments": 137,
"medal": "gold",
"tags": [
"gpu"
],
"best_public_score": 0.93424,
"updated_at": "2019-06-22T13:27:43.316666700Z",
"version": 8,
"versions_count": 8
},
"run": {
"status": "complete",
"created_at": "2019-06-22T13:27:42.847Z",
"evaluated_at": "2019-06-22T13:27:43.317Z",
"runtime_seconds": 6775.275058917,
"is_successful": true,
"accelerator": "gpu",
"has_internet": false
}
}
R Markdown Notebook
https://www.searchapi.io/api/v1/search?engine=kaggle_notebook¬ebook_id=erikbruin%2Fhouse-prices-lasso-xgboost-and-a-detailed-eda
- Python
- Node
- Ruby
- Java
- Go
- PHP
- Bash
- R
- Kotlin
- Swift
- C#
- C
- C++
- requests
import requests
url = "https://www.searchapi.io/api/v1/search"
params = {
"engine": "kaggle_notebook",
"notebook_id": "erikbruin/house-prices-lasso-xgboost-and-a-detailed-eda"
}
response = requests.get(url, params=params)
print(response.text)
{
"search_metadata": {
"id": "search_Cp64f2C85bMC1dtSN80wrR1H",
"status": "Success",
"created_at": "2026-11-26T21:49:26Z",
"request_time_taken": 0.77,
"parsing_time_taken": 0.0,
"total_time_taken": 0.77,
"request_url": "https://www.kaggle.com/code/erikbruin/house-prices-lasso-xgboost-and-a-detailed-eda",
"html_url": "https://www.searchapi.io/api/v1/searches/search_Cp64f2C85bMC1dtSN80wrR1H.html",
"json_url": "https://www.searchapi.io/api/v1/searches/search_Cp64f2C85bMC1dtSN80wrR1H"
},
"search_parameters": {
"engine": "kaggle_notebook",
"notebook_id": "erikbruin/house-prices-lasso-xgboost-and-a-detailed-eda"
},
"notebook": {
"notebook_id": "erikbruin/house-prices-lasso-xgboost-and-a-detailed-eda",
"id": 699704,
"title": "House prices: Lasso, XGBoost, and a detailed EDA",
"link": "https://www.kaggle.com/code/erikbruin/house-prices-lasso-xgboost-and-a-detailed-eda",
"author": {
"username": "erikbruin",
"name": "Erik Bruin",
"link": "https://www.kaggle.com/erikbruin",
"tier": "grandmaster"
},
"language": "rmarkdown",
"type": "script",
"votes": 3628,
"views": 326791,
"forks": 2790,
"comments": 272,
"medal": "gold",
"tags": [
"data visualization",
"exploratory data analysis",
"feature engineering",
"xgboost"
],
"updated_at": "2018-05-10T06:33:09.886666700Z",
"version": 56,
"versions_count": 56
}
}
Output Files and a Model Source
https://www.searchapi.io/api/v1/search?engine=kaggle_notebook¬ebook_id=kencol3%2Fbantr-code-defect-probe-v1-qwen3-1-7b
- Python
- Node
- Ruby
- Java
- Go
- PHP
- Bash
- R
- Kotlin
- Swift
- C#
- C
- C++
- requests
import requests
url = "https://www.searchapi.io/api/v1/search"
params = {
"engine": "kaggle_notebook",
"notebook_id": "kencol3/bantr-code-defect-probe-v1-qwen3-1-7b"
}
response = requests.get(url, params=params)
print(response.text)
{
"search_metadata": {
"id": "search_0x7xZZPl4kGKptocwFOseFSD",
"status": "Success",
"created_at": "2026-11-26T21:49:27Z",
"request_time_taken": 2.27,
"parsing_time_taken": 0.0,
"total_time_taken": 2.27,
"request_url": "https://www.kaggle.com/code/kencol3/bantr-code-defect-probe-v1-qwen3-1-7b",
"html_url": "https://www.searchapi.io/api/v1/searches/search_0x7xZZPl4kGKptocwFOseFSD.html",
"json_url": "https://www.searchapi.io/api/v1/searches/search_0x7xZZPl4kGKptocwFOseFSD"
},
"search_parameters": {
"engine": "kaggle_notebook",
"notebook_id": "kencol3/bantr-code-defect-probe-v1-qwen3-1-7b"
},
"outputs": [
{
"name": "probe_output.json",
"path": "probe_output.json",
"size_bytes": 1102,
"file_type": ".json"
},
"..."
],
"data_sources": [
{
"type": "model",
"name": "Qwen 3",
"link": "https://www.kaggle.com/models/qwen-lm/qwen-3/Transformers/1.7b/1",
"model_id": "qwen-lm/qwen-3"
}
]
}
Missing or Private Notebook
https://www.searchapi.io/api/v1/search?engine=kaggle_notebook¬ebook_id=alexisbcook%2Fsearchapi-no-such-notebook-8bb14a7a
- Python
- Node
- Ruby
- Java
- Go
- PHP
- Bash
- R
- Kotlin
- Swift
- C#
- C
- C++
- requests
import requests
url = "https://www.searchapi.io/api/v1/search"
params = {
"engine": "kaggle_notebook",
"notebook_id": "alexisbcook/searchapi-no-such-notebook-8bb14a7a"
}
response = requests.get(url, params=params)
print(response.text)
{
"search_metadata": {
"id": "search_f6NJyeOz67as4KuJr3gr4yEY",
"status": "Success",
"created_at": "2026-11-26T21:49:30Z",
"request_time_taken": 1.04,
"parsing_time_taken": 0.0,
"total_time_taken": 1.04,
"request_url": "https://www.kaggle.com/code/alexisbcook/searchapi-no-such-notebook-8bb14a7a",
"html_url": "https://www.searchapi.io/api/v1/searches/search_f6NJyeOz67as4KuJr3gr4yEY.html",
"json_url": "https://www.searchapi.io/api/v1/searches/search_f6NJyeOz67as4KuJr3gr4yEY"
},
"search_parameters": {
"engine": "kaggle_notebook",
"notebook_id": "alexisbcook/searchapi-no-such-notebook-8bb14a7a"
},
"error": "Kaggle has no public notebook for this notebook_id. It may not exist, or it may be private or deleted."
}