YouTube Videos API
The YouTube Videos API retrieves videos from a YouTube channel or playlist, returning detailed information about each video including metadata, view counts, and video URLs.
Endpoint
https://api.socialkit.dev/youtube/videosExample Request
GET https://api.socialkit.dev/youtube/videos?access_key=<your-access-key>&url=https://www.youtube.com/@MrBeast&limit=2Response
{
"success": true,
"data": {
"type": "channel",
"url": "https://www.youtube.com/@MrBeast",
"results": [
{
"videoId": "dQw4w9WgXcQ",
"title": "I Built 100 Houses And Gave Them Away!",
"thumbnail": "https://i.ytimg.com/vi/dQw4w9WgXcQ/hq720.jpg",
"channelName": "MrBeast",
"channelId": "UCX6OQ3DkcsbYNE6H8uQQuVA",
"duration": "18:22",
"index": 1,
"views": 95000000,
"viewsFormatted": "95M views",
"publishedTime": "2 weeks ago",
"url": "https://www.youtube.com/watch?v=dQw4w9WgXcQ"
},
{
"videoId": "tpiyEe_CqB4",
"title": "Would You Sit In A Tank Of Snakes For $10,000?",
"thumbnail": "https://i.ytimg.com/vi/tpiyEe_CqB4/hq720.jpg",
"channelName": "MrBeast",
"channelId": "UCX6OQ3DkcsbYNE6H8uQQuVA",
"duration": "21:05",
"index": 2,
"views": 120000000,
"viewsFormatted": "120M views",
"publishedTime": "1 month ago",
"url": "https://www.youtube.com/watch?v=tpiyEe_CqB4"
}
]
}
}Parameters
url string Required
The YouTube channel or playlist URL to retrieve videos from. Supports channel URLs (e.g., https://www.youtube.com/@ChannelName) and playlist URLs (e.g., https://www.youtube.com/playlist?list=PLxxxxxx).
access_key string Required
Your API access key. Can be provided via the access_key query parameter, x-access-key header, or request body.
limit number Optional Defaults to 10
Number of videos to return. Maximum value is 100.
cache boolean Optional Defaults to false
Cache the response for faster subsequent requests.
cache_ttl number Optional Defaults to 2592000
Cache the response for a custom TTL (in seconds). Maximum 2592000 seconds (1 month), minimum 3600 seconds (1 hour).
Response Fields
The response includes:
type: Source type — either"playlist"or"channel"url: The original URL that was queried
Each result in the results array contains:
videoId: Unique YouTube video identifiertitle: Video titlethumbnail: URL to the video thumbnail imagechannelName: Name of the channel that uploaded the videochannelId: Unique identifier of the channelduration: Video duration in HH:MM:SS or MM:SS formatindex: Position of the video in the channel/playlistviews: Number of video views (number)viewsFormatted: Human-readable view count (e.g., “95M views”)publishedTime: Relative time when the video was published (e.g., “2 weeks ago”)url: Direct URL to the YouTube video
Use Cases
- Channel Analysis: Get a complete list of videos from any YouTube channel
- Playlist Extraction: Retrieve all videos from a YouTube playlist
- Content Audit: Analyze a channel’s video catalog and performance
- Competitor Monitoring: Track competitors’ latest uploads and view counts
- Research & Curation: Collect videos from specific channels or playlists for analysis
- Trend Tracking: Monitor a channel’s recent content and engagement patterns
- Bulk Processing: Fetch video IDs for further analysis with other endpoints (stats, comments, transcripts)
Notes
- The
typefield indicates whether the URL was detected as a playlist or channel - The
indexfield reflects the video’s position in the playlist or channel upload order - For channels, videos are typically returned in reverse chronological order (newest first)
- For playlists, videos are returned in playlist order