SerpBase
Back to Blog

YouTube Shorts Search API: Find Shorts by Keyword as JSON

YouTube search results already include Shorts: keep the /shorts/ links to get each Short's ID, title and view count. Three keywords tested, 80 Shorts found.

December 1, 2026
By SerpBase Team2 min read

Short answer: Shorts come back in ordinary /youtube/search results; keep the items whose link contains /shorts/. In three keyword searches on 1 December 2026, 25 to 30 of every 35 to 44 results were Shorts, each with its video ID, title, view count and thumbnail.

The request

curl -X POST 'https://api.serpbase.dev/youtube/search' \
  -H 'Content-Type: application/json' \
  -H 'X-API-Key: YOUR_API_KEY' \
  -d '{"q":"easy pasta recipe"}'

What came back

QueryResults in videosShortsRegular videos
funny cats443014
easy pasta recipe352510
satisfying videos382513

YouTube mixes them: for "easy pasta recipe" the first five results were Shorts, then three regular videos, then twenty more Shorts.

A Short and a regular video side by side:

{
  "id": "4h4nP40C0io",
  "link": "https://www.youtube.com/shorts/4h4nP40C0io",
  "title": "Easy Pasta Recipe | 15-Minute Pasta Recipe 🍝",
  "views_count": "26000000",
  "media": [{"type": "thumbnail", "url": "https://i.ytimg.com/vi/4h4nP40C0io/frame0.jpg"}]
}
{
  "id": "6tMZNYQkycI",
  "link": "https://www.youtube.com/watch?v=6tMZNYQkycI",
  "title": "10 Easy Pasta Recipes",
  "views_count": "1262377",
  "duration": "12:52",
  "published_at": "5y ago",
  "description": "10 easy and delicious pasta recipes that anyone can make at home. ...",
  "channel": {"id": "UCqZ8IpRdoyQ3Qj0ogpUniAA", "title": "The Cooking Foodie", "verified": true}
}

Shorts carry fewer fields: none of the 80 Shorts we got had channel, duration, published_at or description, while the regular videos had all four.

Python: only the Shorts, most viewed first

import requests

r = requests.post(
    "https://api.serpbase.dev/youtube/search",
    headers={"X-API-Key": "YOUR_API_KEY"},
    json={"q": "easy pasta recipe"},
    timeout=60,
).json()
if r["status"] != 0:
    raise SystemExit(r.get("error"))

shorts = [v for v in r["videos"] if "/shorts/" in v["link"]]
shorts.sort(key=lambda v: int(v.get("views_count") or 0), reverse=True)
for v in shorts[:10]:
    print(v["views_count"], v["id"], v["title"])

Things that trip people up

  • views_count is a string. It is a plain number in a string ("26000000"); convert it before sorting, as above.
  • The Short's ID works as a normal video ID. https://www.youtube.com/watch?v=4h4nP40C0io opens the same clip, so you can store Shorts and regular videos in one table keyed by id.
  • The thumbnail is a frame. Shorts use frame0.jpg, the first frame, rather than a designed cover.
  • For the creator, use a second lookup. Search results do not name the channel on Shorts; if you need it, open the video page or match it from another source.

Related

Cost and docs

A YouTube search is 1 credit and needs no YouTube Data API quota. Failed requests are not charged, and new accounts get 500 free credits.