Kaggle Notebook Search API Documentation

GET   /api/v1/search?engine=kaggle_notebook_search

The Kaggle Notebook Search API returns the public notebooks Kaggle lists for a keyword, 20 per page. Each notebook comes with its notebook_id, title, whether it is a notebook or a script, votes, views and comments. When Kaggle supplies them, results also include the author and tier, language, last run and creation times, medal, tags, runtime and the competitions, datasets, notebook outputs and models it reads.

List the notebooks that use a dataset by its dataset_id, or a competition by its competition_id, keep Python or R notebooks only, and sort by hotness, votes, comments, recently run or recently created. Kaggle sends no total count, so pagination.next appears after each full page, up to page 50.

API Parameters

Search Query

  • Name
    q
    Required
    Required
    Description

    Parameter defines the text you want to search for, up to 512 characters. It is required unless dataset_id or competition_id is set.

Filters

  • Name
    language
    Required
    Optional
    Description

    Parameter keeps the notebooks written in one language. Supported values are python and r.

  • Name
    dataset_id
    Required
    Optional
    Description

    Parameter keeps the notebooks that use one Kaggle dataset. Pass its owner/slug ref, such as imdevskp/corona-virus-report, as the Kaggle Dataset Search API returns it in dataset_id, or its kaggle.com/datasets URL. A dataset Kaggle has no public page for returns an error. It can't be combined with competition_id.

  • Name
    competition_id
    Required
    Optional
    Description

    Parameter keeps the notebooks that use one Kaggle competition, by its numeric id, such as 3136 for Titanic. A notebook's data_sources carry the competition_id of each competition it uses. It can't be combined with dataset_id.

Sorting

  • Name
    sort_by
    Required
    Optional
    Description

    Parameter defines the order of the notebooks. Supported values are hotness, votes, comments, recently_run, and recently_created. hotness is Kaggle's own ranking, recently_run puts the latest run first and recently_created the newest notebook first.

Pagination

  • Name
    page
    Required
    Optional
    Description

    Parameter defines the page of results, 20 notebooks per page, from 1 to 50.

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_search.

API key

  • Name
    api_key
    Required
    Required
    Description

    The api_key authenticates 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 true to keep request parameters, HTML, and JSON responses out of storage and logs. Suitable for high-compliance use cases. Debugging and support may be limited while enabled.

API Examples

Full Response

Full Response
GET
https://www.searchapi.org/api/v1/search?engine=kaggle_notebook_search&q=titanic
Request
import requests

url = "https://www.searchapi.org/api/v1/search"
params = {
  "engine": "kaggle_notebook_search",
  "q": "titanic"
}

response = requests.get(url, params=params)
print(response.text)
Response
{
  "search_metadata": {
    "id": "search_rlnuDgoX43BHnL9T4GH1O4HE",
    "status": "Success",
    "created_at": "2026-11-26T21:50:21Z",
    "request_time_taken": 0.96,
    "parsing_time_taken": 0.0,
    "total_time_taken": 0.96,
    "request_url": "https://www.kaggle.com/code?searchQuery=titanic",
    "html_url": "https://www.searchapi.io/api/v1/searches/search_rlnuDgoX43BHnL9T4GH1O4HE.html",
    "json_url": "https://www.searchapi.io/api/v1/searches/search_rlnuDgoX43BHnL9T4GH1O4HE"
  },
  "search_parameters": {
    "engine": "kaggle_notebook_search",
    "q": "titanic",
    "sort_by": "hotness",
    "page": 1
  },
  "notebook_results": [
    {
      "position": 1,
      "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,
      "comments": 30668,
      "medal": "gold",
      "last_run_at": "2022-06-24T00:25:16.107Z",
      "created_at": "2019-09-03T15:47:09.916593700Z",
      "runtime_seconds": 16,
      "lines": 208,
      "has_data_outputs": true,
      "data_sources": [
        {
          "type": "competition",
          "name": "Titanic - Machine Learning from Disaster",
          "link": "https://www.kaggle.com/competitions/titanic",
          "competition_id": 3136
        }
      ]
    },
    "..."
  ],
  "pagination": {
    "current": 1,
    "next": 2
  }
}

Most Voted R Notebooks

Most Voted R Notebooks
GET
https://www.searchapi.org/api/v1/search?engine=kaggle_notebook_search&language=r&q=titanic&sort_by=votes
Request
import requests

url = "https://www.searchapi.org/api/v1/search"
params = {
  "engine": "kaggle_notebook_search",
  "q": "titanic",
  "language": "r",
  "sort_by": "votes"
}

