YouTube Video API

Truy cập dữ liệu mở rộng của video YouTube, bao gồm thông tin video, bình luận, thống kê, tương tác và kiểm tra bằng AI.

Lấy API Key Mua tín dụng
Bạn có thể làm gì?
Dữ liệu video chi tiết

Lấy tiêu đề, mô tả, ngày xuất bản, thời lượng, danh mục, ngôn ngữ và nhiều hơn nữa.

Thống kê và tương tác

Truy xuất lượt xem, lượt thích và số bình luận, tính tỷ lệ tương tác.

Kiểm tra bằng AI

Nhận đề xuất dựa trên GPT để cải thiện SEO và tương tác cho video của bạn.

Dùng thử trực tiếp
99.9 % Thời gian hoạt động
59ms Phản hồi
20 req/s
0.009 Tín dụng / yêu cầu

Basic Information


POST https://api.yeb.to/v1/youtube/video/information
Tham sốLoạiBắt buộcMô tả
api_key string Your API key
video string Video ID (11 chars) **or** full YouTube URL

Ví dụ

curl -X POST https://api.yeb.to/v1/youtube/video/information \
  -H "Content-Type: application/json" \
  -d '{"api_key":"YOUR_KEY","video":"dQw4w9WgXcQ"}'

Ví dụ phản hồi

{
  "video": {
    "id":           "dQw4w9WgXcQ",
    "title":        "Rick Astley – Never Gonna Give You Up",
    "description":  "The official video for…",
    "duration":     "PT3M32S",
    "publishedAt":  "1987-10-25T00:00:00Z",
    "categoryId":   "10",
    "categoryName": "Music",
    "channelId":    "UCuAXFkgsw1L7xaCfnd5JJOw",
    "channelTitle": "Official Rick Astley",
    "statistics": {
      "viewCount":    "1 440 000 000",
      "likeCount":    "15 600 000",
      "commentCount": "1 900 000"
    },
    "thumbnails": { … },
    "contentDetails": { … },
    "snippet": { … }
  }
}
{"error":"Video not found","code":404}

Mã phản hồi

Mô tả
200 SuccessYêu cầu xử lý thành công.
400 Bad RequestXác thực đầu vào thất bại.
401 UnauthorizedAPI Key thiếu hoặc sai.
403 ForbiddenKey không hoạt động hoặc không được phép.
429 Rate LimitQuá nhiều yêu cầu.
500 Server ErrorLỗi không mong đợi.

Information

youtube/video/information 0.0090 credits

Parameters

API Key
body · string · required
Video
body · string · required

Code Samples


                
                
                
            

Response

Status:
Headers

                
Body

                

Video Tags


POST https://api.yeb.to/v1/youtube/video/tags
Tham sốLoạiBắt buộcMô tả
api_key string Your API key
video string Video ID or URL

Ví dụ

curl -X POST https://api.yeb.to/v1/youtube/video/tags \
  -H "Content-Type: application/json" \
  -d '{"api_key":"YOUR_KEY","video":"dQw4w9WgXcQ"}'

Ví dụ phản hồi

{"tags":["80s","Rick Astley","Official Video"]}
{"error":"Tags unavailable","code":204}

Mã phản hồi

Mô tả
200 SuccessYêu cầu xử lý thành công.
400 Bad RequestXác thực đầu vào thất bại.
401 UnauthorizedAPI Key thiếu hoặc sai.
403 ForbiddenKey không hoạt động hoặc không được phép.
429 Rate LimitQuá nhiều yêu cầu.
500 Server ErrorLỗi không mong đợi.

Tags

youtube/video/tags 0.0030 credits

Parameters

API Key
body · string · required
Video
body · string · required

Code Samples


                
                
                
            

Response

Status:
Headers

                
Body

                

Top Comments


POST https://api.yeb.to/v1/youtube/video/comments
Tham sốLoạiBắt buộcMô tả
api_key string Your API key
video string Video ID or URL
limit int tùy chọn 1-100, default 50
order string tùy chọn relevance (default) | time
repliesOn bool tùy chọn true = include replies

Ví dụ

curl -X POST https://api.yeb.to/v1/youtube/video/comments \
  -H "Content-Type: application/json" \
  -d '{
    "api_key":   "YOUR_KEY",
    "video":     "dQw4w9WgXcQ",
    "limit":     25,
    "order":     "time",
    "repliesOn": true
  }'

Ví dụ phản hồi

