What you get#
Onekey exposes YouTube as 44 endpoints behind one API key: 14 endpoints return one record (data is an object) and 30 endpoints return a list (data is an array). Every answer uses the same envelope (success, data, metadata, error), the cost is reported in metadata.credits_charged, and fields are mapped onto the unified schema so the code you write for YouTube also works for the rest of the video & streaming category.
Endpoints#
| Endpoint | What it does | Parameters | Credits | Status |
|---|---|---|---|---|
channel | YouTube channel details and statistics by channel id. | id* | 2 | beta may need a pack |
channel_about | A YouTube channel's public business contact: email (when the channel lists one) and country. | handle, channel_id, url | 72 | beta needs a pack |
channel_by_handle | YouTube channel details by @handle. | handle* | 2 | beta may need a pack |
channel_playlists | Playlists published by a YouTube channel (Playlists tab). | channel_id* | 2 | stable may need a pack |
channel_posts | Community posts from a YouTube channel (Posts tab). | channel_id* | 2 | stable may need a pack |
channel_profile | YouTube channel profile: title, handle, subscriber and video counts, description, avatar. | channel_id* | 1 | stable may need a pack |
channel_search | Search YouTube channels by keyword. | q* | 2 | stable may need a pack |
channel_shorts | Shorts from a YouTube channel (Shorts tab). | channel_id* | 2 | stable may need a pack |
channel_streams | Live streams and past broadcasts from a YouTube channel (Live tab). | channel_id* | 2 | stable may need a pack |
channel_videos | Latest uploads from a YouTube channel (Videos tab). | channel_id* | 2 | stable may need a pack |
channels_batch | Details and statistics for up to 10 YouTube channels in one call. | ids* | 1 | beta |
comment_replies | Replies to a YouTube comment (cursor from the parent comment's replies continuation). | cursor* | 2 | beta may need a pack |
comments | Top-level comments of a YouTube video (first 20). | id* | 2 | beta may need a pack |
community_post | A YouTube community post: text, images, likes and channel. | url* | 2 | beta needs a pack |
playlist | YouTube playlist details. | id* | 1 | beta |
playlist_info | YouTube playlist metadata: title, owner, video count, views, thumbnail. | playlist_id* | 1 | stable may need a pack |
playlist_items | Videos in a YouTube playlist (first 25). | id* | 2 | beta may need a pack |
playlist_videos | Videos inside a YouTube playlist (first page). | playlist_id* | 2 | stable may need a pack |
related | Related / up-next videos for a YouTube video. | id* | 2 | stable may need a pack |
resolve | Resolve a YouTube @handle or channel URL to its channel id. | handle* | 1 | stable may need a pack |
search | Search YouTube videos (Data API v3; costs 100 quota units per call). | q* | 3 | beta may need a pack |
search_channels | Search YouTube channels. | q* | 3 | beta may need a pack |
search_hashtag | YouTube videos tagged with a hashtag. | hashtag*, cursor | 2 | beta needs a pack |
search_latest | Search YouTube videos by keyword, newest uploads first. | q* | 2 | stable may need a pack |
search_live | Search currently live YouTube streams by keyword. | q* | 2 | stable may need a pack |
search_playlists | Search YouTube playlists by keyword. | q* | 2 | stable may need a pack |
search_videos | Search YouTube videos by keyword. | q* | 2 | stable may need a pack |
shorts_trending | Currently trending YouTube Shorts. | - | 2 | beta needs a pack |
suggest | YouTube search autocomplete suggestions for a partial query. | q* | 1 | stable |
transcript | Timed transcript segments of a YouTube video (cursor from youtube.video_next). | cursor* | 2 | beta may need a pack |
trending | Most popular YouTube videos in a region. | region | 2 | beta may need a pack |
video | YouTube video title and channel via oEmbed (no stats: those need an API key). | id* | 1 | stable |
video_audio | Downloadable audio stream formats of a YouTube video (signed urls). | id* | 2 | beta needs a pack |
video_categories | YouTube video categories for a region. | region | 2 | beta |
video_comments | Top-level comments on a YouTube video (page of a continuation cursor). | cursor* | 2 | beta may need a pack |
video_details | YouTube video details and statistics (Data API v3). | id* | 2 | beta may need a pack |
video_files | Downloadable video stream formats of a YouTube video (signed urls). | id* | 2 | beta needs a pack |
video_info | YouTube video details: title, description, channel, views, likes, duration, publish date. | id* | 1 | stable may need a pack |
video_next | YouTube watch page data and the continuation cursors needed for comments and transcript. | id* | 1 | stable may need a pack |
video_sponsors | Sponsors a YouTube video appears to promote (paid-promotion badge, description links). | url* | 2 | beta needs a pack |
video_subtitles | Subtitle files (language, format, download url) of a YouTube video. | id* | 2 | beta needs a pack |
video_thumbnails | Thumbnail image of a YouTube video (oEmbed): URL and pixel size, plus title and channel. | id* | 1 | stable |
video_transcript | Timed transcript (captions) of a YouTube video by video id. | id*, lang | 2 | beta needs a pack |
videos_batch | Details and statistics for up to 20 YouTube videos in one call. | ids* | 1 | beta |
A * marks a required parameter. Each endpoint name links to its reference page with the full parameter table, caching window and a recorded response.
Make a request#
This calls youtube.channel_profile (1 credit, stable). Replace YOUR_API_KEY with your key; sign up, no card. 1,000 free credits cover the open-platform endpoints. Hard-to-reach platforms (X, TikTok, Instagram, Reddit, and others marked on their page) need a verified email and a purchased pack.
curl "https://api.onekey.dev/v1/youtube/channel_profile?channel_id=UC_x5XG1OV2P6uZZ5FSM9Ttw" \
-H "x-api-key: YOUR_API_KEY"Fields you get back#
These unified fields come back from YouTube, with the same names as on every other platform. The count is how many of its 44 mapped endpoints return the field; a field the source lacks is null, never missing. 35 platform-specific fields (ext.<name>) come on top, documented on each endpoint page.
| Field | Type | Endpoints |
|---|---|---|
author.displayName | string | 32 |
content.id | string | 24 |
author.id | string | 23 |
content.title | string | 23 |
content.text | string | 20 |
media.thumbnailUrl | URL | 20 |
content.createdAt | ISO 8601 date | 10 |
engagement.views | integer | 9 |
author.avatarUrl | URL | 8 |
author.username | string | 8 |
engagement.comments | integer | 7 |
engagement.likes | integer | 7 |
author.url | URL | 6 |
content.url | URL | 5 |
author.bio | string | 4 |
media.durationSeconds | number | 4 |
media.url | URL | 4 |
author.followers | integer | 3 |
entity.name | string | 3 |
media.mimeType | string | 3 |
author.verified | boolean | 2 |
entity.id | string | 2 |
media.height | integer | 2 |
media.sizeBytes | integer | 2 |
media.width | integer | 2 |
author.contentCount | integer | 1 |
author.country | string | 1 |
author.createdAt | ISO 8601 date | 1 |
content.category | string | 1 |
entity.description | string | 1 |
entity.stats.itemCount | integer | 1 |
media.previewUrl | URL | 1 |
The full schema is in Unified schema.
Pricing#
YouTube calls cost 1 to 72 credits, flat per endpoint. Free when served from cache (0.2 credit for a cached response over 100 KB). Invalid, failed or not-found calls are not charged. See pricing for credit packs.