YepAPI
YouTube API

Related Videos

Get related/recommended videos for any YouTube video.

POST/v1/youtube/related
$0.01/call

Usage

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

Request Body

ParameterTypeRequiredDescriptionDefault
idstringYesYouTube video ID
tokenstringNoContinuation token for pagination

Response

{
  "ok": true,
  "data": {
    "meta": {
      "videoId": "dQw4w9WgXcQ",
      "title": "Rick Astley - Never Gonna Give You Up",
      "viewCount": "1756095483",
      "channelTitle": "Rick Astley"
    },
    "data": [
      {
        "type": "video",
        "videoId": "abc123",
        "title": "Related Video Title",
        "channelTitle": "Channel Name",
        "viewCount": "5000000",
        "lengthText": "4:12"
      }
    ]
  }
}

Response Fields

FieldTypeDescription
okbooleanWhether the request succeeded
data.metaobjectMetadata about the source video
data.meta.videoIdstringYouTube video ID of the source video
data.meta.titlestringTitle of the source video
data.meta.viewCountstringTotal view count of the source video
data.meta.channelTitlestringChannel name of the source video
data.dataobject[]Array of related video results
data.data[].typestringContent type (e.g., video)
data.data[].videoIdstringYouTube video ID of the related video
data.data[].titlestringTitle of the related video
data.data[].channelTitlestringChannel name of the related video
data.data[].viewCountstringView count of the related video
data.data[].lengthTextstringVideo duration in human-readable format

On this page