{
  "cnt_comments": 25,
  "comments": [
    {
      "id":"Ugzx…",
      "author":"Alice",
      "text":"Still a banger!",
      "likes":42,
      "published":"2025-06-01T12:34:00Z",
      "replies":{
        "cnt":2,
        "items":[{"id":"Ugy…","author":"Bob","text":"100 %","likes":3,"published":"…"}]
      }
    }
  ]
}
{"error":"Comments disabled","code":403}

Mã phản hồi

Mô tả
200 SuccessYêu cầu xử lý thành công.
400 Bad RequestXác thực đầu vào thất bại.
401 UnauthorizedAPI Key thiếu hoặc sai.
403 ForbiddenKey không hoạt động hoặc không được phép.
429 Rate LimitQuá nhiều yêu cầu.
500 Server ErrorLỗi không mong đợi.

Comments

youtube/video/comments 0.0090 credits

Parameters

API Key
body · string · required
Video
body · string · required
Limit
body · string
Order
body · string
Include replies
body · string

Code Samples


                
                
                
            

Response

Status:
Headers

                
Body

                

Settings / Status


POST https://api.yeb.to/v1/youtube/video/settings
Tham sốLoạiBắt buộcMô tả
api_key string Your API key
video string Video ID or URL

Ví dụ

curl -X POST https://api.yeb.to/v1/youtube/video/settings \
  -H "Content-Type: application/json" \
  -d '{"api_key":"YOUR_KEY","video":"dQw4w9WgXcQ"}'

Ví dụ phản hồi

{
   "settings": {
    "privacyStatus":       "public",
    "license":             "creativeCommon",
    "embeddable":          true,
       "publicStatsViewable": true,
   "disableComments":     false,
    "madeForKids":         false,
    "ageLimit":            false,
    "projection":          "rectangular",
   "recordingDate":       "2025-07-14",
    "locationDescription": "Berlin, Germany",

    "categoryId":          "25",
    "categoryName":        "News & Politics",
    "language":            "bg",
    "region":              "bg"
  }}
{"error":"Video not found","code":404}

Mã phản hồi

Mô tả
200 SuccessYêu cầu xử lý thành công.
400 Bad RequestXác thực đầu vào thất bại.
401 UnauthorizedAPI Key thiếu hoặc sai.
403 ForbiddenKey không hoạt động hoặc không được phép.
429 Rate LimitQuá nhiều yêu cầu.
500 Server ErrorLỗi không mong đợi.

Settings

youtube/video/settings 0.0040 credits

Parameters

API Key
body · string · required
Video
body · string · required

Code Samples


                
                
                
            

Response

Status:
Headers

                
Body

                

Restrictions


POST https://api.yeb.to/v1/youtube/video/restricted
Tham sốLoạiBắt buộcMô tả
api_key string Your API key
video string Video ID or URL

Ví dụ

curl -X POST https://api.yeb.to/v1/youtube/video/restricted \
  -H "Content-Type: application/json" \
  -d '{"api_key":"YOUR_KEY","video":"dQw4w9WgXcQ"}'

Ví dụ phản hồi

{
    "restrictions": {
      "geoBlocked":    false,
      "ageRestricted": false,
      "blocked":       [],
      "allowed":       [],
      "embeddable":    true,
      "madeForKids":   false,
      "license":       "youtube",
      "privacyStatus": "public"
    }
  }
{"error":"Video removed","code":410}

Mã phản hồi

Mô tả
200 SuccessYêu cầu xử lý thành công.
400 Bad RequestXác thực đầu vào thất bại.
401 UnauthorizedAPI Key thiếu hoặc sai.
403 ForbiddenKey không hoạt động hoặc không được phép.
429 Rate LimitQuá nhiều yêu cầu.
500 Server ErrorLỗi không mong đợi.

Restrictions

youtube/video/restricted 0.0030 credits

Parameters

API Key
body · string · required
Video
body · string · required

Code Samples


                
                
                
            

Response

Status:
Headers

                
Body

                

Trending Check


POST https://api.yeb.to/v1/youtube/video/trending
Tham sốLoạiBắt buộcMô tả
api_key string Your API key
video string Video ID or URL
country string tùy chọn ISO country (US default)
categoryId string tùy chọn Optional numeric ID

Ví dụ

curl -X POST https://api.yeb.to/v1/youtube/video/trending \
  -H "Content-Type: application/json" \
  -d '{"api_key":"YOUR_KEY","video":"dQw4w9WgXcQ","country":"GB"}'

