Docs · Search YouTube
Search YouTube
Search YouTube by keyword for videos, Shorts, channels and playlists, with date, length and type filters.
https://api.lurkapi.com/v1/youtube/searchWhen to use this
Use it for trend, topic and competitor research: what YouTube's search page shows for a keyword, split into videos, shorts, channels, playlists and lives (streaming now). About 20 results per page. Narrow it with type, uploadDate, duration (videos only) and sortBy=popular.
Video results carry views as YouTube shows them, a description snippet and the channel. Counts may be rounded; video details returns exact views. Shorts carry title and views only; pass a Short's url to the video endpoint for the rest.
Pagination. Pass the response's continuationToken back as continuationToken (with the same query) for the next page; it's null on the last page.
Parameters
All parameters go in the query string.
| Parameter | Description |
|---|---|
querystringrequired | Keywords, e.g. running shoes. YouTube's operators work, e.g. intitle:"air max".
|
typestringoptional | What to search for. all mixes them like youtube.com.
|
uploadDatestringoptional | Only results uploaded in this window.
|
durationstringoptional | Video length. Doesn't apply to Shorts.
|
sortBystringoptional | relevance (YouTube's default) or popular (most viewed first).
|
continuationTokenstringoptional | The continuationToken from the previous response, for the next page. |
Example request
Replace YOUR_API_KEY with your key, or set LURKAPI_KEY for the code. Get a free key.
curl "https://api.lurkapi.com/v1/youtube/search?query=running+shoes" \
-H "x-api-key: YOUR_API_KEY"const params = new URLSearchParams({
query: "running shoes",
});
const res = await fetch(`https://api.lurkapi.com/v1/youtube/search?${params}`, {
headers: { "x-api-key": process.env.LURKAPI_KEY },
});
const data = await res.json();
if (!data.success) throw new Error(`${data.code}: ${data.error}`);
console.log(data.videos);import os
import requests
res = requests.get(
"https://api.lurkapi.com/v1/youtube/search",
params={
"query": "running shoes",
},
headers={"x-api-key": os.environ["LURKAPI_KEY"]},
timeout=60,
)
data = res.json()
if not data["success"]:
raise RuntimeError(f"{data['code']}: {data['error']}")
print(data["videos"])Example response
A real response from this endpoint, captured from the live API and trimmed to a couple of items. Strings over 96 characters (mostly signed media URLs) are cut short and end in ….
Show the example response (3 KB)Hide
{
"success": true,
"credits_remaining": 999992,
"credits_charged": 1,
"videos": [
{
"type": "video",
"id": "z5mWgBMOFJk",
"url": "https://www.youtube.com/watch?v=z5mWgBMOFJk",
"title": "My Top 3 Running Shoes | Marathon Prep Training",
"thumbnail": "https://i.ytimg.com/vi/z5mWgBMOFJk/hq720.jpg?sqp=-oaymwEcCNAFEJQDSFXyq4q…",
"viewCountText": "682,786 views",
"viewCountInt": 682786,
"publishedTimeText": "6 years ago",
"publishedTime": "2020-10-01T14:32:05.335Z",
"lengthText": "17:18",
"lengthSeconds": 1038,
"badges": [],
"description": "Subscribe: http://bit.ly/subNickBare Follow Nick Bare: Facebook: http://…",
"channel": {
"id": "UCbVEx9qG_hLrb6FrWQJz_Tg",
"title": "Nick Bare",
"handle": "nickbarefitness",
"url": "https://www.youtube.com/@nickbarefitness",
"thumbnail": "https://yt3.ggpht.com/ytc/AIdro_mVx6fQ8UNrMx2sjhQ5JwJyQTCfSXAoznqRdRSZLo…"
}
},
{
"type": "video",
"id": "GDL5GVlpuko",
"url": "https://www.youtube.com/watch?v=GDL5GVlpuko",
"title": "My Complete Guide To Running Shoes! (Everything You Need To Know)",
"thumbnail": "https://i.ytimg.com/vi/GDL5GVlpuko/hq720.jpg?sqp=-oaymwEcCNAFEJQDSFXyq4q…",
"viewCountText": "282,242 views",
"viewCountInt": 282242,
"publishedTimeText": "10 months ago",
"publishedTime": "2025-12-04T14:32:05.335Z",
"lengthText": "20:25",
"lengthSeconds": 1225,
"badges": [
"1 product",
"4K"
],
"description": "If you enjoyed the video, please like, comment and subscribe! Thank you …",
"channel": {
"id": "UCZPqG0yh_xPm2AyLjffbDvw",
"title": "Ben Parkes",
"handle": "BenParkes",
"url": "https://www.youtube.com/@BenParkes",
"thumbnail": "https://yt3.ggpht.com/ytc/AIdro_mDy4ZoQqcj7DiO_-1z6j2Y6Nu_PvFESGAsJagEM5…"
}
}
],
"shorts": [
{
"type": "short",
"id": "SVyIXZQABS8",
"url": "https://www.youtube.com/shorts/SVyIXZQABS8",
"title": "Which shoes to get for your Hyrox training? Boldfit Running Shoes",
"thumbnail": "https://i.ytimg.com/vi/SVyIXZQABS8/oar2.jpg?sqp=-oaymwEgCJUDEOAESFWQAgHy…",
"viewCountText": "44 views",
"viewCountInt": 44
},
{
"type": "short",
"id": "rKuu1bK6qQY",
"url": "https://www.youtube.com/shorts/rKuu1bK6qQY",
"title": "Best Running Shoes for Long Runs 🏃",
"thumbnail": "https://i.ytimg.com/vi/rKuu1bK6qQY/oar2.jpg?sqp=-oaymwEgCJUDEOAESFWQAgHy…",
"viewCountText": "7M views",
"viewCountInt": 7000000
}
],
"channels": [],
"playlists": [],
"lives": [],
"continuationToken": "EugBEg1ydW5uaW5nIHNob2VzGtYBU0JTQ0FRdDZOVzFYWjBKTlQwWkthNElCQzBkRVREVkhW…"
}Response fields
Every field of a successful response. [] marks a list: a[].b is the b of each item in a. nullable fields can be null; optional fields can be missing.
Show all 77 fieldsHide
| Field | Type | Description |
|---|---|---|
| success | true | Always true here; errors have success: false. |
| credits_remaining | number | Your balance after this call. On anonymous playground calls: free tries left today. |
| credits_charged | number | Credits this call cost; 0 on free endpoints. On anonymous playground calls: tries used (1). |
| videos | object[] | Videos, in result order. |
| videos[].type | "video" | Always video. |
| videos[].id | string | Video id, e.g. v9QtM6qnG50. |
| videos[].url | string | Watch link. Pass it to the video endpoint for likes, comments, the full description and exact views. |
| videos[].title | string | Video title. |
| videos[].thumbnail | stringnullable | Largest thumbnail URL. |
| videos[].viewCountText | stringnullable | Views as YouTube shows them, e.g. "82M views", or "1,204 watching" while live. |
| videos[].viewCountInt | numbernullable | viewCountText as a number, rounded whenever YouTube abbreviates it (82M views → 82000000). Use video details for exact views. |
| videos[].publishedTimeText | stringnullable | When it went up, as YouTube shows it, e.g. "10 days ago". null for live and upcoming videos. |
| videos[].publishedTime | stringnullable | publishedTimeText as an estimated ISO 8601 time, counted back from when we fetched the page. Only as precise as the text: "1 year ago" means sometime that year. |
| videos[].lengthText | stringnullable | Length as shown, e.g. "19:03". null for live and upcoming videos. |
| videos[].lengthSeconds | numbernullable | Length in seconds. |
| videos[].badges | string[] | Labels YouTube shows on the result, e.g. "4K", "CC", "New" or "LIVE". Often empty. |
| videos[].description | stringnullable | The description snippet shown under the result, usually its first line or two. |
| videos[].channel | objectnullable | The channel behind it. |
| videos[].channel.id | stringnullable | Channel id, UC…. |
| videos[].channel.title | stringnullable | Channel name. |
| videos[].channel.handle | stringnullable | Handle without the @, e.g. BenParkes; null if YouTube shows none. |
| videos[].channel.url | stringnullable | Channel page, e.g. https://www.youtube.com/@BenParkes. |
| videos[].channel.thumbnail | stringnullable | Channel picture URL; null when the result doesn't show one. |
| shorts | object[] | Shorts, in result order. |
| shorts[].type | "short" | Always short. |
| shorts[].id | string | The Short's video id. |
| shorts[].url | string | https://www.youtube.com/shorts/<id>. Pass it to the video endpoint for likes, comments, date and length. |
| shorts[].title | string | The Short's title. |
| shorts[].thumbnail | stringnullable | Largest (vertical) thumbnail URL. |
| shorts[].viewCountText | stringnullable | Views as YouTube shows them, e.g. "22M views". |
| shorts[].viewCountInt | numbernullable | viewCountText as a number, rounded as shown (22M views → 22000000). |
| channels | object[] | Channels, in result order. |
| channels[].type | "channel" | Always channel. |
| channels[].id | string | Channel id, UC…. Pass it to channel details for the full stats. |
| channels[].url | string | Channel page. |
| channels[].title | string | Channel name. |
| channels[].handle | stringnullable | Handle without the @; null if YouTube shows none. |
| channels[].thumbnail | stringnullable | Channel picture URL. |
| channels[].description | stringnullable | The description snippet shown in the result. |
| channels[].subscriberCountText | stringnullable | Subscribers as YouTube shows them, e.g. "128K subscribers". |
| channels[].subscriberCount | numbernullable | subscriberCountText as a number, rounded as shown. |
| channels[].isVerified | boolean | Has YouTube's verified or official artist badge. |
| playlists | object[] | Playlists and mixes, in result order. |
| playlists[].type | "playlist" | Always playlist. |
| playlists[].id | string | Playlist id, e.g. PLB50X6wE7gSWNQJElg3NX4AH42QoouHOk (mixes start with RD). |
| playlists[].url | string | Playlist page, https://www.youtube.com/playlist?list=<id>. |
| playlists[].title | string | Playlist title. |
| playlists[].thumbnail | stringnullable | Cover thumbnail URL (its first video). |
| playlists[].videoCountText | stringnullable | Size as YouTube shows it, e.g. "30 videos". |
| playlists[].videoCount | numbernullable | videoCountText as a number. |
| playlists[].channel | objectnullable | The channel behind it. |
| playlists[].channel.id | stringnullable | Channel id, UC…. |
| playlists[].channel.title | stringnullable | Channel name. |
| playlists[].channel.handle | stringnullable | Handle without the @, e.g. BenParkes; null if YouTube shows none. |
| playlists[].channel.url | stringnullable | Channel page, e.g. https://www.youtube.com/@BenParkes. |
| playlists[].channel.thumbnail | stringnullable | Channel picture URL; null when the result doesn't show one. |
| lives | object[] | Streams that are live right now. |
| lives[].type | "video" | Always video. |
| lives[].id | string | Video id, e.g. v9QtM6qnG50. |
| lives[].url | string | Watch link. Pass it to the video endpoint for likes, comments, the full description and exact views. |
| lives[].title | string | Video title. |
| lives[].thumbnail | stringnullable | Largest thumbnail URL. |
| lives[].viewCountText | stringnullable | Views as YouTube shows them, e.g. "82M views", or "1,204 watching" while live. |
| lives[].viewCountInt | numbernullable | viewCountText as a number, rounded whenever YouTube abbreviates it (82M views → 82000000). Use video details for exact views. |
| lives[].publishedTimeText | stringnullable | When it went up, as YouTube shows it, e.g. "10 days ago". null for live and upcoming videos. |
| lives[].publishedTime | stringnullable | publishedTimeText as an estimated ISO 8601 time, counted back from when we fetched the page. Only as precise as the text: "1 year ago" means sometime that year. |
| lives[].lengthText | stringnullable | Length as shown, e.g. "19:03". null for live and upcoming videos. |
| lives[].lengthSeconds | numbernullable | Length in seconds. |
| lives[].badges | string[] | Labels YouTube shows on the result, e.g. "4K", "CC", "New" or "LIVE". Often empty. |
| lives[].description | stringnullable | The description snippet shown under the result, usually its first line or two. |
| lives[].channel | objectnullable | The channel behind it. |
| lives[].channel.id | stringnullable | Channel id, UC…. |
| lives[].channel.title | stringnullable | Channel name. |
| lives[].channel.handle | stringnullable | Handle without the @, e.g. BenParkes; null if YouTube shows none. |
| lives[].channel.url | stringnullable | Channel page, e.g. https://www.youtube.com/@BenParkes. |
| lives[].channel.thumbnail | stringnullable | Channel picture URL; null when the result doesn't show one. |
| continuationToken | stringnullable | Pass as continuationToken for the next page. null on the last page. |
Caching and freshness
Responses are cached for up to 15 minutes, so a repeat call within that window can return the same data. It still costs 1 credit.
Errors
Errors return { success: false, error, code, docs } with the HTTP status below. Validation errors, 401/402/429 rejections and 5xx failures are free; not_found is charged (how charging works). All error codes.
| Status | Code | Meaning |
|---|---|---|
| 401 | missing_api_key | No API key. Send it in the x-api-key header. |
| 401 | invalid_api_key | The key is unknown or was revoked. |
| 402 | insufficient_credits | Not enough credits for this call. Buy a pack or wait for tomorrow's top-up. |
| 405 | method_not_allowed | Endpoints take GET with query params. |
| 429 | rate_limited | Too many calls at once. Wait for the retry-after seconds, then retry. |
| 500 | internal_error | Something broke on our side. Retry; 5xx errors are free. |
| 502 | upstream_error | The platform didn't give a usable answer. Retry; 5xx errors are free. |
| 503 | upstream_busy | All our connections to the platform are busy. Retry in a few seconds; 5xx errors are free. |
| 504 | upstream_timeout | The platform took over 30 seconds to answer. Retry; timeouts are free. |
Use it in Claude
Once LurkAPI is connected to Claude, this endpoint is the youtube_search tool. Ask in plain English, for example:
Use LurkAPI's youtube_search with query "running shoes" and summarize what you find.Claude calls youtube_search with arguments like these, and each call costs 1 credit:
{
"query": "running shoes"
}Tool results skip nulls and empty lists to save tokens.