YouTube API
Access YouTube data including channels, videos, playlists, and analytics through a simple API interface.
Overview
API Plugin's YouTube API provides easy access to YouTube data and functionality. Perfect for fetching channel information, video details, playlists, and managing YouTube content programmatically.
Key benefits include:
- Channel data access
- Video information
- Playlist management
- Search capabilities
- Analytics data
- Secure authentication
- Simple integration
How to Setup
Getting started with the YouTube API is simple:
-
Sign in with Google
- Go to API Plugin marketplace
- Select YouTube API
- Click "Connect with Google"
- Choose your Google account
- Authorize required permissions
-
Start Using the API
- Copy your API endpoint
- Get your API token
- Start making requests
That's it! No need to:
- Create a Google Cloud project
- Set up OAuth credentials
- Enable APIs manually
- Handle complex configurations
We handle all the Google Cloud setup and OAuth complexity for you. Just sign in and start accessing your YouTube data.
Authentication
Your authentication token is automatically managed by API Plugin. Simply include your API token in requests:
// Example request using your API token
const response = await fetch('/v1/{appId}/{token}/channels?mine=true');
The API will automatically:
- Handle OAuth authentication
- Manage token refreshing
- Maintain secure connections
- Handle permission scopes
Available Endpoints
- Get Channel Information
GET /v1/{appId}/{token}/channels
Parameters:
part
: Data parts to retrieve (default: snippet,contentDetails,statistics)mine
: true (get authenticated user's channel)id
: Specific channel ID
Example Response:
{
"items": [
{
"id": "UC...",
"snippet": {
"title": "Channel Name",
"description": "Channel Description",
"publishedAt": "2024-01-01T00:00:00Z"
},
"statistics": {
"viewCount": "1000000",
"subscriberCount": "10000"
}
}
]
}
- Get Channel Videos
GET /v1/{appId}/{token}/channel-videos
Parameters:
channelId
: Target channel IDmaxResults
: Number of results (default: 50)pageToken
: Page token for paginationorder
: Sort order (date, rating, viewCount)
- Search YouTube
GET /v1/{appId}/{token}/search
Parameters:
q
: Search querytype
: Resource type (video, channel, playlist)maxResults
: Number of resultsorder
: Sort order
- Get Video Details
GET /v1/{appId}/{token}/videos
Parameters:
id
: Video ID(s)part
: Data parts to retrieve
- Get Trending Videos
GET /v1/{appId}/{token}/trending
Parameters:
regionCode
: Country code (default: US)maxResults
: Number of results
Example Code
// Get channel info
const channel = await fetch('/v1/{appId}/{token}/channels?mine=true');
// Search videos
const videos = await fetch('/v1/{appId}/{token}/search?q=tutorial&type=video');
// Get video details
const videoDetails = await fetch('/v1/{appId}/{token}/videos?id=videoId123');