Ví dụ phản hồi

{
    "trending": {
      "country":      "GB",
      "categoryId":   null,
      "categoryName": null,
      "isTrending":   true,
      "position":     17
    }
  }
{"error":"Quota exceeded","code":429}

Mã phản hồi

Mô tả
200 SuccessYêu cầu xử lý thành công.
400 Bad RequestXác thực đầu vào thất bại.
401 UnauthorizedAPI Key thiếu hoặc sai.
403 ForbiddenKey không hoạt động hoặc không được phép.
429 Rate LimitQuá nhiều yêu cầu.
500 Server ErrorLỗi không mong đợi.

Trending?

youtube/video/trending 0.0020 credits

Parameters

API Key
body · string · required
Video
body · string · required
Country
body · string
Category ID
body · string

Code Samples


                
                
                
            

Response

Status:
Headers

                
Body

                

Statistics


POST https://api.yeb.to/v1/youtube/video/statistics
Tham sốLoạiBắt buộcMô tả
api_key string Your API key
video string Video ID or URL

Ví dụ

curl -X POST https://api.yeb.to/v1/youtube/video/statistics \
  -H "Content-Type: application/json" \
  -d '{"api_key":"YOUR_KEY","video":"dQw4w9WgXcQ"}'

Ví dụ phản hồi

{
  "statistics": {
    "views"      : 1580000000,
    "likes"      : 15400000,
    "comments"   : 1120000,
    "favourites" : 45000
  }
}
{"error":"Video not found","code":404}

Mã phản hồi

Mô tả
200 SuccessYêu cầu xử lý thành công.
400 Bad RequestXác thực đầu vào thất bại.
401 UnauthorizedAPI Key thiếu hoặc sai.
403 ForbiddenKey không hoạt động hoặc không được phép.
429 Rate LimitQuá nhiều yêu cầu.
500 Server ErrorLỗi không mong đợi.

Statistics

youtube/video/statistics 0.0040 credits

Parameters

API Key
body · string · required
Video
body · string · required

Code Samples


                
                
                
            

Response

Status:
Headers

                
Body

                

Watch-Time Estimate


POST https://api.yeb.to/v1/youtube/video/watchtime-estimate
Tham sốLoạiBắt buộcMô tả
api_key string Your API key
video string Video ID or URL
avgRetention float tùy chọn Override (0-1). e.g. 0.55

Ví dụ

curl -X POST https://api.yeb.to/v1/youtube/video/watchtime-estimate \
  -H "Content-Type: application/json" \
  -d '{"api_key":"YOUR_KEY","video":"dQw4w9WgXcQ"}'

Ví dụ phản hồi

{
  "watchtime": {
    "views":        739,
    "durationSec":  1733,
    "avgRetention": 0.30,
    "perViewSec":   520,
    "seconds":      384206,
    "watchHours":   106.7

}
}
{"error":"Video not found","code":404}

Mã phản hồi

Mô tả
200 SuccessYêu cầu xử lý thành công.
400 Bad RequestXác thực đầu vào thất bại.
401 UnauthorizedAPI Key thiếu hoặc sai.
403 ForbiddenKey không hoạt động hoặc không được phép.
429 Rate LimitQuá nhiều yêu cầu.
500 Server ErrorLỗi không mong đợi.

Watch-Time

youtube/video/watchtime-estimate 0.0030 credits

Parameters

API Key
body · string · required
Video
body · string · required
Average Retention
body · string

Code Samples


                
                
                
            

Response

Status:
Headers

                
Body

                

Engagement Rate


POST https://api.yeb.to/v1/youtube/video/engagement-rate
Tham sốLoạiBắt buộcMô tả
api_key string Your API key
video string Video ID or URL

Ví dụ

curl -X POST https://api.yeb.to/v1/youtube/video/engagement-rate \
  -H "Content-Type: application/json" \
  -d '{"api_key":"YOUR_KEY","video":"dQw4w9WgXcQ"}'

Ví dụ phản hồi

{
  "engagement": {
    "views":     1580000000,
    "likes":     15400000,
    "comments":  1120000,
    "rate":      0.011
  }
}
{"error":"Video not found","code":404}

Mã phản hồi