response = requests.get(url, params=params)
print(response.text)
Response
{
  "search_metadata": {
    "id": "search_QggYBUQPuIbCMr1cblvMWXcs",
    "status": "Success",
    "created_at": "2026-11-26T21:50:22Z",
    "request_time_taken": 1.04,
    "parsing_time_taken": 0.0,
    "total_time_taken": 1.05,
    "request_url": "https://www.kaggle.com/code?language=R&searchQuery=titanic&sortBy=voteCount",
    "html_url": "https://www.searchapi.io/api/v1/searches/search_QggYBUQPuIbCMr1cblvMWXcs.html",
    "json_url": "https://www.searchapi.io/api/v1/searches/search_QggYBUQPuIbCMr1cblvMWXcs"
  },
  "search_parameters": {
    "engine": "kaggle_notebook_search",
    "q": "titanic",
    "language": "r",
    "sort_by": "votes",
    "page": 1
  },
  "notebook_results": [
    {
      "position": 1,
      "notebook_id": "mrisdal/exploring-survival-on-the-titanic",
      "id": 44675,
      "title": "Exploring Survival on the Titanic",
      "link": "https://www.kaggle.com/code/mrisdal/exploring-survival-on-the-titanic",
      "author": {
        "username": "mrisdal",
        "name": "Meg Risdal",
        "link": "https://www.kaggle.com/mrisdal",
        "tier": "grandmaster"
      },
      "language": "r",
      "type": "script",
      "votes": 11043,
      "views": 768520,
      "comments": 1082,
      "medal": "gold",
      "tags": [
        "beginner",
        "feature engineering",
        "random forest"
      ],
      "best_public_score": 0.80382,
      "last_run_at": "2017-12-26T19:42:24.130Z",
      "created_at": "2016-03-06T22:10:44.693333300Z",
      "runtime_seconds": 53,
      "lines": 392,
      "has_data_outputs": true,
      "data_sources": [
        {
          "type": "competition",
          "name": "Titanic - Machine Learning from Disaster",
          "link": "https://www.kaggle.com/competitions/titanic",
          "competition_id": 3136
        }
      ]
    },
    "..."
  ],
  "pagination": {
    "current": 1,
    "next": 2
  }
}

Notebooks That Use a Dataset

Notebooks That Use a Dataset
GET
https://www.searchapi.org/api/v1/search?dataset_id=imdevskp%2Fcorona-virus-report&engine=kaggle_notebook_search&sort_by=votes
Request
import requests

url = "https://www.searchapi.org/api/v1/search"
params = {
  "engine": "kaggle_notebook_search",
  "dataset_id": "imdevskp/corona-virus-report",
  "sort_by": "votes"
}

response = requests.get(url, params=params)
print(response.text)
Response
{
  "search_metadata": {
    "id": "search_1BCaUG9RekMVQk4DsuKIc1UK",
    "status": "Success",
    "created_at": "2026-11-26T21:50:23Z",
    "request_time_taken": 4.65,
    "parsing_time_taken": 0.0,
    "total_time_taken": 4.65,
    "request_url": "https://www.kaggle.com/datasets/imdevskp/corona-virus-report/code?sortBy=voteCount",
    "html_url": "https://www.searchapi.io/api/v1/searches/search_1BCaUG9RekMVQk4DsuKIc1UK.html",
    "json_url": "https://www.searchapi.io/api/v1/searches/search_1BCaUG9RekMVQk4DsuKIc1UK"
  },
  "search_parameters": {
    "engine": "kaggle_notebook_search",
    "sort_by": "votes",
    "dataset_id": "imdevskp/corona-virus-report",
    "page": 1
  },
  "notebook_results": [
    {
      "position": 1,
      "notebook_id": "imdevskp/covid-19-analysis-visualization-comparisons",
      "id": 7758262,
      "title": "COVID-19 - Analysis, Visualization & Comparisons",
      "link": "https://www.kaggle.com/code/imdevskp/covid-19-analysis-visualization-comparisons",
      "author": {
        "username": "imdevskp",
        "name": "Devakumar K. P.",
        "link": "https://www.kaggle.com/imdevskp",
        "tier": "master"
      },
      "language": "python",
      "type": "notebook",
      "votes": 7645,
      "views": 503806,
      "comments": 369,
      "medal": "gold",
      "tags": [
        "diseases",
        "health",
        "covid19"
      ],
      "last_run_at": "2020-06-19T15:51:01.957Z",
      "created_at": "2020-01-30T15:16:32.605095Z",
      "runtime_seconds": 73,
      "lines": 587,
      "data_sources": [
        {
          "type": "dataset",
          "name": "COVID-19 Dataset",
          "link": "https://www.kaggle.com/datasets/imdevskp/corona-virus-report",
          "dataset_id": "imdevskp/corona-virus-report"
        },
        "..."
      ]
    },
    "..."
  ],
  "pagination": {
    "current": 1,
    "next": 2
  }
}

