YouTube Search API

การค้นหาที่รวดเร็วและกรองได้สำหรับวิดีโอ, ช่อง, เพลย์ลิสต์ และการเติมข้อความอัตโนมัติ

รับ API Key ซื้อเครดิต
คุณสามารถทำอะไรได้บ้าง?
ค้นหา YouTube แบบหลายตัวกรอง

ค้นหาวิดีโอ, ช่อง หรือเพลย์ลิสต์ด้วยการเรียกเดียว

คำแนะนำเติมข้อความอัตโนมัติทันที

รับคำแนะนำการค้นหาขณะผู้ใช้พิมพ์

ตัวกรองวันที่และระยะเวลา

วันที่เผยแพร่และระยะเวลาช่วยจำกัดผลลัพธ์ได้อย่างรวดเร็ว

ทดลองใช้งาน
99.9 % เวลาทำงาน
153.4ms การตอบกลับ
20 req/s
0.01 เครดิต / คำขอ

Autocomplete


POST https://api.yeb.to/v1/youtube/search/autocomplete
พารามิเตอร์ประเภทจำเป็นคำอธิบาย
api_key string ใช่ Your API key
q string ใช่ User query
hl string ไม่บังคับ Language (ISO-639-1, default en)

ตัวอย่าง

curl -X POST https://api.yeb.to/v1/youtube/search/autocomplete \
  -H "Content-Type: application/json" \
  -d '{
  "api_key": "YOUR_KEY",
  "q": "minecraft survival",
  "hl": "en"
}'

ตัวอย่างการตอบกลับ

{
  "query":        "minecraft survival",
  "lang":         "en",
  "suggestions":  ["minecraft survival house","minecraft survival guide"],
  "cnt_results":  2
}
{"error":"Missing \"q\" (query) parameter","code":400}

รหัสตอบกลับ

รหัสคำอธิบาย
200 Successคำขอดำเนินการสำเร็จ
400 Bad Requestการตรวจสอบข้อมูลนำเข้าล้มเหลว
401 UnauthorizedAPI Key หายไปหรือไม่ถูกต้อง
403 ForbiddenKey ไม่ทำงานหรือไม่ได้รับอนุญาต
429 Rate Limitคำขอมากเกินไป
500 Server Errorข้อผิดพลาดที่ไม่คาดคิด

Autocomplete

youtube/search/autocomplete 0.0100 credits

Parameters

API Key
body · string · required
Query
body · string · required
Language
body · string

Code Samples


                
                
                
            

Response

Status:
Headers

                
Body

                

Search Videos


POST https://api.yeb.to/v1/youtube/search/videos
พารามิเตอร์ประเภทจำเป็นคำอธิบาย
api_key string ใช่ Your API key
q string ใช่ Search keywords
limit int ไม่บังคับ 1-50 (default 25)
sort string ไม่บังคับ relevance | date | rating | title | viewCount
published_after date ไม่บังคับ YYYY-MM-DD
published_before date ไม่บังคับ YYYY-MM-DD
duration string ไม่บังคับ any | short | medium | long

ตัวอย่าง

curl -X POST https://api.yeb.to/v1/youtube/search/videos \
  -H "Content-Type: application/json" \
  -d '{
  "api_key":          "YOUR_KEY",
  "q":                "how to draw",
  "limit":            10,
  "sort":             "date",
  "published_after":  "2025-01-01",
  "duration":         "short"
}'

ตัวอย่างการตอบกลับ

{
  "cnt_results": 1,
  "videos":[
    {
      "id":          "dQw4w9WgXcQ",
      "title":       "How to draw a cat",
      "description": "Learn cat drawing…",
      "publishedAt": "2025-06-05T14:00:01Z",
      "channelId":   "UCabc123",
      "durationISO": "PT3M45S",
      "views":       15230
    }
  ]
}
{"error":"Missing \"q\" (query) parameter","code":400}

รหัสตอบกลับ

