How to list a YouTube channel's Shorts in Python
Checked on 2026-11-24.
The official YouTube Data API cannot list a channel's Shorts: nothing in its documentation marks a video as a Short. You can get close by filtering a channel's uploads by length and shape, or you can read the channel's Shorts tab, with yt-dlp or with an HTTP API. All three routes are below, with code and with where each one stops.
1. The official API: no Shorts flag
The video resource has no property that says a video is a Short. A channel's relatedPlaylists lists likes, uploads and a deprecated favorites, and no Shorts playlist. In search.list, videoDuration=short means "Only include videos that are less than four minutes long", which is a length filter, not a Shorts filter. The revision history added one Shorts-specific item on 3 November 2026, a shortsAspectRatio thumbnail size, but it is "available for YouTube Shorts that have a custom thumbnail set", so a Short without one looks like any other video.
What YouTube counts as a Short is in its help center: on a standard channel, "Any videos uploaded on or after this date with a square or vertical aspect ratio up to three minutes in length", the date being 15 October 2024. Videos uploaded before that date "will remain the same", so older square or vertical uploads longer than a minute stay long-form videos. Official Artist Channels have the three-minute rule from 8 December 2025.
The documented fields can approximate that rule. The uploads playlist "contains the channel's uploaded videos", and by YouTube's definition a Short is one of them; videos.list returns each video's length in contentDetails.duration. Its shape is harder: fileDetails, which has the aspect ratio, "can only be retrieved by the video owner". What remains is the embed player. When you pass maxWidth, player.embedWidth and player.embedHeight are returned only if "the video's aspect ratio is known", so a player at least as tall as it is wide points to a square or vertical video.
import os
import re
import requests
API = "https://www.googleapis.com/youtube/v3"
key = os.environ["YOUTUBE_API_KEY"]
def seconds(iso): # contentDetails.duration, such as PT2M41S
d, h, m, s = re.fullmatch(r"P(?:(\d+)D)?(?:T(?:(\d+)H)?(?:(\d+)M)?(?:(\d+)S)?)?", iso).groups(default="0")
return ((int(d) * 24 + int(h)) * 60 + int(m)) * 60 + int(s)
channel = requests.get(f"{API}/channels", params={"part": "contentDetails", "forHandle": "@MrBeast", "key": key}, timeout=30).json()
uploads = channel["items"][0]["contentDetails"]["relatedPlaylists"]["uploads"]
# The latest 50 uploads; follow nextPageToken for more
page = requests.get(f"{API}/playlistItems", params={"part": "contentDetails", "playlistId": uploads, "maxResults": 50, "key": key}, timeout=30).json()
ids = ",".join(item["contentDetails"]["videoId"] for item in page["items"])
videos = requests.get(f"{API}/videos", params={"part": "snippet,contentDetails,player", "id": ids, "maxWidth": 360, "key": key}, timeout=30).json()
for video in videos["items"]:
length = seconds(video["contentDetails"]["duration"])
limit = 180 if video["snippet"]["publishedAt"] >= "2024-10-15" else 60
width, height = video["player"].get("embedWidth"), video["player"].get("embedHeight")
upright = width is not None and height is not None and int(height) >= int(width)
if length <= limit and upright:
print(video["id"], length, video["snippet"]["title"])Each of these calls costs 1 quota unit of the 10,000 a project gets per day, so even a channel with thousands of uploads is cheap to scan.
Where it stops: this is your own inference from documented fields, not an answer from YouTube. Google does not describe the embed size as a way to find Shorts, so check the filter against a few Shorts you know before you rely on it. publishedAt "might be different than the time that the video was uploaded", which can misjudge videos uploaded around the cut-off date, and the dates differ for Official Artist Channels. Tutorials that build a "Shorts playlist" ID out of the channel ID use something the documentation does not list: it may work on the day you try it and change without notice.
2. yt-dlp: the Shorts tab, no key
yt-dlp reads YouTube's own pages. Its README says "Channel URLs download all uploads of the channel, including shorts and live", and its test cases include a channel's Shorts tab by handle, such as https://www.youtube.com/@NotJustBikes/shorts. The README's embedding example, with the option behind --flat-playlist, lists the tab without opening each video:
# pip install yt-dlp
import yt_dlp
with yt_dlp.YoutubeDL({"extract_flat": "in_playlist", "quiet": True}) as ydl:
info = ydl.extract_info("https://www.youtube.com/@MrBeast/shorts", download=False)
for entry in info["entries"]:
print(entry["id"], entry.get("view_count"), entry.get("title"))In this flat mode yt-dlp's source gives each entry its ID, address, title, thumbnails and a view count read from the tab's label, so it is rounded the way the tab shows it. There is no upload date: the README warns that with --flat-playlist "some entry metadata may be missing", and the date needs a full extraction of each Short.
Where it breaks: it depends on pages YouTube does not document, so it needs updates when they change; keep it current (release 2026.11.23 came out the day before this guide was checked). Opening every Short for its details counts against YouTube's limits: yt-dlp's wiki puts the rate limit for guest sessions at "~300 videos/hour (~1000 webpage/player requests per hour)".
3. An HTTP API: the Shorts tab in one request
With Pipefetch one request takes a handle, a channel ID or a channel URL and returns the channel's latest Shorts, newest first.
import os
import requests
res = requests.get(
"https://pipefetch.com/v1/youtube/channel/shorts",
params={"channel": "@MrBeast", "limit": 40},
headers={"x-api-key": os.environ["PIPEFETCH_API_KEY"]},
timeout=90,
)
if res.status_code == 404:
print(res.json()["error"]["code"]) # no_shorts or channel_not_found: not charged
else:
res.raise_for_status()
data = res.json()["data"]
print(data["channel"]["name"], data["channel"]["id"])
for short in data["shorts"]:
print(short["videoId"], short["viewCount"], short["title"])Some fields of an answer saved on 18 November 2026:
{
"channel": { "id": "UCX6OQ3DkcsbYNE6H8uQQuVA", "name": "MrBeast" },
"shorts": [
{
"videoId": "sHpEqeSByPI",
"url": "https://www.youtube.com/shorts/sHpEqeSByPI",
"title": "Unboxing The World’s Largest Toy",
"viewCount": 22000000,
"viewCountIsExact": false
}
]
}A request costs 1 credit for up to 40 Shorts, and there are no further pages. A channel without Shorts answers 404 and costs nothing. The view counts are the rounded ones the Shorts tab displays (22M), and the list has no publish date, likes or length, because the tab does not show them. The reference lists every field.
For exact numbers, pass a Short's link to the video endpoint (1 credit each), or hand the IDs to the official videos.list, which takes a comma-separated list of IDs in one call for 1 quota unit:
ids = ",".join(short["videoId"] for short in data["shorts"])
stats = requests.get(
"https://www.googleapis.com/youtube/v3/videos",
params={"part": "snippet,statistics", "id": ids, "key": os.environ["YOUTUBE_API_KEY"]},
timeout=30,
).json()
for video in stats["items"]:
print(video["id"], video["snippet"]["publishedAt"], video["statistics"]["viewCount"])Where it stops: the latest 40 Shorts, not a channel's whole history. It is not an official API, and Pipefetch is not affiliated with YouTube or Google. Most requests take 2 to 9 seconds; when YouTube does not answer you get a 502 that costs nothing and can be retried. A new account has 100 free credits and needs no card.
Which one should you use?
| You need | Use |
|---|---|
| Every Short a channel ever uploaded, and you accept an approximation | The official API with the length and shape filter |
| The Shorts tab as YouTube shows it, on your own computer | yt-dlp |
| The latest Shorts of a handle in one request, from a server | An HTTP API such as Pipefetch |
| Exact views, likes and dates of Shorts whose IDs you have | The official videos.list, or the Pipefetch video endpoint |
For a channel's regular uploads, the guide to listing a channel's videos covers the RSS feed and the uploads playlist.
Why Shorts view counts jumped
If you compare Shorts numbers over time, know that YouTube changed how they are counted. From 31 March 2025, in the words of the revision history, "views will count the number of times your Short starts to play or replay, with no minimum watch time requirement", and videos.statistics.viewCount follows that rule. Entries of 27 August and 16 November 2026 extended it to every format: the video resource now says that for long-form videos, Live and Shorts alike, viewCount "counts views the moment a video begins to play" and includes co-views of people watching together on a television screen. A count read before those changes is not comparable with one read after.
Try it with 100 free credits. No card needed. No Google Cloud project or OAuth. Get an API key or read the docs.
APIs used in this guide
-
1 credit
YouTube Video API
Exact views, likes and comment count, description, tags, chapters and channel for one video.
GET /v1/youtube/video -
1 credit
YouTube Channel Videos API
The latest uploads of a channel, newest first, with views, duration and publish time.
GET /v1/youtube/channel/videos -
1 credit
YouTube Shorts API
The Shorts of a channel, newest first, with view counts and thumbnails.
GET /v1/youtube/channel/shorts
More YouTube guides
- How to get a YouTube transcript in Python
- How to get a YouTube transcript in Node.js
- YouTube API quota exceeded: what the error means and how to fix it
- How to find a YouTube channel ID from a handle or URL
- How to download YouTube subtitles as SRT or VTT
- youtube-transcript-api RequestBlocked or IpBlocked: why it happens and how to fix it
- How to get YouTube comments in Python
- How to search YouTube from Python
- How to list a YouTube channel's videos in Python
- How to summarize a YouTube video with an LLM in Python
- How to get YouTube transcripts and video stats in Google Sheets
- How to get YouTube video views and likes in Python
- How to get YouTube transcripts in n8n, Make and Zapier
- LangChain YoutubeLoader fails on a server: why, and a loader that works
- How to get a YouTube channel's subscriber count in Python
- How to give Claude or Cursor access to YouTube (MCP server)
- How to get YouTube comments in Node.js
- How to analyze YouTube comments with an LLM in Python
- How to search YouTube from JavaScript
Guides for other sources
Every source
- How to get an Instagram follower count in Python
- Instagram Basic Display API alternatives: what to use after the shutdown
- Instaloader 401 Unauthorized, 429 and "Login required": what to do
- How to calculate an Instagram engagement rate in Python
- How to get an Instagram follower count in Node.js
- How to get Instagram follower counts in Google Sheets
- How to get Instagram Reel views in Python
Websites
- Clearbit Logo API alternatives: get a company logo from its domain
- How to extract email addresses from a website in Python
- How to turn a web page into Markdown in Python
- How to detect what a website is built with, in Python
- How to get the contact emails and phone numbers of websites in Google Sheets
- How to build a LangChain tool that reads web pages and searches Google
- How to turn a web page into Markdown in JavaScript for RAG
- How to extract social media links from a website in Python
- How to get a website's favicon in Python
- How to check robots.txt in Python before you fetch a page
TikTok
- How to get a TikTok video's views and likes in Python
- How to get the comments of a TikTok video in Python
- How to get a TikTok follower count in Python
- TikTok Research API: who can get access, and what to do if you cannot
- How to get TikTok video views, likes and shares in Node.js
- How to get TikTok views, likes and follower counts in Google Sheets
- How to get a Facebook Page's posts without app review
- Is there a Facebook Marketplace API?
- Facebook Groups API alternatives after its removal in 2024
- How to get a Facebook Page's follower count and contact details in Python
- How to get Google search results in Python
- pytrends 429 TooManyRequestsError: what it means and what to do
- How to get Google Trends data in Python
- Why is Wyoming first in Google Trends?
- How to get Google search results in Node.js
- How to get Google search results into Google Sheets
- How to give an LLM live Google results with tool calling
Threads
- How to get LinkedIn company data in Python
- How to search LinkedIn jobs from Python
- How to get a LinkedIn company page's latest posts in Python