Mô tả
200 SuccessYêu cầu xử lý thành công.
400 Bad RequestXác thực đầu vào thất bại.
401 UnauthorizedAPI Key thiếu hoặc sai.
403 ForbiddenKey không hoạt động hoặc không được phép.
429 Rate LimitQuá nhiều yêu cầu.
500 Server ErrorLỗi không mong đợi.

Engagement

youtube/video/engagement-rate 0.0030 credits

Parameters

API Key
body · string · required
Video
body · string · required

Code Samples


                
                
                
            

Response

Status:
Headers

                
Body

                

Thumbnail URLs


POST https://api.yeb.to/v1/youtube/video/thumbnail
Tham sốLoạiBắt buộcMô tả
api_key string Your API key
video string Video ID or URL

Ví dụ

curl -X POST https://api.yeb.to/v1/youtube/video/thumbnail \
  -H "Content-Type: application/json" \
  -d '{"api_key":"YOUR_KEY","video":"dQw4w9WgXcQ"}'

Ví dụ phản hồi

{
  "thumbnails": {
    "default":  "https://i.ytimg.com/vi/dQw4w9WgXcQ/default.jpg",
    "medium":   "https://i.ytimg.com/vi/dQw4w9WgXcQ/mqdefault.jpg",
    "high":     "https://i.ytimg.com/vi/dQw4w9WgXcQ/hqdefault.jpg",
    "standard": "https://i.ytimg.com/vi/dQw4w9WgXcQ/sddefault.jpg",
    "maxres":   "https://i.ytimg.com/vi/dQw4w9WgXcQ/maxresdefault.jpg"
  }
}
{"error":"Video not found","code":404}

Mã phản hồi

Mô tả
200 SuccessYêu cầu xử lý thành công.
400 Bad RequestXác thực đầu vào thất bại.
401 UnauthorizedAPI Key thiếu hoặc sai.
403 ForbiddenKey không hoạt động hoặc không được phép.
429 Rate LimitQuá nhiều yêu cầu.
500 Server ErrorLỗi không mong đợi.

Thumbnail URLs

youtube/video/thumbnail 0.0010 credits

Parameters

API Key
body · string · required
Video
body · string · required

Code Samples


                
                
                
            

Response

Status:
Headers

                
Body

                

Playlists Featuring This Video


POST https://api.yeb.to/v1/youtube/video/search-playlists
Tham sốLoạiBắt buộcMô tả
api_key string Your API key
video string Video ID or URL
limit int tùy chọn 1-50, default 50

Ví dụ

curl -X POST https://api.yeb.to/v1/youtube/video/search-playlists \
  -H "Content-Type: application/json" \
  -d '{"api_key":"YOUR_KEY","video":"dQw4w9WgXcQ","limit":10}'

Ví dụ phản hồi

{
  "cnt_playlists": 2,
  "playlists": [
    {"id":"PL123…","title":"Best 80s Hits","url":"https://…","found":true},
    {"id":"PL456…","title":"Rick Astley Favs","url":"https://…","found":true}
  ]
}
{"error":"Video not found","code":404}

Mã phản hồi

Mô tả
200 SuccessYêu cầu xử lý thành công.
400 Bad RequestXác thực đầu vào thất bại.
401 UnauthorizedAPI Key thiếu hoặc sai.
403 ForbiddenKey không hoạt động hoặc không được phép.
429 Rate LimitQuá nhiều yêu cầu.
500 Server ErrorLỗi không mong đợi.

Search Playlists

youtube/video/search-playlists 0.0100 credits

Parameters

API Key
body · string · required
Video
body · string · required
Limit
body · string

Code Samples


                
                
                
            

Response

Status:
Headers

                
Body

                

Extract Links


POST https://api.yeb.to/v1/youtube/video/extract-links
Tham sốLoạiBắt buộcMô tả
api_key string Your API key
video string Video ID or URL

Ví dụ

curl -X POST https://api.yeb.to/v1/youtube/video/extract-links \
  -H "Content-Type: application/json" \
  -d '{"api_key":"YOUR_KEY","video":"dQw4w9WgXcQ"}'

Ví dụ phản hồi

Mã phản hồi

Mô tả
200 SuccessYêu cầu xử lý thành công.
400 Bad RequestXác thực đầu vào thất bại.
401 UnauthorizedAPI Key thiếu hoặc sai.
403 ForbiddenKey không hoạt động hoặc không được phép.
429 Rate LimitQuá nhiều yêu cầu.
500 Server ErrorLỗi không mong đợi.

Extract Links

youtube/video/extract-links 0.0020 credits