รหัสคำอธิบาย
200 Successคำขอดำเนินการสำเร็จ
400 Bad Requestการตรวจสอบข้อมูลนำเข้าล้มเหลว
401 UnauthorizedAPI Key หายไปหรือไม่ถูกต้อง
403 ForbiddenKey ไม่ทำงานหรือไม่ได้รับอนุญาต
429 Rate Limitคำขอมากเกินไป
500 Server Errorข้อผิดพลาดที่ไม่คาดคิด

Videos

youtube/search/videos 0.0060 credits

Parameters

API Key
body · string · required
Query
body · string · required
Limit
body · string
Sort
body · string
Published After
body · string
Published Before
body · string
Duration
body · string

Code Samples


                
                
                
            

Response

Status:
Headers

                
Body

                

Search Channels


POST https://api.yeb.to/v1/youtube/search/channels
พารามิเตอร์ประเภทจำเป็นคำอธิบาย
api_key string ใช่ Your API key
q string ใช่ Search keywords
limit int ไม่บังคับ 1-50 (default 25)
sort string ไม่บังคับ relevance | date | rating | title | viewCount
published_after date ไม่บังคับ YYYY-MM-DD
published_before date ไม่บังคับ YYYY-MM-DD

ตัวอย่าง

curl -X POST https://api.yeb.to/v1/youtube/search/channels \
  -H "Content-Type: application/json" \
  -d '{
  "api_key": "YOUR_KEY",
  "q":       "technology reviews",
  "limit":   5
}'

ตัวอย่างการตอบกลับ

{
  "cnt_results": 2,
  "channels":[
    {
      "id":          "UC_x5XG1OV2P6uZZ5FSM9Ttw",
      "title":       "Google Developers",
      "description": "The official Google Developers channel.",
      "publishedAt": "2007-08-23T00:34:43Z",
      "thumb":       "https://yt3.ggpht.com/abc=s88-c-k-c0xffffffff-no-rj-mo"
    }
  ]
}
{"error":"Missing \"q\" (query) parameter","code":400}

รหัสตอบกลับ

รหัสคำอธิบาย
200 Successคำขอดำเนินการสำเร็จ
400 Bad Requestการตรวจสอบข้อมูลนำเข้าล้มเหลว
401 UnauthorizedAPI Key หายไปหรือไม่ถูกต้อง
403 ForbiddenKey ไม่ทำงานหรือไม่ได้รับอนุญาต
429 Rate Limitคำขอมากเกินไป
500 Server Errorข้อผิดพลาดที่ไม่คาดคิด

Channels

youtube/search/channels 0.0060 credits

Parameters

API Key
body · string · required
Query
body · string · required
Limit
body · string
Sort
body · string
Published After
body · string
Published Before
body · string

Code Samples


                
                
                
            

Response

Status:
Headers

                
Body

                

Search Playlists


POST https://api.yeb.to/v1/youtube/search/playlists
พารามิเตอร์ประเภทจำเป็นคำอธิบาย
api_key string ใช่ Your API key
q string ใช่ Search keywords
limit int ไม่บังคับ 1-50 (default 25)
sort string ไม่บังคับ relevance | date | rating | title | viewCount
published_after date ไม่บังคับ YYYY-MM-DD
published_before date ไม่บังคับ YYYY-MM-DD

ตัวอย่าง

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

ตัวอย่างการตอบกลับ

{
  "cnt_results": 1,
  "playlists":[
    {
      "id":          "PL12345ABCDE",
      "title":       "Lo-Fi Chill Beats",
      "description": "Relaxing music to study to.",
      "publishedAt": "2024-11-17T10:00:00Z",
      "channelId":   "UCLofi123",
      "items":       35
    }
  ]
}
{"error":"Missing \"q\" (query) parameter","code":400}

รหัสตอบกลับ

