ytdetail

API Reference for Developers

Getting Started

Welcome to the YouTube API documentation. This API allows you to fetch detailed information about YouTube videos, playlists, live streams, and channels using a simple URL. It supports various types of YouTube content including videos, live streams, shorts, and playlists.

Base URL :

POST

Request Parameters

Parameter Description
url (required) The YouTube URL from which you want to retrieve details.

The YouTube URLs can be of various types:

Type URL
Video URL https://www.youtube.com/watch?v=VIDEO_ID
Live Stream URL https://www.youtube.com/live/VIDEO_ID
Shorts URL https://www.youtube.com/shorts/VIDEO_ID
Playlist URL https://www.youtube.com/playlist?list=PLAYLIST_ID
Channel URL https://www.youtube.com/channel/CHANNEL_ID

OR https://www.youtube.com/@username

Response Format :

The API returns a JSON response that contains details about the requested YouTube content. Below are examples of the responses for different content types.

Example Request For Videos

Example URL : https://www.youtube.com/watch?v=dQw4w9WgXcQ

Request Parameters

Parameter Description
url (required) The YouTube URL from which you want to retrieve details.
                
fetch(`https://ytdetail.info/v1/api`, {
    method: "POST",
    body: JSON.stringify({ url: "https://www.youtube.com/watch?v=dQw4w9WgXcQ" })
}).then(res => res.json())
.then(console.log);                             

Server response

                
{
  "success": true,
  "message": "Video details fetched successfully.",
  "data": {
    "id": "dQw4w9WgXcQ",
    "title": "Rick Astley - Never Gonna Give You Up (Official Music Video)",
    "description": "The official video for “Never Gonna Give You Up” by Rick Astley. \n\nNever: The Autobiography 📚 OUT NOW! \nFollow this link to get your copy and listen to Rick’s ‘Never’ playlist ❤️ #RickAstleyNever\nhttps://linktr.ee/rickastleynever\n\n“Never Gonna Give You Up” was a global smash on its release in July 1987, topping the charts in 25 countries including Rick’s native UK and the US Billboard Hot 100.  It also won the Brit Award for Best single in 1988. Stock Aitken and Waterman wrote and produced the track which was the lead-off single and lead track from Rick’s debut LP “Whenever You Need Somebody”.  The album was itself a UK number one and would go on to sell over 15 million copies worldwide.\n\nThe legendary video was directed by Simon West – who later went on to make Hollywood blockbusters such as Con Air, Lara Croft – Tomb Raider and The Expendables 2.  The video passed the 1bn YouTube views milestone on 28 July 2021.\n\nSubscribe to the official Rick Astley YouTube channel: https://RickAstley.lnk.to/YTSubID\n\nFollow Rick Astley:\nFacebook: https://RickAstley.lnk.to/FBFollowID \nTwitter: https://RickAstley.lnk.to/TwitterID \nInstagram: https://RickAstley.lnk.to/InstagramID \nWebsite: https://RickAstley.lnk.to/storeID \nTikTok: https://RickAstley.lnk.to/TikTokID\n\nListen to Rick Astley:\nSpotify: https://RickAstley.lnk.to/SpotifyID \nApple Music: https://RickAstley.lnk.to/AppleMusicID \nAmazon Music: https://RickAstley.lnk.to/AmazonMusicID \nDeezer: https://RickAstley.lnk.to/DeezerID \n\nLyrics:\nWe’re no strangers to love\nYou know the rules and so do I\nA full commitment’s what I’m thinking of\nYou wouldn’t get this from any other guy\n\nI just wanna tell you how I’m feeling\nGotta make you understand\n\nNever gonna give you up\nNever gonna let you down\nNever gonna run around and desert you\nNever gonna make you cry\nNever gonna say goodbye\nNever gonna tell a lie and hurt you\n\nWe’ve known each other for so long\nYour heart’s been aching but you’re too shy to say it\nInside we both know what’s been going on\nWe know the game and we’re gonna play it\n\nAnd if you ask me how I’m feeling\nDon’t tell me you’re too blind to see\n\nNever gonna give you up\nNever gonna let you down\nNever gonna run around and desert you\nNever gonna make you cry\nNever gonna say goodbye\nNever gonna tell a lie and hurt you\n\n#RickAstley #NeverGonnaGiveYouUp #WheneverYouNeedSomebody #OfficialMusicVideo",
    "thumbnail": "https://i.ytimg.com/vi/dQw4w9WgXcQ/hqdefault.jpg",
    "publishDate": "2009-10-25T06:57:33Z",
    "viewCount": "1618664904",
    "likeCount": "18144026",
    "isVideo": true,
    "channel": {
      "channelName": "Rick Astley",
      "channelDescription": "Never: The Autobiography -  Out now 📚",
      "avatar": "https://yt3.ggpht.com/K2ecE5j90a_DFzugHo0bW98vFlIQ1JJgs9mbcav7RGy1t7adJRnd2jaIv-oc6XzTRvDdWlFCAfc=s800-c-k-c0x00ffffff-no-rj",
      "banner": "https://yt3.googleusercontent.com/v5Ailm2IkPeL21z9nr-1XKPXlEJtMOf0D68JlJADSel-feqiwc6pr5IkuaZl1AudBlZRHHS5",
      "subscribers": "4240000"
    }
  }
}                              

Error Responses

If there is an issue with the URL or if the content is not found, the API will return an error response.
              
{
  "success": false,
  "message": "Invalid YouTube URL. Please provide a valid video, playlist, or channel URL."
}                                     

Note :

The API supports GET requests only.

You must provide a valid YouTube URL as the url parameter.

The API returns structured data in JSON format, which can be easily integrated into your application.

Use Cases :

Video Aggregators: Fetch video details like title, description, and thumbnail to display in a gallery or feed.

Live Stream Dashboards: Get live stream details including the number of concurrent viewers and start time.

Playlist Integrations: Display playlists and their videos with titles, descriptions, and thumbnails.

Channel Info: Retrieve channel information to display channel details like name, description, and avatar.

Start integrating YouTube content into your app with ease using our YouTube API!