Most Discussed Notebooks of a Competition

GET
https://www.searchapi.org/api/v1/search?competition_id=3136&engine=kaggle_notebook_search&sort_by=comments
Request
import requests

url = "https://www.searchapi.org/api/v1/search"
params = {
  "engine": "kaggle_notebook_search",
  "competition_id": "3136",
  "sort_by": "comments"
}

response = requests.get(url, params=params)
print(response.text)
Response
{
  "search_metadata": {
    "id": "search_hbUyhPU4OuDLOhkF5K8UHXSP",
    "status": "Success",
    "created_at": "2026-11-26T21:50:28Z",
    "request_time_taken": 1.47,
    "parsing_time_taken": 0.0,
    "total_time_taken": 1.47,
    "request_url": "https://www.kaggle.com/code?sortBy=commentCount",
    "html_url": "https://www.searchapi.io/api/v1/searches/search_hbUyhPU4OuDLOhkF5K8UHXSP.html",
    "json_url": "https://www.searchapi.io/api/v1/searches/search_hbUyhPU4OuDLOhkF5K8UHXSP"
  },
  "search_parameters": {
    "engine": "kaggle_notebook_search",
    "sort_by": "comments",
    "competition_id": 3136,
    "page": 1
  },
  "notebook_results": [
    {
      "position": 1,
      "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,
      "comments": 30668,
      "medal": "gold",
      "last_run_at": "2022-06-24T00:25:16.107Z",
      "created_at": "2019-09-03T15:47:09.916593700Z",
      "runtime_seconds": 16,
      "lines": 208,
      "has_data_outputs": true,
      "data_sources": [
        {
          "type": "competition",
          "name": "Titanic - Machine Learning from Disaster",
          "link": "https://www.kaggle.com/competitions/titanic",
          "competition_id": 3136
        }
      ]
    },
    "..."
  ],
  "pagination": {
    "current": 1,
    "next": 2
  }
}

Second Page of Results

GET
https://www.searchapi.org/api/v1/search?engine=kaggle_notebook_search&page=2&q=random+forest
Request
import requests

url = "https://www.searchapi.org/api/v1/search"
params = {
  "engine": "kaggle_notebook_search",
  "q": "random forest",
  "page": "2"
}

response = requests.get(url, params=params)
print(response.text)
Response
{
  "search_metadata": {
    "id": "search_wCqwfXa94YbyCdWfaWfdQNSF",
    "status": "Success",
    "created_at": "2026-11-26T21:50:30Z",
    "request_time_taken": 1.37,
    "parsing_time_taken": 0.0,
    "total_time_taken": 1.37,
    "request_url": "https://www.kaggle.com/code?searchQuery=random+forest",
    "html_url": "https://www.searchapi.io/api/v1/searches/search_wCqwfXa94YbyCdWfaWfdQNSF.html",
    "json_url": "https://www.searchapi.io/api/v1/searches/search_wCqwfXa94YbyCdWfaWfdQNSF"
  },
  "search_parameters": {
    "engine": "kaggle_notebook_search",
    "q": "random forest",
    "sort_by": "hotness",
    "page": 2
  },
  "notebook_results": [
    {
      "position": 21,
      "notebook_id": "raviolli77/random-forest-in-python",
      "id": 491616,
      "title": "Random Forest in Python",
      "link": "https://www.kaggle.com/code/raviolli77/random-forest-in-python",
      "author": {
        "username": "raviolli77",
        "name": "Raul",
        "link": "https://www.kaggle.com/raviolli77",
        "tier": "contributor"
      },
      "language": "python",
      "type": "notebook",
      "votes": 178,
      "views": 60796,
      "comments": 7,
      "medal": "bronze",
      "tags": [
        "business"
      ],
      "last_run_at": "2018-07-06T22:41:08.653Z",
      "created_at": "2017-12-14T19:03:38.093862600Z",
      "runtime_seconds": 81,
      "lines": 725,
      "data_sources": [
        {
          "type": "dataset",
          "name": "Breast Cancer Wisconsin (Diagnostic) Data Set",
          "link": "https://www.kaggle.com/datasets/uciml/breast-cancer-wisconsin-data",
          "dataset_id": "uciml/breast-cancer-wisconsin-data"
        }
      ]
    },
    "..."
  ],
  "pagination": {
    "current": 2,
    "next": 3
  }
}