รหัสคำอธิบาย
200 Successคำขอดำเนินการสำเร็จ
400 Bad Requestการตรวจสอบข้อมูลนำเข้าล้มเหลว
401 UnauthorizedAPI Key หายไปหรือไม่ถูกต้อง
403 ForbiddenKey ไม่ทำงานหรือไม่ได้รับอนุญาต
429 Rate Limitคำขอมากเกินไป
500 Server Errorข้อผิดพลาดที่ไม่คาดคิด

Playlists

youtube/search/playlists 0.0060 credits

Parameters

API Key
body · string · required
Query
body · string · required
Limit
body · string
Sort
body · string
Published After
body · string
Published Before
body · string

Code Samples


                
                
                
            

Response

Status:
Headers

                
Body

                

YouTube Search API — Practical Guide

Turn raw YouTube searches into editorial decisions and content plans. Autocomplete helps you mine intent; video/channel/playlist search gives you freshness windows, volume, and targets for outreach or curation.

#What YouTube Search solves

Use youtube/search to discover demand (autocomplete), source competitors & collaborators (channels), map curation targets (playlists), and fill topical gaps (videos). Filters like date, duration, and sorting let you bias for fresh vs evergreen.

#Endpoints & when to use them

#POST /v1/youtube/search/autocomplete — Autocomplete

  • Best for: Idea mining, SEO variations, quick demand checks per language (hl).
  • Output: query, lang, suggestions[], cnt_results (wrapped under data).
  • Tip: Seed titles/descriptions with top 2–3 suggestions; batch by locale to localize copy.

#POST /v1/youtube/search/videos — Search Videos

  • Best for: Spot rising topics, collect examples by date or viewCount, and scope by duration.
  • Filters: sort (relevance/date/rating/title/viewCount), published_after/published_before (YYYY-MM-DD), duration (short/medium/long).
  • Output: videos[] with id, title, publishedAt, channelId, durationISO, views (wrapped under data).

#POST /v1/youtube/search/channels — Search Channels

  • Best for: Competitor mapping, outreach, “featured creators” rails.
  • Output: channels[] with id (channelId), title, description, publishedAt, thumb (wrapped under data).
  • Tip: Combine with youtube/channel/info to enrich topics and country.

#POST /v1/youtube/search/playlists — Search Playlists

  • Best for: Finding curation hubs to pitch or mirror; tracking “series” potential by list size.
  • Output: playlists[] with id, title, publishedAt, channelId, items (wrapped under data).

#Quick start

# Autocomplete (English)
curl -X POST "https://api.yeb.to/v1/youtube/search/autocomplete" \
  -H "Accept: application/json" -H "Content-Type: application/json" \
  -H "X-API-Key: <YOUR_API_KEY>" \
  -d '{ "q":"minecraft survival", "hl":"en" }'
# Videos (latest, short-form only)
curl -X POST "https://api.yeb.to/v1/youtube/search/videos" \
  -H "Accept: application/json" -H "Content-Type: application/json" \
  -H "X-API-Key: <YOUR_API_KEY>" \
  -d '{ "q":"how to draw", "sort":"date", "published_after":"2025-01-01", "duration":"short", "limit":10 }'
# Channels (top 5 by relevance)
curl -X POST "https://api.yeb.to/v1/youtube/search/channels" \
  -H "Accept: application/json" -H "Content-Type: application/json" \
  -H "X-API-Key: <YOUR_API_KEY>" \
  -d '{ "q":"technology reviews", "limit":5 }'
# Playlists (lofi, last year)
curl -X POST "https://api.yeb.to/v1/youtube/search/playlists" \
  -H "Accept: application/json" -H "Content-Type: application/json" \
  -H "X-API-Key: <YOUR_API_KEY>" \
  -d '{ "q":"lofi chill", "published_after":"2024-11-01", "limit":8 }'

#Parameters that actually matter

ParamTypeRequiredPractical guidance
api_keystringYes Keep server-side or sign short-lived tokens at the edge.
qstringYes* Query text. Optional only for autocomplete (empty → empty suggestions).
limitintNo 1–50 (default 25). Use 8/12/24 for tidy grids.
sortstringNo relevance (default) · date · rating · title · viewCount.
published_after/published_beforedateNo YYYY-MM-DD. We normalize to ISO; invalid inputs are ignored safely.
durationstringNo Videos only: any | short | medium | long.
hlstringNo Autocomplete UI language (ISO-639-1, e.g. en, de, tr).