Parameters

API Key
body · string · required
Video
body · string · required

Code Samples


                
                
                
            

Response

Status:
Headers

                
Body

                

Extract Hashtags


POST https://api.yeb.to/v1/youtube/video/extract-hashtags
Tham sốLoạiBắt buộcMô tả
api_key string Your API key
video string Video ID or URL

Ví dụ

curl -X POST https://api.yeb.to/v1/youtube/video/extract-hashtags \
  -H "Content-Type: application/json" \
  -d '{"api_key":"YOUR_KEY","video":"dQw4w9WgXcQ"}'

Ví dụ phản hồi

{"cnt_hashtags":2,"hashtags":["#RickAstley","#NeverGonnaGiveYouUp"]}
{"error":"Video not found","code":404}

Mã phản hồi

Mô tả
200 SuccessYêu cầu xử lý thành công.
400 Bad RequestXác thực đầu vào thất bại.
401 UnauthorizedAPI Key thiếu hoặc sai.
403 ForbiddenKey không hoạt động hoặc không được phép.
429 Rate LimitQuá nhiều yêu cầu.
500 Server ErrorLỗi không mong đợi.

Extract Hashtags

youtube/video/extract-hashtags 0.0050 credits

Parameters

API Key
body · string · required
Video
body · string · required

Code Samples


                
                
                
            

Response

Status:
Headers

                
Body

                

AI-Powered Audit


POST https://api.yeb.to/v1/youtube/video/audit
Tham sốLoạiBắt buộcMô tả
api_key string Your API key
video string Video ID or URL
sample int tùy chọn Baseline sample size (10-100, default 50)

Ví dụ

curl -X POST https://api.yeb.to/v1/youtube/video/audit \
  -H "Content-Type: application/json" \
  -d '{"api_key":"YOUR_KEY","video":"dQw4w9WgXcQ"}'

Ví dụ phản hồi

{
  "videoId":"dQw4w9WgXcQ",
  "views":1580000000,
  "likes":15400000,
  "comments":1120000,
  "engagementRate":0.011,
  "channelMedianViews":420000,
  "isAboveMedian":true,
  "aiRecommendations":"• Use a more curiosity-driven title…"
}
{"error":"Video not found","code":404}

Mã phản hồi

Mô tả
200 SuccessYêu cầu xử lý thành công.
400 Bad RequestXác thực đầu vào thất bại.
401 UnauthorizedAPI Key thiếu hoặc sai.
403 ForbiddenKey không hoạt động hoặc không được phép.
429 Rate LimitQuá nhiều yêu cầu.
500 Server ErrorLỗi không mong đợi.

AI Audit

youtube/video/audit 0.0200 credits

Parameters

API Key
body · string · required
Video
body · string · required
Sample size
body · string

Code Samples


                
                
                
            

Response

Status:
Headers

                
Body

                

YouTube Video API — Practical Guide

A hands-on guide to the YouTube Video API actions you’ll actually use: what each endpoint does, the problems it solves, the few parameters that matter, and how to read responses to build smarter UIs (mix builders, QA tools, SEO audits, and moderation dashboards).

#What this API solves

The youtube/video module turns a single YouTube video ID (or URL) into the practical signals you need: core metadata, engagement metrics, restrictions & status, comments, SEO surfaces (tags, hashtags, links), playlists featuring the video, and AI-powered audits. Use results to choose thumbnails/titles, estimate watch-time, detect country blocks, or group videos into mixes.

#Endpoints & when to use them

#POST /v1/youtube/video/information — Basic Information

  • Best for: Canonical data for cards, editors, and QA. Category & channel IDs for routing.
  • Output: video{ id, title, description, duration (ISO), publishedAt, categoryId + categoryName, channelId, channelTitle, statistics, thumbnails }.
  • Tip: Store id, channelId, categoryId as foreign keys; render duration as mm:ss.

#POST /v1/youtube/video/engagement-rate — Engagement Rate

  • Best for: Quick quality bar across uploads; ranking candidates for playlists.
  • Output: engagement{ views, likes, comments, rate } where rate = (likes+comments)/views.
  • Tip: Use buckets: <0.01 (weak), 0.01–0.03 (solid), >0.03 (hot) — tune per niche.

#POST /v1/youtube/video/comments — Top Comments

  • Best for: Social proof, snippets for landing pages, moderation/QA workflows.
  • Output: Flat list of top-level comments (optionally with replies).
  • Tip: For moderation UIs, request order="time"; for marketing, use relevance (default).

