YouTube Video Details API - Exact Counts and Availability
Documentation menu
FetchLayer FetchLayer API

Get YouTube video details

Full details for one video by ID or URL: title, description, tags, channel, exact view/like/comment counts, publish date, duration, thumbnails and availability (unlisted, age-restricted, members-only, live/upcoming, countries). A private, deleted or unknown video is a 404, never an empty record.

POST /video Videos and channels
https://api.fetchlayer.dev/youtube/video
OpenAPI JSON

Headers

Authorization string required

Bearer token — your FetchLayer API key.

Parameters

video string required

A YouTube video ID (e.g. dQw4w9WgXcQ) or any video URL, including youtu.be and Shorts links.

format string optional

json or markdown, lowercase; any other value is a 400. Over MCP, markdown returns the result rendered as text; the REST API accepts it and returns JSON. (default: json)

Response Fields

video

Get YouTube video details

entityType string

Always youtube-video.

videoId string

The 11-character video ID.

url string

The video’s watch URL.

title string

The video title.

description string

The full description.

keywords string[]

The tags the uploader set; [] when none.

category string | null

YouTube’s category for the video, e.g. Music.

channel object

The channel that published it: id, name, handle (or null) and url.

viewCount integer | null

Exact view count.

likeCount integer | null

Exact like count; null when the owner hides likes.

commentCount integer | null

Exact comment count; null when comments are turned off or the count is not shown.

publishedAt string | null

When the video was published (ISO 8601, with a UTC offset).

uploadedAt string | null

When the video was uploaded (ISO 8601, with a UTC offset).

durationSeconds integer | null

Length in seconds; null for a live stream in progress.

thumbnails object[]

Thumbnail images, each with url, width and height.

availability object

Who can watch it and how.

availability.visibility string

public or unlisted. Private and deleted videos are a 404.

availability.isAgeRestricted boolean

Viewers must sign in and confirm their age.

availability.isMembersOnly boolean

Only paying channel members can watch.

availability.isFamilySafe boolean

Marked suitable for all audiences.

availability.isRegionRestricted boolean

Not available in every country; see availableCountries.

availability.availableCountries string[]

ISO 3166-1 alpha-2 codes of the countries where it can be watched.

availability.isLiveContent boolean

A live stream or premiere, past, current or scheduled.

availability.isLiveNow boolean

Live right now.

availability.isUpcoming boolean

Scheduled and not started yet.

availability.commentsVisible boolean

The comment section is publicly visible (false when turned off or members-only).

availability.ratingsEnabled boolean

Likes can be given.

live object | null

For live content: scheduledStartAt, startedAt and endedAt (ISO 8601, each null when not known); null for an ordinary video.

notes string[]

Caveats about this result; [] when none.

scrapedAt string

When the result was produced (ISO 8601).

Request

curl -X POST "https://api.fetchlayer.dev/youtube/video" \
  -H "Authorization: Bearer ss-your-key" \
  -H "Content-Type: application/json" \
  -d '{"video":"dQw4w9WgXcQ"}'

Response

{
  "entityType": "youtube-video",
  "videoId": "dQw4w9WgXcQ",
  "url": "https://www.youtube.com/watch?v=dQw4w9WgXcQ",
  "title": "Rick Astley - Never Gonna Give You Up (Official Video) (4K Remaster)",
  "keywords": [
    "rick astley",
    "Never Gonna Give You Up",
    "nggyu"
  ],
  "category": "Music",
  "channel": {
    "id": "UCuAXFkgsw1L7xaCfnd5JJOw",
    "name": "Rick Astley",
    "handle": "@RickAstleyYT",
    "url": "https://www.youtube.com/channel/UCuAXFkgsw1L7xaCfnd5JJOw"
  },
  "viewCount": 1828910987,
  "likeCount": 19491707,
  "commentCount": 2460215,
  "publishedAt": "2009-10-24T23:57:33-07:00",
  "uploadedAt": "2009-10-24T23:57:33-07:00",
  "durationSeconds": 213,
  "thumbnails": [
    {
      "url": "https://i.ytimg.com/vi/dQw4w9WgXcQ/hqdefault.jpg",
      "width": 168,
      "height": 94
    }
  ],
  "availability": {
    "visibility": "public",
    "isAgeRestricted": false,
    "isMembersOnly": false,
    "isFamilySafe": true,
    "isRegionRestricted": false,
    "availableCountries": [
      "US",
      "GB"
    ],
    "isLiveContent": false,
    "isLiveNow": false,
    "isUpcoming": false,
    "commentsVisible": true,
    "ratingsEnabled": true
  },
  "live": null,
  "notes": []
}