Kaggle Notebook Search
Parse a Kaggle notebook search or listing page into structured JSON with one row per notebook, including author, co-authors, competition context, votes, and comment count. To try it with up to 5,000 free requests, start from the Kaggle Scraper API page.
Kaggle labels the result total only as Results (100+), so totalCountLabel is returned verbatim as a string rather than converted to a number. Rows with more than one author render stacked avatars with no image URL in the document, so author.image is empty on those rows. A notebook attached to several competitions shows the first one plus a +2 badge - the extra names are not in the page, so only additionalContextCount can be reported.
API usage
Add &scraper=kaggle-notebook-serp to a Crawling API request. URL-encode the target URL in the url parameter.
curl 'https://api.crawlbase.com/?token=YOUR_TOKEN' \
--data-urlencode 'url=https://www.kaggle.com/code?searchQuery=titanic' \
--data-urlencode 'scraper=kaggle-notebook-serp' -Gfrom crawlbase import CrawlingAPI
api = CrawlingAPI({'token': 'YOUR_TOKEN'})
res = api.get(
'https://www.kaggle.com/code?searchQuery=titanic',
{'scraper': 'kaggle-notebook-serp'}
)
import json
data = json.loads(res['body'])const { CrawlingAPI } = require('crawlbase');
const api = new CrawlingAPI({ token: 'YOUR_TOKEN' });
const res = await api.get(
'https://www.kaggle.com/code?searchQuery=titanic',
{ scraper: 'kaggle-notebook-serp' }
);
const data = JSON.parse(res.body);require 'crawlbase'
api = Crawlbase::API.new(token: 'YOUR_TOKEN')
res = api.get('https://www.kaggle.com/code?searchQuery=titanic', scraper: 'kaggle-notebook-serp')
data = JSON.parse(res.body)Example input URL
Any Kaggle notebook search or listing page works in the url parameter - the page at /code, with or without a query string. For example:
https://www.kaggle.com/code?searchQuery=titanic
https://www.kaggle.com/code?searchQuery=xgboost&language=Python
https://www.kaggle.com/code
https://www.kaggle.com/code?searchQuery=nlp&page=2Response shape
JSON response body. Field types may be null when the source page omits the value.
100+. Returned as a string because the page does not state an exact number.author/notebook, read from the URL path.context. Their names are not in the page, so only the count is available.gold), or null when the row carries none.Sample response
{
"url": "https://www.kaggle.com/code?searchQuery=titanic",
"query": "titanic",
"totalCountLabel": "100+",
"page": 1,
"hasNextPage": true,
"resultCount": 20,
"results": [
{
"position": 1,
"title": "Titanic Tutorial",
"url": "https://www.kaggle.com/code/alexisbcook/titanic-tutorial",
"slug": "alexisbcook/titanic-tutorial",
"author": {
"username": "alexisbcook",
"name": "Alexis Cook",
"url": "https://www.kaggle.com/alexisbcook",
"image": "https://storage.googleapis.com/kaggle-avatars/thumbnails/2603295-kg.jpg"
},
"coauthors": [],
"lastUpdated": "Fri Jun 24 2022 00:25:16 GMT+0000 (Coordinated Universal Time)",
"commentCount": 30626,
"context": "Titanic - Machine Learning from Disaster",
"additionalContextCount": 0,
"votes": 60135,
"medal": "gold"
},
{
"position": 3,
"title": "Spaceship Titanic with TFDF",
"url": "https://www.kaggle.com/code/gusthema/spaceship-titanic-with-tfdf",
"slug": "gusthema/spaceship-titanic-with-tfdf",
"author": {
"username": "gusthema",
"name": "Gusthema",
"url": "https://www.kaggle.com/gusthema",
"image": ""
},
"coauthors": [
"Nidhin PD"
],
"lastUpdated": "Mon Apr 17 2023 09:36:29 GMT+0000 (Coordinated Universal Time)",
"commentCount": 378,
"context": "Spaceship Titanic",
"additionalContextCount": 0,
"votes": 7863,
"medal": "gold"
},
{
"position": 10,
"title": "Titanic Top Solution",
"url": "https://www.kaggle.com/code/brendan45774/titanic-top-solution",
"slug": "brendan45774/titanic-top-solution",
"author": {
"username": "brendan45774",
"name": "Brenda N",
"url": "https://www.kaggle.com/brendan45774",
"image": "https://storage.googleapis.com/kaggle-avatars/thumbnails/2681031-kg.jpg"
},
"coauthors": [],
"lastUpdated": "Wed Sep 01 2021 16:03:11 GMT+0000 (Coordinated Universal Time)",
"commentCount": 249,
"context": "Titanic - Machine Learning from Disaster",
"additionalContextCount": 2,
"votes": 2294,
"medal": "gold"
}
]
}