#POST /v1/youtube/video/restricted — Restrictions

  • Best for: Detecting geo blocks, age restrictions, and embeddability issues before publishing.
  • Output: restrictions{ geoBlocked, ageRestricted, blocked[], allowed[], embeddable, madeForKids, license, privacyStatus }.
  • Tip: If geoBlocked=true show “Unavailable in your region” and pick alternates for that market.

#POST /v1/youtube/video/settings — Settings / Status

  • Best for: Editorial checks: privacy, license, Made for Kids, projection, recordingDate, language/region.
  • Output: settings{ privacyStatus, license, embeddable, publicStatsViewable, disableComments, madeForKids, ageRestricted, projection, recordingDate, locationDescription, categoryId+Name, language, region }.
  • Tip: Use language/region to prefill translation tasks and subtitles pipelines.

#POST /v1/youtube/video/statistics — Statistics

  • Best for: Snapshot cards and simple leaderboards.
  • Output: statistics{ views, likes, comments, favourites } (point-in-time).

#POST /v1/youtube/video/tags — Video Tags

  • Best for: SEO diffing, tag normalization, clustering similar videos.
  • Output: tags[] or empty if unavailable.

#POST /v1/youtube/video/extract-hashtags — Extract Hashtags

  • Best for: Pulling visible #hashtags from title/description for social cross-posting.
  • Output: { cnt_hashtags, hashtags[] }.
  • Best for: Affiliate checks, out-link audits, or building a “Links” panel on video pages.
  • Output: { cnt_links, links[] }.

#POST /v1/youtube/video/thumbnail — Thumbnail URLs

  • Best for: Rendering cards without re-deriving thumb URLs.
  • Output: thumbnails{ default, medium, high, standard, maxres }.

#POST /v1/youtube/video/search-playlists — Playlists Featuring This Video

  • Best for: Discoverability & social proof (“featured in 12 playlists”).
  • Output: { cnt_playlists, playlists[{ id, title, url, found }] }.
  • Best for: Pinning “Now Trending in GB” badges and ordering on homepages.
  • Output: trending{ country, categoryId, categoryName, isTrending, position }.

#POST /v1/youtube/video/watchtime-estimate — Watch-Time Estimate

  • Best for: Forecasting watch-hours for mixes or promo decisions.
  • Output: watchtime{ views, durationSec, avgRetention, perViewSec, seconds, watchHours }.
  • Tip: Override avgRetention (0–1) if you know your niche average; otherwise we fallback by category.

#POST /v1/youtube/video/audit — AI-Powered Audit

  • Best for: Fast SEO/CTR feedback on title/description/tags vs channel baseline.
  • Output: audit{ videoId, views, likes, comments, engagementRate, channelMedianViews, isAboveMedian, aiRecommendations }.
  • Tip: Tune sample (10–100) to match channel cadence for meaningful medians.

#Quick start

# Basic info
curl -X POST "https://api.yeb.to/v1/youtube/video/information" \
  -H "Accept: application/json" -H "Content-Type: application/json" \
  -H "X-API-Key: <YOUR_API_KEY>" \
  -d '{ "video":"dQw4w9WgXcQ" }'
# Engagement rate
curl -X POST "https://api.yeb.to/v1/youtube/video/engagement-rate" \
  -H "Accept: application/json" -H "Content-Type: application/json" \
  -H "X-API-Key: <YOUR_API_KEY>" \
  -d '{ "video":"dQw4w9WgXcQ" }'
# Comments (latest 25, include replies)
curl -X POST "https://api.yeb.to/v1/youtube/video/comments" \
  -H "Accept: application/json" -H "Content-Type: application/json" \
  -H "X-API-Key: <YOUR_API_KEY>" \
  -d '{ "video":"dQw4w9WgXcQ", "limit":25, "order":"time", "repliesOn":true }'
# AI audit (use 50 last uploads as baseline)
curl -X POST "https://api.yeb.to/v1/youtube/video/audit" \
  -H "Accept: application/json" -H "Content-Type: application/json" \
  -H "X-API-Key: <YOUR_API_KEY>" \
  -d '{ "video":"dQw4w9WgXcQ", "sample":50 }'

#Parameters that actually matter