#Reading & acting on responses

#Autocomplete — interpretation

{
  "data": {
    "query": "minecraft survival",
    "lang": "en",
    "suggestions": ["minecraft survival house","minecraft survival guide"],
    "cnt_results": 2
  }
}
  • Use top suggestions as title leads; echo 1–2 in description for better CTR + intent match.

#Videos — interpretation

{
  "data": {
    "cnt_results": 1,
    "videos": [
      {
        "id": "dQw4w9WgXcQ",
        "title": "How to draw a cat",
        "publishedAt": "2025-06-05T14:00:01Z",
        "channelId": "UCabc123",
        "durationISO": "PT3M45S",
        "views": 15230
      }
    ]
  }
}
  • Pipe id into youtube/video/* to check engagement, restrictions, and trending signals.
  • Use publishedAt with your calendar to time responsive mixes while the topic is hot.

#Channels — interpretation

{
  "data": {
    "cnt_results": 2,
    "channels": [
      {
        "id": "UC_x5XG1OV2P6uZZ5FSM9Ttw",
        "title": "Google Developers",
        "description": "The official Google Developers channel.",
        "publishedAt": "2007-08-23T00:34:43Z",
        "thumb": "https://yt3.ggpht.com/…"
      }
    ]
  }
}
  • Enrich each id with youtube/channel/info and statistics to prioritize partners.

#Playlists — interpretation

{
  "data": {
    "cnt_results": 1,
    "playlists": [
      {
        "id": "PL12345ABCDE",
        "title": "Lo-Fi Chill Beats",
        "publishedAt": "2024-11-17T10:00:00Z",
        "channelId": "UCLofi123",
        "items": 35
      }
    ]
  }
}
  • Sort by items to locate big curators; track publish cadence via publishedAt.

#Practical recipes

  • Idea mining per locale: Run autocomplete with hl in target languages; harvest 10–20 suggestions; group by stem.
  • Fresh topic tracker: videos with sort=date + published_after = last 7–30 days → push timely mixes.
  • Playlist outreach: Use playlists to find curators (high items); pitch your best-fitting mix.
  • Competitor map: channels → enrich with channel statistics and info; tag by topic for dashboards.

#YouTube identifiers you’ll use

FieldWhat it isHow to use
videoId 11-char video ID Feed into youtube/video/* endpoints (engagement, restrictions, audit).
channelId Canonical channel ID (UC…) Resolve to metadata via youtube/channel/*.
playlistId Playlist identifier Open as https://www.youtube.com/playlist?list={playlistId} for QA or outreach.

#Errors & troubleshooting

  • 400 "Missing "action" parameter" — Ensure routing sets the action segment.
  • 400 "Missing "q" (query) parameter" — Required for all except autocomplete.
  • No 4xx on bad dates — invalid published_after/before are ignored (safe default).
  • sort outside allowed values quietly falls back to relevance.

#API Changelog (youtube/search)

2026-03-07
Standardized response envelope. All search endpoints now return results under data (e.g., { "data": { "videos": [...] }}) for consistency across the suite.
2026-03-01
Date filters. Added published_after/published_before (YYYY-MM-DD) to videos/channels/playlists; normalized to ISO internally.
2026-02-23
Sorting parity. Unified sort values (relevance, date, rating, title, viewCount). Invalid values now fall back to relevance without errors.
2026-02-14
Autocomplete locales. Added hl for language-aware suggestions; tuned parsing for better result counts.

Try the Playgrounds attached to each endpoint above with your own queries to see live shapes and decide which filters matter for your workflow.

คำถามที่พบบ่อย

คุณสามารถส่งได้สูงสุด 20 คำขอต่อวินาที ตามขีดจำกัด burst ทั่วไป

คุณสามารถรวมคำสำคัญ, ระดับการค้นหาปลอดภัย, ช่วงวันที่เผยแพร่, ระยะเวลา (วิดีโอ), ลำดับ และขีดจำกัดผลลัพธ์ (1-50)

ใช่ ทุกคำขอ แม้แต่ที่เกิดข้อผิดพลาด จะใช้เครดิต เครดิตของคุณผูกกับจำนวนคำขอ ไม่ว่าจะสำเร็จหรือล้มเหลว หากข้อผิดพลาดเกิดจากปัญหาของแพลตฟอร์มฝั่งเราอย่างชัดเจน เราจะคืนเครดิตที่ได้รับผลกระทบ (ไม่มีการคืนเงินสด)

ติดต่อเราที่ [email protected] เรารับฟังความคิดเห็นอย่างจริงจัง—หากรายงานข้อบกพร่องหรือคำขอฟีเจอร์ของคุณมีความหมาย เราสามารถแก้ไขหรือปรับปรุง API ได้อย่างรวดเร็วและมอบเครดิตฟรี 50 เครดิตเป็นการขอบคุณ

ขึ้นอยู่กับ API และบางครั้งรวมถึง endpoint ด้วย บาง endpoint ใช้ข้อมูลจากแหล่งภายนอกซึ่งอาจมีขีดจำกัดที่เข้มงวดกว่า เรายังบังคับใช้ขีดจำกัดเพื่อป้องกันการใช้ในทางที่ผิดและรักษาเสถียรภาพของแพลตฟอร์ม ตรวจสอบเอกสารสำหรับขีดจำกัดเฉพาะของแต่ละ endpoint

เราใช้ระบบเครดิต เครดิตเป็นหน่วยจ่ายล่วงหน้าที่ไม่สามารถคืนเงินได้ ใช้สำหรับการเรียก API และเครื่องมือ เครดิตถูกใช้แบบ FIFO (เก่าสุดก่อน) และมีอายุ 12 เดือนนับจากวันที่ซื้อ แดชบอร์ดแสดงวันที่ซื้อแต่ละครั้งและวันหมดอายุ

ใช่ เครดิตที่ซื้อทั้งหมด (รวมถึงยอดคงเหลือเศษส่วน) มีอายุ 12 เดือนนับจากการซื้อ เครดิตที่ไม่ได้ใช้จะหมดอายุโดยอัตโนมัติและถูกลบอย่างถาวรเมื่อสิ้นสุดระยะเวลาที่มีผล เครดิตที่หมดอายุไม่สามารถกู้คืนหรือแปลงเป็นเงินสดหรือมูลค่าอื่นได้ กฎเปลี่ยนผ่าน: เครดิตที่ซื้อก่อน 22 ก.ย. 2025 ถือว่าซื้อเมื่อ 22 ก.ย. 2025 และหมดอายุ 22 ก.ย. 2026 (เว้นแต่ระบุวันหมดอายุที่เร็วกว่าตอนซื้อ)

ใช่—ภายในระยะเวลาที่มีผล เครดิตที่ไม่ได้ใช้ยังคงใช้ได้และยกยอดจากเดือนต่อเดือนจนกว่าจะหมดอายุ 12 เดือนหลังการซื้อ

เครดิตไม่สามารถคืนเงินได้ ซื้อเฉพาะที่คุณต้องการ—คุณสามารถเติมได้ภายหลังเสมอ หากข้อผิดพลาดของแพลตฟอร์มทำให้การเรียกเก็บเงินล้มเหลว เราอาจคืนเครดิตที่ได้รับผลกระทบหลังจากการตรวจสอบ ไม่มีการคืนเงินสด

ราคากำหนดเป็นเครดิต ไม่ใช่ดอลลาร์ แต่ละ endpoint มีราคาของตัวเอง—ดูป้าย "เครดิต / คำขอ" ด้านบน คุณจะรู้ค่าใช้จ่ายที่แน่นอนเสมอ
← กลับไปที่ API