LurkAPI
Docs · Search YouTube

Search YouTube

Search YouTube by keyword for videos, Shorts, channels and playlists, with date, length and type filters.

1 credit per callFresh within 15 minutesMCP tool: youtube_search
GEThttps://api.lurkapi.com/v1/youtube/search

Example response

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

Example request

Copy one and replace YOUR_API_KEY with your API key (get one free). The code versions read the key from the LURKAPI_API_KEY environment variable instead.

Language

Parameters

Add them to the URL after a ?, as in ?query=running+shoes. Join several with &.

ParameterDescription
query
stringrequired
Keywords, e.g. running shoes. YouTube's operators work, e.g. intitle:"air max".
Example
running shoes
type
stringoptional
What to search for. all mixes them like youtube.com.
One of
allvideosshortschannelsplaylists
Default
all
uploadDate
stringoptional
Only results uploaded in this window.
One of
anytodaythis_weekthis_monththis_year
Default
any
duration
stringoptional
Video length. Doesn't apply to Shorts.
One of
anyunder_3_minbetween_3_and_20_minover_20_min
Default
any
sortBy
stringoptional
relevance (YouTube's default) or popular (most viewed first).
One of
relevancepopular
Default
relevance
continuationToken
stringoptional
The continuationToken from the previous response, for the next page.

Example response

A real response, captured from the live API. Lists are trimmed to a couple of items, and long text such as media links is cut short with ….

Show the example response (3 KB)
{
  "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 in a successful response, and what it means. A name with [] belongs to each item of a list: videos[].type is the type of every item in videos. null means there's no value.

Show all 77 fields
FieldTypeDescription
successtrueAlways true here; errors have success: false.
credits_remainingnumberYour balance after this call. On anonymous playground calls: free tries left today.
credits_chargednumberCredits this call cost; 0 on free endpoints. On anonymous playground calls: tries used (1).
videosobject[]Videos, in result order.
videos[].type"video"Always video.
videos[].idstringVideo id, e.g. v9QtM6qnG50.
videos[].urlstringWatch link. Pass it to the video endpoint for likes, comments, the full description and exact views.
videos[].titlestringVideo title. YouTube may translate non-English titles into English; video details has the original.
videos[].thumbnailstringcan be nullLargest thumbnail URL.
videos[].viewCountTextstringcan be nullViews as YouTube shows them, e.g. "82M views", or "1,204 watching" while live.
videos[].viewCountIntnumbercan be nullviewCountText as a number, rounded whenever YouTube abbreviates it (82M views → 82000000). Use video details for exact views.
videos[].publishedTimeTextstringcan be nullWhen it went up, as YouTube shows it, e.g. "10 days ago". null for live and upcoming videos.
videos[].publishedTimestringcan be nullpublishedTimeText 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[].lengthTextstringcan be nullLength as shown, e.g. "19:03". null for live and upcoming videos.
videos[].lengthSecondsnumbercan be nullLength in seconds.
videos[].badgesstring[]Labels YouTube shows on the result, e.g. "4K", "CC", "New" or "LIVE". Often empty.
videos[].descriptionstringcan be nullThe description snippet shown under the result, usually its first line or two.
videos[].channelobjectcan be nullThe channel behind it.
videos[].channel.idstringcan be nullChannel id, UC….
videos[].channel.titlestringcan be nullChannel name.
videos[].channel.handlestringcan be nullHandle without the @, e.g. BenParkes; null if YouTube shows none.
videos[].channel.urlstringcan be nullChannel page, e.g. https://www.youtube.com/@BenParkes.
videos[].channel.thumbnailstringcan be nullChannel picture URL; null when the result doesn't show one.
shortsobject[]Shorts, in result order.
shorts[].type"short"Always short.
shorts[].idstringThe Short's video id.
shorts[].urlstringhttps://www.youtube.com/shorts/<id>. Pass it to the video endpoint for likes, comments, date and length.
shorts[].titlestringThe Short's title. YouTube may translate non-English titles into English; video details has the original.
shorts[].thumbnailstringcan be nullLargest (vertical) thumbnail URL.
shorts[].viewCountTextstringcan be nullViews as YouTube shows them, e.g. "22M views".
shorts[].viewCountIntnumbercan be nullviewCountText as a number, rounded as shown (22M views → 22000000).
channelsobject[]Channels, in result order.
channels[].type"channel"Always channel.
channels[].idstringChannel id, UC…. Pass it to channel details for the full stats.
channels[].urlstringChannel page.
channels[].titlestringChannel name.
channels[].handlestringcan be nullHandle without the @; null if YouTube shows none.
channels[].thumbnailstringcan be nullChannel picture URL.
channels[].descriptionstringcan be nullThe description snippet shown in the result.
channels[].subscriberCountTextstringcan be nullSubscribers as YouTube shows them, e.g. "128K subscribers".
channels[].subscriberCountnumbercan be nullsubscriberCountText as a number, rounded as shown.
channels[].isVerifiedbooleanHas YouTube's verified or official artist badge.
playlistsobject[]Playlists and mixes, in result order.
playlists[].type"playlist"Always playlist.
playlists[].idstringPlaylist id, e.g. PLB50X6wE7gSWNQJElg3NX4AH42QoouHOk (mixes start with RD).
playlists[].urlstringPlaylist page, https://www.youtube.com/playlist?list=<id>.
playlists[].titlestringPlaylist title.
playlists[].thumbnailstringcan be nullCover thumbnail URL (its first video).
playlists[].videoCountTextstringcan be nullSize as YouTube shows it, e.g. "30 videos".
playlists[].videoCountnumbercan be nullvideoCountText as a number.
playlists[].channelobjectcan be nullThe channel behind it.
playlists[].channel.idstringcan be nullChannel id, UC….
playlists[].channel.titlestringcan be nullChannel name.
playlists[].channel.handlestringcan be nullHandle without the @, e.g. BenParkes; null if YouTube shows none.
playlists[].channel.urlstringcan be nullChannel page, e.g. https://www.youtube.com/@BenParkes.
playlists[].channel.thumbnailstringcan be nullChannel picture URL; null when the result doesn't show one.
livesobject[]Streams that are live right now.
lives[].type"video"Always video.
lives[].idstringVideo id, e.g. v9QtM6qnG50.
lives[].urlstringWatch link. Pass it to the video endpoint for likes, comments, the full description and exact views.
lives[].titlestringVideo title. YouTube may translate non-English titles into English; video details has the original.
lives[].thumbnailstringcan be nullLargest thumbnail URL.
lives[].viewCountTextstringcan be nullViews as YouTube shows them, e.g. "82M views", or "1,204 watching" while live.
lives[].viewCountIntnumbercan be nullviewCountText as a number, rounded whenever YouTube abbreviates it (82M views → 82000000). Use video details for exact views.
lives[].publishedTimeTextstringcan be nullWhen it went up, as YouTube shows it, e.g. "10 days ago". null for live and upcoming videos.
lives[].publishedTimestringcan be nullpublishedTimeText 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[].lengthTextstringcan be nullLength as shown, e.g. "19:03". null for live and upcoming videos.
lives[].lengthSecondsnumbercan be nullLength in seconds.
lives[].badgesstring[]Labels YouTube shows on the result, e.g. "4K", "CC", "New" or "LIVE". Often empty.
lives[].descriptionstringcan be nullThe description snippet shown under the result, usually its first line or two.
lives[].channelobjectcan be nullThe channel behind it.
lives[].channel.idstringcan be nullChannel id, UC….
lives[].channel.titlestringcan be nullChannel name.
lives[].channel.handlestringcan be nullHandle without the @, e.g. BenParkes; null if YouTube shows none.
lives[].channel.urlstringcan be nullChannel page, e.g. https://www.youtube.com/@BenParkes.
lives[].channel.thumbnailstringcan be nullChannel picture URL; null when the result doesn't show one.
continuationTokenstringcan be nullPass as continuationToken for the next page. null on the last page.

Cost and freshness

Each call costs 1 credit. Calls turned away before they reach the platform (invalid parameters, a key or balance problem, a rate limit) are free, and so are 5xx errors. A not_found is charged, since the platform was checked. How charging works.

Answers are cached for up to 15 minutes. A repeat call within that time can return the same data, and costs the same.

Errors

A failed call returns success: false, an error message, a code your program can check, and a docs link. These are the errors this endpoint can return. All error codes.

StatusCodeMeaning
401missing_api_keyNo API key was sent. Put it in the x-api-key header.
401invalid_api_keyThis key doesn't exist or was revoked.
402insufficient_creditsNot enough credits for this call. Buy a pack, or wait for tomorrow's free top-up.
402over_max_creditsThis call would cost more than the max_credits you set. The error says what it needs; raise max_credits to allow it. Not charged.
403account_suspendedThis account is suspended. Email support@lurkapi.com. Not charged.
405method_not_allowedEndpoints only take GET, with parameters in the URL.
429rate_limitedToo many calls in a short time. Wait as many seconds as the retry-after header says, then retry.
500internal_errorSomething broke on our side. Retry. Not charged.
502upstream_errorThe platform didn't send a usable answer. Retry. Not charged.
503upstream_busyAll our connections to the platform are busy. Retry in a few seconds. Not charged.
504upstream_timeoutThe platform took over 30 seconds to answer (90 for web pages). Retry. Not charged.

Use it in Claude

Connect LurkAPI to Claude and ask in plain English. This endpoint is the youtube_search tool. For example:

Ask Claude
Use LurkAPI's youtube_search tool with query "running shoes", then summarize what you find.

Claude calls youtube_search with arguments like these, and each call costs 1 credit:

Tool arguments
{"query": "running shoes"}

To save tokens, tool results leave out empty fields, keep one URL per image or video, and give transcripts as plain text unless you pass timestamps=true. A result over 45,000 characters comes in parts. Its _note gives the offset for the next part, and later parts are free for 15 minutes. Pass trim=false for the full response.

From the blog

All posts