GET
/
youtube
/
video
import { Supadata } from '@supadata/js';

const supadata = new Supadata({
apiKey: 'YOUR_API_KEY',
});
const video = await supadata.youtube.video({
id: 'https://youtu.be/dQw4w9WgXcQ', // can be id or url
});
console.log(video.title);
{
  "id": "dQw4w9WgXcQ",
  "title": "Rick Astley - Never Gonna Give You Up (Official Music Video)",
  "description": "The official music video for \"Never Gonna Give You Up\"...",
  "duration": 213,
  "channel": {
    "id": "UCuAXFkgsw1L7xaCfnd5JJOw",
    "name": "Rick Astley"
  },
  "tags": [
    "Rick Astley",
    "Official Video",
    "Music"
  ],
  "thumbnail": "https://i.ytimg.com/vi/dQw4w9WgXcQ/hqdefault.jpg",
  "uploadDate": "2009-10-25T00:00:00.000Z",
  "viewCount": 1234567890,
  "likeCount": 12345678,
  "transcriptLanguages": [
    "en",
    "es",
    "fr"
  ]
}

Authorizations

x-api-key
string
header
required

Query Parameters

id
string
required

YouTube video URL or ID. See supported URL formats.

Examples:

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

"dQw4w9WgXcQ"

Response

Successfully fetched video metadata

id
string
required

YouTube video ID

Example:

"dQw4w9WgXcQ"

title
string
required

Video title

Example:

"Rick Astley - Never Gonna Give You Up (Official Music Video)"

description
string
required

Video description

Example:

"The official music video for \"Never Gonna Give You Up\"..."

duration
number
required

Video duration in seconds

Example:

213

channel
object
required

Channel information

tags
string[]
required

Video tags

Example:
["Rick Astley", "Official Video", "Music"]
transcriptLanguages
string[]
required

Available transcript language codes

Example:
["en", "es", "fr"]
thumbnail
string

URL to video thumbnail

Example:

"https://i.ytimg.com/vi/dQw4w9WgXcQ/hqdefault.jpg"

uploadDate
string<date-time> | null

Video upload date

Example:

"2009-10-25T00:00:00.000Z"

viewCount
number | null

Number of views

Example:

1234567890

likeCount
number | null

Number of likes

Example:

12345678