ParamTypeRequiredPractical guidance
api_key string Yes Your credential. Keep server-side or sign short-lived edge tokens.
video string Yes* 11-char ID or full URL. Not required for compare-videos (if available) or some meta actions.
order string No For comments: relevance (default) or time.
limit int No Comments/playlists page size. Reasonable 10–50; defaults provided per endpoint.
repliesOn bool No For comments, include reply threads when you need context.
country string No For trending check, ISO-3166 code (default US).
categoryId string|int No For trending check; use 10 for Music.
avgRetention float No For watchtime-estimate override (0–1). If omitted, we fall back to category averages.
sample int No For audit: channel baseline size (10–100, default 50) to compute median views.

#Reading & acting on responses

#Information — interpretation

{
  "video": {
    "id":"dQw4w9WgXcQ",
    "title":"Rick Astley – Never Gonna Give You Up",
    "duration":"PT3M32S",
    "publishedAt":"1987-10-25T00:00:00Z",
    "categoryId":"10",
    "categoryName":"Music",
    "channelId":"UCuAXFkgsw1L7xaCfnd5JJOw",
    "channelTitle":"Official Rick Astley"
  }
}
  • id — Video ID → watch URL, embeds, thumbnail derivation.
  • channelId — Use for deep links and channel-level rollups.
  • duration — ISO-8601; convert to mm:ss for chips (helpful in grid UIs).

#Engagement — interpretation

{ "engagement": { "views":1580000000, "likes":15400000, "comments":1120000, "rate":0.011 } }
  • Use case: Sort candidates for playlists by rate, then sanity-check with comments volume.

#Comments — interpretation

{
  "cnt_comments": 25,
  "comments": [
    { "id":"Ugz…", "author":"Alice", "text":"Still a banger!", "likes":42, "published":"2025-06-01T12:34:00Z",
      "replies": { "cnt":2, "items":[{"id":"Ugy…","author":"Bob","text":"100%","likes":3,"published":"…"}] } }
  ]
}
  • Surface: Show the first one or two “relevance” comments as social proof; switch to time for live streams.

#Restrictions — interpretation

{
  "restrictions": {
    "geoBlocked":false, "ageRestricted":false,
    "embeddable":true,  "privacyStatus":"public"
  }
}
  • Action: If embeddable=false, fallback to channel link instead of inline player.
{ "trending": { "country":"GB", "isTrending":true, "position":17 } }
  • Action: Add “Trending #17 in GB” badge; bump in country-specific rails.

#Watch-time estimate — interpretation

{
  "watchtime": {
    "views":739, "durationSec":1733,
    "avgRetention":0.30, "perViewSec":520,
    "seconds":384206, "watchHours":106.7
  }
}
  • Use case: Forecast weekly watch-hours; if below target, delay posting the next mix.

#Practical recipes

  • Playlist curation: Rank by engagement.rate, filter restrictions.embeddable=true, and ensure categoryId=10 for music.
  • SEO diff: Compare tags + hashtags against your top performers; feed weak items into /audit.
  • Compliance: Check restricted prior to embedding; show geo messages when geoBlocked.
  • Mix timing: Use watchtime.watchHours to decide whether to release or wait for the current video to peak.

#YouTube IDs you’ll work with

FieldWhat it isHow to use
id (Video ID) 11-char identifier Watch: https://www.youtube.com/watch?v={id} · Thumbs: https://i.ytimg.com/vi/{id}/hqdefault.jpg
channelId Channel identifier Channel: https://www.youtube.com/channel/{channelId}
playlistId Playlist identifier Playlist: https://www.youtube.com/playlist?list={playlistId}
commentId Comment identifier Moderation tools, permalinks, reply threading.
categoryId Numeric content category Common IDs below; 10 = Music

#Common YouTube Category IDs

IDCategory
1Film & Animation
2Autos & Vehicles
10Music
17Sports
20Gaming
22People & Blogs
23Comedy
24Entertainment
25News & Politics
26Howto & Style
27Education
28Science & Technology
29Nonprofits & Activism

#Errors & troubleshooting

  • 400 "Missing "action" parameter" — Provide one of the supported actions (see sections above).
  • 400 "Missing "video" parameter" — Supply ID or URL for video-based actions.
  • 404 "Video not found" — Invalid/removed/private video.
  • 403 "Comments disabled" — Respect channel/video settings; hide comment UI.
  • 429 "Quota exceeded" — Backoff and reduce polling; cache responses.

#API Changelog (youtube/video)

