API DocsyoutubeContentGet related videos
Get related videos
What this API is for
- Get YouTube video's related content recommendations (recommended videos list)
- Similar to the related videos shown on the right side of video playback page
- Returns all recommended videos at once (typically 20-30 videos)
GET
/openapi/api/v1/youtube/web_v2/get_related_videosPrice:Price unavailable · Actual charges depend on free quota and account discounts
Authentication
All API requests require a Bearer project token in the Authorization header
Authorization header
Authorization: Bearer YOUR_API_TOKENRequest parameters
- video_id: Video ID (recommended)
- video_url: Full video URL (optional, ignored if video_id is provided)
- need_format: Whether to format data (default true)
- true: Return formatted structured data (recommended)
- false: Return raw YouTube API structure (for debugging or custom parsing)
| Name | Location / type | Required | Notes | Example |
|---|---|---|---|---|
| video_id | query / string | No |
| dQw4w9WgXcQ |
| video_url | query / string | No |
| https://www.youtube.com/watch?v=dQw4w9WgXcQ |
| need_format | query / boolean | No |
|
Request examples
curl -X GET "https://api.trmesh.com/openapi/api/v1/youtube/web_v2/get_related_videos" \ -H "Authorization: Bearer sdc_your_project_token" \ -H "Accept: application/json"
Response fields
- When need_format=true:
- video_id: Current video ID
- related_videos: Related videos list
- video_id: Related video's ID
- title: Video title
- author: Author name
- author_id: Author channel ID
- author_url: Author channel URL
- length_text: Video duration text (e.g., "3:45")
- length_seconds: Video duration in seconds
- view_count_text: View count text (e.g., "1.2M views")
- short_view_count_text: Short view count text (e.g., "1.2M")
- published_time_text: Published time text (e.g., "2 days ago")
- thumbnails: All resolution thumbnails
- rich_thumbnail: Moving thumbnail (if available)
- badges: Video badges (e.g., NEW, LIVE)
- owner_badges: Channel verification badges
- video_url: Video URL
- navigation_endpoint: Navigation endpoint
- total_count: Total number of recommended videos
- When need_format=false:
- video_id: Current video ID
- related_videos: Raw lockupViewModel object list
- total_count: Total number of recommended videos
| Field | Type | Notes | Example |
|---|---|---|---|
| video_id | unknown |
| |
| related_videos | unknown |
| |
| title | unknown |
| |
| author | unknown |
| |
| author_id | unknown |
| |
| author_url | unknown |
| |
| length_text | unknown |
| |
| length_seconds | unknown |
| |
| view_count_text | unknown |
| |
| short_view_count_text | unknown |
| |
| published_time_text | unknown |
| |
| thumbnails | unknown |
| |
| rich_thumbnail | unknown |
| |
| badges | unknown |
| |
| owner_badges | unknown |
| |
| video_url | unknown |
| |
| navigation_endpoint | unknown |
| |
| total_count | unknown |
|
Common response envelope
Common fields for response status, request identifiers and data
| Field | Type | Notes | Example |
|---|---|---|---|
| code | integer |
| |
| request_id | string | null |
| |
| message | string |
| |
| message_zh | string |
| |
| support | string |
| |
| time | string |
| |
| time_stamp | integer |
| |
| time_zone | string |
| |
| docs | string | null |
| |
| cache_message | string | null |
| |
| cache_message_zh | string | null |
| |
| cache_url | string | null |
| |
| router | string |
| |
| params | unknown |
| |
| data | unknown | null |
|
Errors and limits
The docs cover not only success responses, but also auth failures, rate limits, and data-service errors
| Code | Meaning | Notes |
|---|---|---|
| 200 | Success | The request completed and returned the standard response envelope. |
| 401 | Unauthorized | The token is missing, invalid, or no longer active. |
| 429 | Rate limited | The request exceeded token, user, or plan-level throughput limits. |
| 502 | Service unavailable | The gateway could not obtain a healthy result. Retry in a moment. |
Next steps
New to the API? Read the guide or explore examples