yebto/youtube-api

Laravel SDK for the Youtube API (yeb.to)

v1.0.0 2025-07-21 17:34 UTC

This package is auto-updated.

Last update: 2025-07-30 14:06:12 UTC


README

Youtube API Laravel SDK

Official Laravel SDK for the Youtube API by NETOX Ltd. – designed to make YouTube data retrieval and content generation seamless from within Laravel applications.

Table of Contents

Installation

Install the package using Composer:

composer require yebto/youtube-api

Publish the configuration file:

php artisan vendor:publish --tag=youtubeapi-config

Add your API key to your .env file:

YEB_KEY_ID=your_api_key_here

Usage

Import the facade and start making API calls:

use YoutubeAPI;

Examples

1. Channel Statistics

$stats = YoutubeAPI::channel('statistics', [
    'channel' => 'UC_x5XG1OV2P6uZZ5FSM9Ttw'
]);

2. Generate Video Title

$title = YoutubeAPI::generate('title-generator', [
    'topic'          => 'Laravel queue best practices',
    'keywords'       => ['laravel queue', 'horizon', 'redis'],
    'language'       => 'EN',
    'mood'           => 'energetic',
    'tone'           => 'educational',
    'emojis_mode'    => 'random_inject',
    'hashtags_mode'  => 'end',
    'channel'        => 'UC_x5XG1OV2P6uZZ5FSM9Ttw'
]);

3. Video Engagement Rate

$eng = YoutubeAPI::video('engagement-rate', [
    'video' => 'dQw4w9WgXcQ'
]);

4. Full-Text Video Search

$search = YoutubeAPI::search('videos', [
    'q'                => 'ai music generation',
    'limit'            => 30,
    'sort'             => 'date',
    'duration'         => 'medium',
    'published_after'  => '2024-01-01'
]);

5. Trending Gaming Videos in Germany

$trending = YoutubeAPI::trending([
    'country'  => 'DE',
    'category' => 20,
    'limit'    => 50
]);

Available Methods

  • YoutubeAPI::channel($action, $params = [])API Docs
  • YoutubeAPI::video($action, $params = [])API Docs
  • YoutubeAPI::generate($action, $params = [])API Docs
  • YoutubeAPI::search($action, $params = [])API Docs
  • YoutubeAPI::trending($params = [])API Docs

Parameters Reference

Helper Required Optional
channel channel, action order, limit, after, before
video video, action limit, order, repliesOn, country, categoryId
generate topic/channel/video, action keywords, language, mood, tone, emojis_mode, hashtags_mode, person
search q, action limit, sort, duration, published_after, published_before
trending country, category, limit

💡 All methods accept any additional parameters supported by the API.

Configuration

The SDK uses a single environment variable:

YEB_KEY_ID=your_api_key_here

You may customize other configuration settings via the config/youtubeapi.php file after publishing.

Features

  • Simple, expressive API

  • Fully integrated with Laravel

  • Supports powerful YouTube features like:

    • Channel & video analytics
    • Full-text search with filters
    • Title and metadata generation
    • Engagement rate calculations
    • Trending content discovery

Free Tier Access

🎁 You can get 1,000+ free API requests by registering on yeb.to using your Google account.

Steps:

  1. Visit https://yeb.to
  2. Click Login with Google
  3. Retrieve your API key and add it to your .env as YEB_KEY_ID

No credit card required!

Troubleshooting

If you encounter issues:

  • Ensure your API key is correct and active
  • Double-check that the config file is published
  • Validate parameters against the API reference
  • Check for typos in method names or required fields

Support

License

© NETOX Ltd. Licensed under a proprietary or custom license unless stated otherwise in the repository.

💬 Have an idea, feature request, or want to suggest a new YouTube-related API? Reach out to us at support@yeb.to — we’d love to hear from you!