YepAPI
YouTube API

Trending Videos

Get trending YouTube videos by country and category.

POST/v1/youtube/trending
$0.01/call

Usage

const res = await fetch('https://api.yepapi.com/v1/youtube/trending', {
  method: 'POST',
  headers: {
    'x-api-key': 'YOUR_API_KEY',
    'Content-Type': 'application/json',
  },
  body: JSON.stringify({ geo: 'US', type: 'now' }),
});
const { data } = await res.json();
console.log(data.data); // array of trending videos
curl -X POST https://api.yepapi.com/v1/youtube/trending \
  -H "x-api-key: YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"geo": "US", "type": "now"}'

Request Body

ParameterTypeRequiredDescriptionDefault
geostringNoCountry code (e.g. US, GB, IN)
typestringNoCategory: now, music, gaming, moviesnow
langstringNoLanguage code

Response

{
  "ok": true,
  "data": {
    "data": [
      {
        "type": "video",
        "videoId": "XelMqi0jlvk",
        "title": "Christmas Songs Playlist - Top 2 Hour Christmas Songs",
        "channelId": "UCn0JHLJWiO3_Y5xfNPcF_Ug",
        "channelTitle": "Christmas Songs and Carols - Love to Sing",
        "description": "Enjoy the festive classic Top Christmas Songs...",
        "viewCount": "15200000",
        "commentCount": "61",
        "likeCount": "85000",
        "publishedTimeText": "3 months ago",
        "publishedAt": "2026-01-13T00:00:00Z",
        "lengthText": "2:05:32",
        "thumbnail": [
          { "url": "https://i.ytimg.com/vi/XelMqi0jlvk/hq720.jpg", "width": 720, "height": 404 }
        ],
        "richThumbnail": [
          { "url": "https://i.ytimg.com/an_webp/XelMqi0jlvk/mqdefault_6s.webp", "width": 320, "height": 180 }
        ]
      }
    ]
  }
}

Response Fields

FieldTypeDescription
okbooleanWhether the request succeeded
data.dataobject[]Array of trending video results
data.data[].typestringContent type (always video for trending)
data.data[].videoIdstringUnique YouTube video identifier
data.data[].titlestringVideo title as displayed on YouTube
data.data[].channelIdstringUnique identifier for the channel
data.data[].channelTitlestringName of the channel that uploaded the video
data.data[].descriptionstringFull video description text
data.data[].viewCountstringTotal view count as a numeric string
data.data[].commentCountstringTotal number of comments
data.data[].likeCountstringTotal number of likes
data.data[].publishedTimeTextstringRelative publish time (e.g. 3 months ago)
data.data[].publishedAtstringPublish date as ISO 8601 timestamp
data.data[].lengthTextstringVideo duration in H:MM:SS or MM:SS format
data.data[].thumbnailobject[]Video thumbnail images at various resolutions
data.data[].richThumbnailobject[]Animated preview thumbnail (webp format)
data.data[].channelThumbnailobject[]Channel avatar images

On this page