Skip to main content

Documentation Index

Fetch the complete documentation index at: https://mintlify.com/vsmutok/ytscrape/llms.txt

Use this file to discover all available pages before exploring further.

YouTube.channel() fetches detailed metadata for a single YouTube channel and returns a ChannelDetails dataclass. It accepts a raw UC… channel id, an @handle, or any standard channel URL — all formats are resolved automatically.

Calling yt.channel()

from ytscrape import YouTube

with YouTube() as yt:
    # Channel id
    details = yt.channel("UCuAXFkgsw1L7xaCfnd5JJOw")

    # @handle
    details = yt.channel("@RickAstleyYT")

    # Full channel URL
    details = yt.channel("https://www.youtube.com/@RickAstleyYT")

Supported input formats

FormatExample
UC… channel idUCuAXFkgsw1L7xaCfnd5JJOw
@handle@RickAstleyYT
/channel/UC… URLhttps://www.youtube.com/channel/UCuAXFkgsw1L7xaCfnd5JJOw
/@handle URLhttps://www.youtube.com/@RickAstleyYT
/c/name URLhttps://www.youtube.com/c/RickAstleyYT
/user/name URLhttps://www.youtube.com/user/RickAstleyVEVO

Full example

The snippet below mirrors the official examples/08_channel_details.py example and shows every commonly used field:
from ytscrape import YouTube

with YouTube() as yt:
    # A channel id, @handle or any channel URL all work.
    details = yt.channel("https://www.youtube.com/@CodeBrux")

    print(f"Title:        {details.title}")
    print(f"Handle:       {details.handle}")
    print(f"Subscribers:  {details.subscribers}")
    print(f"Videos:       {details.video_count}")
    print(f"Views:        {details.view_count}")
    print(f"Country:      {details.country}")
    print(f"Joined:       {details.joined_date}")
    print(f"Family safe:  {details.is_family_safe}")
    print(f"Photo:        {details.photo}")
    print(f"Banner:       {details.banner}")
    print(f"Keywords:     {', '.join(details.keywords[:5])}")
    print(f"URL:          {details.url}")
    print(f"Vanity URL:   {details.vanity_url}")
    print(f"RSS:          {details.rss_url}")

    if details.links:
        print(f"Links:        {details.links}")
    if details.description:
        print(f"Description:  {details.description[:120]}...")
links is a dict[str, str] mapping a platform name to its URL. The keys are derived from the link titles and URLs that the channel owner has added to their profile. Well-known platforms — x, instagram, tiktok, facebook, spotify, discord, patreon, github, and others — get a predictable lowercase key. Custom links fall back to a slugified version of their title.
with YouTube() as yt:
    details = yt.channel("@RickAstleyYT")
    print(details.links)
    # e.g. {"x": "https://twitter.com/rickastley", "instagram": "https://instagram.com/..."}

    # Access a specific platform safely
    twitter = details.links.get("x")
If a channel has no external links, links is an empty dictionary.

Field reference

ChannelDetails is a frozen dataclass. All fields are listed below.
FieldTypeDescription
channel_idstrUC… channel id
titlestr | NoneChannel display name
descriptionstr | NoneChannel description
handlestr | None@handle when available
subscribersstr | NoneSubscriber count as rendered by YouTube (e.g. "1.23M subscribers")
video_countstr | NoneNumber of public videos
view_countstr | NoneTotal channel view count
keywordstuple[str, ...]Channel keywords / tags
tagstuple[str, ...]Microformat tags (may overlap with keywords)
thumbnailstr | NoneChannel avatar URL (alias for photo)
photostr | NoneChannel avatar URL
bannerstr | NoneChannel banner image URL
vanity_urlstr | NoneCustom vanity URL (e.g. https://www.youtube.com/@RickAstleyYT)
rss_urlstr | NoneRSS feed URL for the channel’s public videos
is_family_safebool | NoneWhether YouTube marks the channel as family-safe
available_countriestuple[str, ...]ISO 3166-1 alpha-2 country codes where the channel is available
countrystr | NoneCountry the channel is registered in
joined_datestr | NoneJoin date as rendered by YouTube (e.g. "Joined Oct 24, 2010")
linksdict[str, str]External social / website links — {"x": "…", "instagram": "…"}
urlstrCanonical https://www.youtube.com/channel/UC… URL (computed property)
Inputs that use a handle or a /c///user/ vanity path require an extra HTTP request to resolve the UC… channel id before the metadata request can be made. Passing the raw UC… id directly skips this lookup and is marginally faster.

Build docs developers (and LLMs) love