2026-03-07
Watch-time fields. Added perViewSec and watchHours to watchtime for easier planning.
2026-03-07
Engagement wrapper. Standardized engagement{ ... } payload in engagement-rate.
2026-03-07
Trending check. Response now includes categoryName (derived from categoryId).
2026-02-28
Comments API. Optional repliesOn flag now returns structured replies (replies{ cnt, items[] }).
2026-02-21
AI Audit. Baseline sampling (sample 10–100) and channel median comparison added; clearer aiRecommendations.
2026-02-14
Unified responses. Normalized keys across actions (e.g., thumbnails{}, statistics{}, restrictions{}).

Use the API Playgrounds below each section in this page to test requests with your own video IDs.

Câu hỏi thường gặp

Bạn có thể truy xuất tiêu đề, mô tả, thẻ, hình thu nhỏ, bình luận (có phản hồi), thống kê (lượt xem, lượt thích, bình luận), tương tác của khán giả, chương video, danh sách phát chứa video, và thậm chí yêu cầu kiểm tra nội dung bằng AI.

Cả hai đều được hỗ trợ! Bạn có thể truyền ID video YouTube (ví dụ: dQw4w9WgXcQ) hoặc URL đầy đủ của video YouTube.

API trả về thông báo lỗi rõ ràng và mã trạng thái HTTP (ví dụ: 404 cho không tìm thấy, 403 cho video bị hạn chế/riêng tư).

Có. Mọi yêu cầu, kể cả những yêu cầu có lỗi, đều tiêu tốn tín dụng. Tín dụng của bạn được gắn với số lượng yêu cầu, bất kể thành công hay thất bại. Nếu lỗi rõ ràng do sự cố nền tảng từ phía chúng tôi, chúng tôi sẽ khôi phục tín dụng bị ảnh hưởng (không hoàn tiền mặt).

Liên hệ chúng tôi tại [email protected]. Chúng tôi coi trọng phản hồi—nếu báo cáo lỗi hoặc yêu cầu tính năng của bạn có ý nghĩa, chúng tôi có thể sửa hoặc cải thiện API nhanh chóng và tặng bạn 50 tín dụng miễn phí để cảm ơn.

Tùy thuộc vào API và đôi khi cả endpoint. Một số endpoint sử dụng dữ liệu từ nguồn bên ngoài, có thể có giới hạn nghiêm ngặt hơn. Chúng tôi cũng áp dụng giới hạn để ngăn chặn lạm dụng và duy trì sự ổn định của nền tảng. Kiểm tra tài liệu để biết giới hạn cụ thể cho mỗi endpoint.

Chúng tôi hoạt động theo hệ thống tín dụng. Tín dụng là các đơn vị trả trước, không hoàn lại mà bạn chi cho các cuộc gọi API và công cụ. Tín dụng được tiêu thụ theo FIFO (cũ nhất trước) và có hiệu lực 12 tháng kể từ ngày mua. Bảng điều khiển hiển thị ngày mua và ngày hết hạn của mỗi giao dịch.

Có. Tất cả tín dụng đã mua (bao gồm số dư lẻ) có hiệu lực 12 tháng kể từ ngày mua. Tín dụng chưa sử dụng tự động hết hạn và bị xóa vĩnh viễn khi kết thúc thời hạn hiệu lực. Tín dụng đã hết hạn không thể khôi phục hoặc chuyển đổi thành tiền mặt hay giá trị khác. Quy tắc chuyển tiếp: tín dụng mua trước ngày 22 tháng 9 năm 2025 được coi là mua vào ngày 22 tháng 9 năm 2025 và hết hạn vào ngày 22 tháng 9 năm 2026 (trừ khi ngày hết hạn sớm hơn được ghi khi mua).

Có—trong thời hạn hiệu lực. Tín dụng chưa sử dụng vẫn khả dụng và được chuyển từ tháng sang tháng cho đến khi hết hạn 12 tháng sau khi mua.

Tín dụng là không hoàn lại. Chỉ mua những gì bạn cần—bạn luôn có thể nạp thêm sau. Nếu lỗi nền tảng gây ra tính phí thất bại, chúng tôi có thể khôi phục tín dụng bị ảnh hưởng sau khi điều tra. Không hoàn tiền mặt.

Giá được tính bằng tín dụng, không phải đô la. Mỗi endpoint có chi phí riêng—xem huy hiệu "Tín dụng / yêu cầu" ở trên. Bạn luôn biết chính xác mình đang chi bao nhiêu.
← Quay lại API