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:

  1. Sign in with Google

    • Go to API Plugin marketplace
    • Select YouTube API
    • Click "Connect with Google"
    • Choose your Google account
    • Authorize required permissions
  2. 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

  1. 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"
            }
        }
    ]
}
  1. Get Channel Videos
GET /v1/{appId}/{token}/channel-videos

Parameters:

  • channelId: Target channel ID
  • maxResults: Number of results (default: 50)
  • pageToken: Page token for pagination
  • order: Sort order (date, rating, viewCount)
  1. Search YouTube
GET /v1/{appId}/{token}/search

Parameters:

  • q: Search query
  • type: Resource type (video, channel, playlist)
  • maxResults: Number of results
  • order: Sort order
  1. Get Video Details
GET /v1/{appId}/{token}/videos

Parameters:

  • id: Video ID(s)
  • part: Data parts to retrieve
  1. 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');