Skip to content

Latest commit

 

History

History
2490 lines (1720 loc) · 68.4 KB

File metadata and controls

2490 lines (1720 loc) · 68.4 KB

ScrapeBadger\YouTubeApi

All URIs are relative to https://scrapebadger.com, except if the operation defines another base path.

Method HTTP request Description
youtubeBatchVideoDetail() POST /v1/youtube/videos/batch Batch video detail
youtubeChannelAbout() GET /v1/youtube/channels/{channel_id}/about Channel about
youtubeChannelPlaylists() GET /v1/youtube/channels/{channel_id}/playlists Channel playlists
youtubeChannelShorts() GET /v1/youtube/channels/{channel_id}/shorts Channel shorts
youtubeChannelStreams() GET /v1/youtube/channels/{channel_id}/streams Channel streams
youtubeChannelVideos() GET /v1/youtube/channels/{channel_id}/videos Channel videos
youtubeCommentReplies() GET /v1/youtube/videos/{video_id}/comments/{comment_id}/replies Comment replies
youtubeCommunityPostComments() GET /v1/youtube/posts/{post_id}/comments Community post comments
youtubeCommunityPosts() GET /v1/youtube/channels/{channel_id}/community Community posts
youtubeContentRegions() GET /v1/youtube/regions Content regions
youtubeGetACommunityPost() GET /v1/youtube/posts/{post_id} Get a community post
youtubeGetAMixRadioQueue() GET /v1/youtube/mixes/{playlist_id} Get a mix / radio queue
youtubeGetAShort() GET /v1/youtube/shorts/{video_id} Get a Short
youtubeGetChannelDetail() GET /v1/youtube/channels/{channel_id} Get channel detail
youtubeGetPlaylistDetail() GET /v1/youtube/playlists/{playlist_id} Get playlist detail
youtubeGetVideoDetail() GET /v1/youtube/videos/{video_id} Get video detail
youtubeGuestHomeFeed() GET /v1/youtube/home Guest home feed
youtubeKeywordSuggestions() GET /v1/youtube/autocomplete Keyword suggestions
youtubeListCaptionTracks() GET /v1/youtube/videos/{video_id}/captions List caption tracks
youtubeLiveChatMessages() GET /v1/youtube/videos/{video_id}/live_chat Live chat messages
youtubeOembedMetadata() GET /v1/youtube/oembed oEmbed metadata
youtubePlaylistItemsPage() GET /v1/youtube/playlists/{playlist_id}/items Playlist items page
youtubeRelatedVideos() GET /v1/youtube/videos/{video_id}/related Related videos
youtubeResolveHandleUrlToId() GET /v1/youtube/channels/resolve Resolve handle/URL to id
youtubeSearchWithinAChannel() GET /v1/youtube/channels/{channel_id}/search Search within a channel
youtubeSearchYoutube() GET /v1/youtube/search Search YouTube
youtubeSearchYoutubeMusic() GET /v1/youtube/music/search Search YouTube Music
youtubeShortsBySound() GET /v1/youtube/shorts/by_sound/{sound_id} Shorts by sound
youtubeStreamFormats() GET /v1/youtube/videos/{video_id}/streams Stream formats
youtubeSubscriberCountFast() GET /v1/youtube/channels/{channel_id}/subscriber_count Subscriber count (fast)
youtubeSupportedMarkets() GET /v1/youtube/markets Supported markets
youtubeTrendingShorts() GET /v1/youtube/trending/shorts Trending shorts
youtubeTrendingVideos() GET /v1/youtube/trending Trending videos
youtubeUiLanguages() GET /v1/youtube/languages UI languages
youtubeVideoCategories() GET /v1/youtube/categories Video categories
youtubeVideoComments() GET /v1/youtube/videos/{video_id}/comments Video comments
youtubeVideoTranscript() GET /v1/youtube/videos/{video_id}/transcript Video transcript
youtubeVideosUnderAHashtag() GET /v1/youtube/hashtags/{tag} Videos under a hashtag
youtubeYoutubeScraperHealthCheck() GET /v1/youtube/health YouTube scraper health check
youtubeYoutubeScraperHealthCheckHead() HEAD /v1/youtube/health YouTube scraper health check

youtubeBatchVideoDetail()

youtubeBatchVideoDetail($request_body): mixed

Batch video detail

Example

<?php
require_once(__DIR__ . '/vendor/autoload.php');


// Configure API key authorization: ApiKeyAuth
$config = ScrapeBadger\Configuration::getDefaultConfiguration()->setApiKey('X-API-Key', 'YOUR_API_KEY');
// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
// $config = ScrapeBadger\Configuration::getDefaultConfiguration()->setApiKeyPrefix('X-API-Key', 'Bearer');


$apiInstance = new ScrapeBadger\Api\YouTubeApi(
    // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`.
    // This is optional, `GuzzleHttp\Client` will be used as default.
    new GuzzleHttp\Client(),
    $config
);
$request_body = NULL; // array<string,mixed>

try {
    $result = $apiInstance->youtubeBatchVideoDetail($request_body);
    print_r($result);
} catch (Exception $e) {
    echo 'Exception when calling YouTubeApi->youtubeBatchVideoDetail: ', $e->getMessage(), PHP_EOL;
}

Parameters

Name Type Description Notes
request_body array<string,mixed>

Return type

mixed

Authorization

ApiKeyAuth

HTTP request headers

  • Content-Type: application/json
  • Accept: application/json

[Back to top] [Back to API list] [Back to Model list] [Back to README]

youtubeChannelAbout()

youtubeChannelAbout($channel_id): mixed

Channel about

Example

<?php
require_once(__DIR__ . '/vendor/autoload.php');


// Configure API key authorization: ApiKeyAuth
$config = ScrapeBadger\Configuration::getDefaultConfiguration()->setApiKey('X-API-Key', 'YOUR_API_KEY');
// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
// $config = ScrapeBadger\Configuration::getDefaultConfiguration()->setApiKeyPrefix('X-API-Key', 'Bearer');


$apiInstance = new ScrapeBadger\Api\YouTubeApi(
    // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`.
    // This is optional, `GuzzleHttp\Client` will be used as default.
    new GuzzleHttp\Client(),
    $config
);
$channel_id = 'channel_id_example'; // string

try {
    $result = $apiInstance->youtubeChannelAbout($channel_id);
    print_r($result);
} catch (Exception $e) {
    echo 'Exception when calling YouTubeApi->youtubeChannelAbout: ', $e->getMessage(), PHP_EOL;
}

Parameters

Name Type Description Notes
channel_id string

Return type

mixed

Authorization

ApiKeyAuth

HTTP request headers

  • Content-Type: Not defined
  • Accept: application/json

[Back to top] [Back to API list] [Back to Model list] [Back to README]

youtubeChannelPlaylists()

youtubeChannelPlaylists($channel_id): mixed

Channel playlists

Example

<?php
require_once(__DIR__ . '/vendor/autoload.php');


// Configure API key authorization: ApiKeyAuth
$config = ScrapeBadger\Configuration::getDefaultConfiguration()->setApiKey('X-API-Key', 'YOUR_API_KEY');
// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
// $config = ScrapeBadger\Configuration::getDefaultConfiguration()->setApiKeyPrefix('X-API-Key', 'Bearer');


$apiInstance = new ScrapeBadger\Api\YouTubeApi(
    // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`.
    // This is optional, `GuzzleHttp\Client` will be used as default.
    new GuzzleHttp\Client(),
    $config
);
$channel_id = 'channel_id_example'; // string

try {
    $result = $apiInstance->youtubeChannelPlaylists($channel_id);
    print_r($result);
} catch (Exception $e) {
    echo 'Exception when calling YouTubeApi->youtubeChannelPlaylists: ', $e->getMessage(), PHP_EOL;
}

Parameters

Name Type Description Notes
channel_id string

Return type

mixed

Authorization

ApiKeyAuth

HTTP request headers

  • Content-Type: Not defined
  • Accept: application/json

[Back to top] [Back to API list] [Back to Model list] [Back to README]

youtubeChannelShorts()

youtubeChannelShorts($channel_id): mixed

Channel shorts

Example

<?php
require_once(__DIR__ . '/vendor/autoload.php');


// Configure API key authorization: ApiKeyAuth
$config = ScrapeBadger\Configuration::getDefaultConfiguration()->setApiKey('X-API-Key', 'YOUR_API_KEY');
// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
// $config = ScrapeBadger\Configuration::getDefaultConfiguration()->setApiKeyPrefix('X-API-Key', 'Bearer');


$apiInstance = new ScrapeBadger\Api\YouTubeApi(
    // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`.
    // This is optional, `GuzzleHttp\Client` will be used as default.
    new GuzzleHttp\Client(),
    $config
);
$channel_id = 'channel_id_example'; // string

try {
    $result = $apiInstance->youtubeChannelShorts($channel_id);
    print_r($result);
} catch (Exception $e) {
    echo 'Exception when calling YouTubeApi->youtubeChannelShorts: ', $e->getMessage(), PHP_EOL;
}

Parameters

Name Type Description Notes
channel_id string

Return type

mixed

Authorization

ApiKeyAuth

HTTP request headers

  • Content-Type: Not defined
  • Accept: application/json

[Back to top] [Back to API list] [Back to Model list] [Back to README]

youtubeChannelStreams()

youtubeChannelStreams($channel_id): mixed

Channel streams

Example

<?php
require_once(__DIR__ . '/vendor/autoload.php');


// Configure API key authorization: ApiKeyAuth
$config = ScrapeBadger\Configuration::getDefaultConfiguration()->setApiKey('X-API-Key', 'YOUR_API_KEY');
// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
// $config = ScrapeBadger\Configuration::getDefaultConfiguration()->setApiKeyPrefix('X-API-Key', 'Bearer');


$apiInstance = new ScrapeBadger\Api\YouTubeApi(
    // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`.
    // This is optional, `GuzzleHttp\Client` will be used as default.
    new GuzzleHttp\Client(),
    $config
);
$channel_id = 'channel_id_example'; // string

try {
    $result = $apiInstance->youtubeChannelStreams($channel_id);
    print_r($result);
} catch (Exception $e) {
    echo 'Exception when calling YouTubeApi->youtubeChannelStreams: ', $e->getMessage(), PHP_EOL;
}

Parameters

Name Type Description Notes
channel_id string

Return type

mixed

Authorization

ApiKeyAuth

HTTP request headers

  • Content-Type: Not defined
  • Accept: application/json

[Back to top] [Back to API list] [Back to Model list] [Back to README]

youtubeChannelVideos()

youtubeChannelVideos($channel_id): mixed

Channel videos

Example

<?php
require_once(__DIR__ . '/vendor/autoload.php');


// Configure API key authorization: ApiKeyAuth
$config = ScrapeBadger\Configuration::getDefaultConfiguration()->setApiKey('X-API-Key', 'YOUR_API_KEY');
// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
// $config = ScrapeBadger\Configuration::getDefaultConfiguration()->setApiKeyPrefix('X-API-Key', 'Bearer');


$apiInstance = new ScrapeBadger\Api\YouTubeApi(
    // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`.
    // This is optional, `GuzzleHttp\Client` will be used as default.
    new GuzzleHttp\Client(),
    $config
);
$channel_id = 'channel_id_example'; // string

try {
    $result = $apiInstance->youtubeChannelVideos($channel_id);
    print_r($result);
} catch (Exception $e) {
    echo 'Exception when calling YouTubeApi->youtubeChannelVideos: ', $e->getMessage(), PHP_EOL;
}

Parameters

Name Type Description Notes
channel_id string

Return type

mixed

Authorization

ApiKeyAuth

HTTP request headers

  • Content-Type: Not defined
  • Accept: application/json

[Back to top] [Back to API list] [Back to Model list] [Back to README]

youtubeCommentReplies()

youtubeCommentReplies($video_id, $comment_id, $continuation): mixed

Comment replies

Example

<?php
require_once(__DIR__ . '/vendor/autoload.php');


// Configure API key authorization: ApiKeyAuth
$config = ScrapeBadger\Configuration::getDefaultConfiguration()->setApiKey('X-API-Key', 'YOUR_API_KEY');
// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
// $config = ScrapeBadger\Configuration::getDefaultConfiguration()->setApiKeyPrefix('X-API-Key', 'Bearer');


$apiInstance = new ScrapeBadger\Api\YouTubeApi(
    // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`.
    // This is optional, `GuzzleHttp\Client` will be used as default.
    new GuzzleHttp\Client(),
    $config
);
$video_id = 'video_id_example'; // string
$comment_id = 'comment_id_example'; // string
$continuation = 'continuation_example'; // string | Replies continuation token

try {
    $result = $apiInstance->youtubeCommentReplies($video_id, $comment_id, $continuation);
    print_r($result);
} catch (Exception $e) {
    echo 'Exception when calling YouTubeApi->youtubeCommentReplies: ', $e->getMessage(), PHP_EOL;
}

Parameters

Name Type Description Notes
video_id string
comment_id string
continuation string Replies continuation token

Return type

mixed

Authorization

ApiKeyAuth

HTTP request headers

  • Content-Type: Not defined
  • Accept: application/json

[Back to top] [Back to API list] [Back to Model list] [Back to README]

youtubeCommunityPostComments()

youtubeCommunityPostComments($post_id): mixed

Community post comments

Example

<?php
require_once(__DIR__ . '/vendor/autoload.php');


// Configure API key authorization: ApiKeyAuth
$config = ScrapeBadger\Configuration::getDefaultConfiguration()->setApiKey('X-API-Key', 'YOUR_API_KEY');
// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
// $config = ScrapeBadger\Configuration::getDefaultConfiguration()->setApiKeyPrefix('X-API-Key', 'Bearer');


$apiInstance = new ScrapeBadger\Api\YouTubeApi(
    // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`.
    // This is optional, `GuzzleHttp\Client` will be used as default.
    new GuzzleHttp\Client(),
    $config
);
$post_id = 'post_id_example'; // string

try {
    $result = $apiInstance->youtubeCommunityPostComments($post_id);
    print_r($result);
} catch (Exception $e) {
    echo 'Exception when calling YouTubeApi->youtubeCommunityPostComments: ', $e->getMessage(), PHP_EOL;
}

Parameters

Name Type Description Notes
post_id string

Return type

mixed

Authorization

ApiKeyAuth

HTTP request headers

  • Content-Type: Not defined
  • Accept: application/json

[Back to top] [Back to API list] [Back to Model list] [Back to README]

youtubeCommunityPosts()

youtubeCommunityPosts($channel_id): mixed

Community posts

Example

<?php
require_once(__DIR__ . '/vendor/autoload.php');


// Configure API key authorization: ApiKeyAuth
$config = ScrapeBadger\Configuration::getDefaultConfiguration()->setApiKey('X-API-Key', 'YOUR_API_KEY');
// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
// $config = ScrapeBadger\Configuration::getDefaultConfiguration()->setApiKeyPrefix('X-API-Key', 'Bearer');


$apiInstance = new ScrapeBadger\Api\YouTubeApi(
    // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`.
    // This is optional, `GuzzleHttp\Client` will be used as default.
    new GuzzleHttp\Client(),
    $config
);
$channel_id = 'channel_id_example'; // string

try {
    $result = $apiInstance->youtubeCommunityPosts($channel_id);
    print_r($result);
} catch (Exception $e) {
    echo 'Exception when calling YouTubeApi->youtubeCommunityPosts: ', $e->getMessage(), PHP_EOL;
}

Parameters

Name Type Description Notes
channel_id string

Return type

mixed

Authorization

ApiKeyAuth

HTTP request headers

  • Content-Type: Not defined
  • Accept: application/json

[Back to top] [Back to API list] [Back to Model list] [Back to README]

youtubeContentRegions()

youtubeContentRegions(): mixed

Content regions

Example

<?php
require_once(__DIR__ . '/vendor/autoload.php');


// Configure API key authorization: ApiKeyAuth
$config = ScrapeBadger\Configuration::getDefaultConfiguration()->setApiKey('X-API-Key', 'YOUR_API_KEY');
// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
// $config = ScrapeBadger\Configuration::getDefaultConfiguration()->setApiKeyPrefix('X-API-Key', 'Bearer');


$apiInstance = new ScrapeBadger\Api\YouTubeApi(
    // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`.
    // This is optional, `GuzzleHttp\Client` will be used as default.
    new GuzzleHttp\Client(),
    $config
);

try {
    $result = $apiInstance->youtubeContentRegions();
    print_r($result);
} catch (Exception $e) {
    echo 'Exception when calling YouTubeApi->youtubeContentRegions: ', $e->getMessage(), PHP_EOL;
}

Parameters

This endpoint does not need any parameter.

Return type

mixed

Authorization

ApiKeyAuth

HTTP request headers

  • Content-Type: Not defined
  • Accept: application/json

[Back to top] [Back to API list] [Back to Model list] [Back to README]

youtubeGetACommunityPost()

youtubeGetACommunityPost($post_id): mixed

Get a community post

Example

<?php
require_once(__DIR__ . '/vendor/autoload.php');


// Configure API key authorization: ApiKeyAuth
$config = ScrapeBadger\Configuration::getDefaultConfiguration()->setApiKey('X-API-Key', 'YOUR_API_KEY');
// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
// $config = ScrapeBadger\Configuration::getDefaultConfiguration()->setApiKeyPrefix('X-API-Key', 'Bearer');


$apiInstance = new ScrapeBadger\Api\YouTubeApi(
    // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`.
    // This is optional, `GuzzleHttp\Client` will be used as default.
    new GuzzleHttp\Client(),
    $config
);
$post_id = 'post_id_example'; // string

try {
    $result = $apiInstance->youtubeGetACommunityPost($post_id);
    print_r($result);
} catch (Exception $e) {
    echo 'Exception when calling YouTubeApi->youtubeGetACommunityPost: ', $e->getMessage(), PHP_EOL;
}

Parameters

Name Type Description Notes
post_id string

Return type

mixed

Authorization

ApiKeyAuth

HTTP request headers

  • Content-Type: Not defined
  • Accept: application/json

[Back to top] [Back to API list] [Back to Model list] [Back to README]

youtubeGetAMixRadioQueue()

youtubeGetAMixRadioQueue($playlist_id): mixed

Get a mix / radio queue

Example

<?php
require_once(__DIR__ . '/vendor/autoload.php');


// Configure API key authorization: ApiKeyAuth
$config = ScrapeBadger\Configuration::getDefaultConfiguration()->setApiKey('X-API-Key', 'YOUR_API_KEY');
// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
// $config = ScrapeBadger\Configuration::getDefaultConfiguration()->setApiKeyPrefix('X-API-Key', 'Bearer');


$apiInstance = new ScrapeBadger\Api\YouTubeApi(
    // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`.
    // This is optional, `GuzzleHttp\Client` will be used as default.
    new GuzzleHttp\Client(),
    $config
);
$playlist_id = 'playlist_id_example'; // string

try {
    $result = $apiInstance->youtubeGetAMixRadioQueue($playlist_id);
    print_r($result);
} catch (Exception $e) {
    echo 'Exception when calling YouTubeApi->youtubeGetAMixRadioQueue: ', $e->getMessage(), PHP_EOL;
}

Parameters

Name Type Description Notes
playlist_id string

Return type

mixed

Authorization

ApiKeyAuth

HTTP request headers

  • Content-Type: Not defined
  • Accept: application/json

[Back to top] [Back to API list] [Back to Model list] [Back to README]

youtubeGetAShort()

youtubeGetAShort($video_id): mixed

Get a Short

Example

<?php
require_once(__DIR__ . '/vendor/autoload.php');


// Configure API key authorization: ApiKeyAuth
$config = ScrapeBadger\Configuration::getDefaultConfiguration()->setApiKey('X-API-Key', 'YOUR_API_KEY');
// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
// $config = ScrapeBadger\Configuration::getDefaultConfiguration()->setApiKeyPrefix('X-API-Key', 'Bearer');


$apiInstance = new ScrapeBadger\Api\YouTubeApi(
    // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`.
    // This is optional, `GuzzleHttp\Client` will be used as default.
    new GuzzleHttp\Client(),
    $config
);
$video_id = 'video_id_example'; // string

try {
    $result = $apiInstance->youtubeGetAShort($video_id);
    print_r($result);
} catch (Exception $e) {
    echo 'Exception when calling YouTubeApi->youtubeGetAShort: ', $e->getMessage(), PHP_EOL;
}

Parameters

Name Type Description Notes
video_id string

Return type

mixed

Authorization

ApiKeyAuth

HTTP request headers

  • Content-Type: Not defined
  • Accept: application/json

[Back to top] [Back to API list] [Back to Model list] [Back to README]

youtubeGetChannelDetail()

youtubeGetChannelDetail($channel_id, $gl, $hl): mixed

Get channel detail

Channel detail (accepts a UC id, @handle, or custom URL).

Example

<?php
require_once(__DIR__ . '/vendor/autoload.php');


// Configure API key authorization: ApiKeyAuth
$config = ScrapeBadger\Configuration::getDefaultConfiguration()->setApiKey('X-API-Key', 'YOUR_API_KEY');
// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
// $config = ScrapeBadger\Configuration::getDefaultConfiguration()->setApiKeyPrefix('X-API-Key', 'Bearer');


$apiInstance = new ScrapeBadger\Api\YouTubeApi(
    // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`.
    // This is optional, `GuzzleHttp\Client` will be used as default.
    new GuzzleHttp\Client(),
    $config
);
$channel_id = 'channel_id_example'; // string
$gl = 'gl_example'; // string
$hl = 'hl_example'; // string

try {
    $result = $apiInstance->youtubeGetChannelDetail($channel_id, $gl, $hl);
    print_r($result);
} catch (Exception $e) {
    echo 'Exception when calling YouTubeApi->youtubeGetChannelDetail: ', $e->getMessage(), PHP_EOL;
}

Parameters

Name Type Description Notes
channel_id string
gl string [optional]
hl string [optional]

Return type

mixed

Authorization

ApiKeyAuth

HTTP request headers

  • Content-Type: Not defined
  • Accept: application/json

[Back to top] [Back to API list] [Back to Model list] [Back to README]

youtubeGetPlaylistDetail()

youtubeGetPlaylistDetail($playlist_id): mixed

Get playlist detail

Example

<?php
require_once(__DIR__ . '/vendor/autoload.php');


// Configure API key authorization: ApiKeyAuth
$config = ScrapeBadger\Configuration::getDefaultConfiguration()->setApiKey('X-API-Key', 'YOUR_API_KEY');
// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
// $config = ScrapeBadger\Configuration::getDefaultConfiguration()->setApiKeyPrefix('X-API-Key', 'Bearer');


$apiInstance = new ScrapeBadger\Api\YouTubeApi(
    // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`.
    // This is optional, `GuzzleHttp\Client` will be used as default.
    new GuzzleHttp\Client(),
    $config
);
$playlist_id = 'playlist_id_example'; // string

try {
    $result = $apiInstance->youtubeGetPlaylistDetail($playlist_id);
    print_r($result);
} catch (Exception $e) {
    echo 'Exception when calling YouTubeApi->youtubeGetPlaylistDetail: ', $e->getMessage(), PHP_EOL;
}

Parameters

Name Type Description Notes
playlist_id string

Return type

mixed

Authorization

ApiKeyAuth

HTTP request headers

  • Content-Type: Not defined
  • Accept: application/json

[Back to top] [Back to API list] [Back to Model list] [Back to README]

youtubeGetVideoDetail()

youtubeGetVideoDetail($video_id, $gl, $hl): mixed

Get video detail

Full video detail — merged player + next (likes, comments, chapters, related).

Example

<?php
require_once(__DIR__ . '/vendor/autoload.php');


// Configure API key authorization: ApiKeyAuth
$config = ScrapeBadger\Configuration::getDefaultConfiguration()->setApiKey('X-API-Key', 'YOUR_API_KEY');
// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
// $config = ScrapeBadger\Configuration::getDefaultConfiguration()->setApiKeyPrefix('X-API-Key', 'Bearer');


$apiInstance = new ScrapeBadger\Api\YouTubeApi(
    // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`.
    // This is optional, `GuzzleHttp\Client` will be used as default.
    new GuzzleHttp\Client(),
    $config
);
$video_id = 'video_id_example'; // string
$gl = 'gl_example'; // string
$hl = 'hl_example'; // string

try {
    $result = $apiInstance->youtubeGetVideoDetail($video_id, $gl, $hl);
    print_r($result);
} catch (Exception $e) {
    echo 'Exception when calling YouTubeApi->youtubeGetVideoDetail: ', $e->getMessage(), PHP_EOL;
}

Parameters

Name Type Description Notes
video_id string
gl string [optional]
hl string [optional]

Return type

mixed

Authorization

ApiKeyAuth

HTTP request headers

  • Content-Type: Not defined
  • Accept: application/json

[Back to top] [Back to API list] [Back to Model list] [Back to README]

youtubeGuestHomeFeed()

youtubeGuestHomeFeed(): mixed

Guest home feed

Example

<?php
require_once(__DIR__ . '/vendor/autoload.php');


// Configure API key authorization: ApiKeyAuth
$config = ScrapeBadger\Configuration::getDefaultConfiguration()->setApiKey('X-API-Key', 'YOUR_API_KEY');
// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
// $config = ScrapeBadger\Configuration::getDefaultConfiguration()->setApiKeyPrefix('X-API-Key', 'Bearer');


$apiInstance = new ScrapeBadger\Api\YouTubeApi(
    // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`.
    // This is optional, `GuzzleHttp\Client` will be used as default.
    new GuzzleHttp\Client(),
    $config
);

try {
    $result = $apiInstance->youtubeGuestHomeFeed();
    print_r($result);
} catch (Exception $e) {
    echo 'Exception when calling YouTubeApi->youtubeGuestHomeFeed: ', $e->getMessage(), PHP_EOL;
}

Parameters

This endpoint does not need any parameter.

Return type

mixed

Authorization

ApiKeyAuth

HTTP request headers

  • Content-Type: Not defined
  • Accept: application/json

[Back to top] [Back to API list] [Back to Model list] [Back to README]

youtubeKeywordSuggestions()

youtubeKeywordSuggestions($query, $gl, $hl): mixed

Keyword suggestions

Return YouTube keyword autocomplete suggestions.

Example

<?php
require_once(__DIR__ . '/vendor/autoload.php');


// Configure API key authorization: ApiKeyAuth
$config = ScrapeBadger\Configuration::getDefaultConfiguration()->setApiKey('X-API-Key', 'YOUR_API_KEY');
// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
// $config = ScrapeBadger\Configuration::getDefaultConfiguration()->setApiKeyPrefix('X-API-Key', 'Bearer');


$apiInstance = new ScrapeBadger\Api\YouTubeApi(
    // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`.
    // This is optional, `GuzzleHttp\Client` will be used as default.
    new GuzzleHttp\Client(),
    $config
);
$query = 'query_example'; // string | Partial query prefix
$gl = 'gl_example'; // string
$hl = 'hl_example'; // string

try {
    $result = $apiInstance->youtubeKeywordSuggestions($query, $gl, $hl);
    print_r($result);
} catch (Exception $e) {
    echo 'Exception when calling YouTubeApi->youtubeKeywordSuggestions: ', $e->getMessage(), PHP_EOL;
}

Parameters

Name Type Description Notes
query string Partial query prefix
gl string [optional]
hl string [optional]

Return type

mixed

Authorization

ApiKeyAuth

HTTP request headers

  • Content-Type: Not defined
  • Accept: application/json

[Back to top] [Back to API list] [Back to Model list] [Back to README]

youtubeListCaptionTracks()

youtubeListCaptionTracks($video_id): mixed

List caption tracks

Example

<?php
require_once(__DIR__ . '/vendor/autoload.php');


// Configure API key authorization: ApiKeyAuth
$config = ScrapeBadger\Configuration::getDefaultConfiguration()->setApiKey('X-API-Key', 'YOUR_API_KEY');
// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
// $config = ScrapeBadger\Configuration::getDefaultConfiguration()->setApiKeyPrefix('X-API-Key', 'Bearer');


$apiInstance = new ScrapeBadger\Api\YouTubeApi(
    // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`.
    // This is optional, `GuzzleHttp\Client` will be used as default.
    new GuzzleHttp\Client(),
    $config
);
$video_id = 'video_id_example'; // string

try {
    $result = $apiInstance->youtubeListCaptionTracks($video_id);
    print_r($result);
} catch (Exception $e) {
    echo 'Exception when calling YouTubeApi->youtubeListCaptionTracks: ', $e->getMessage(), PHP_EOL;
}

Parameters

Name Type Description Notes
video_id string

Return type

mixed

Authorization

ApiKeyAuth

HTTP request headers

  • Content-Type: Not defined
  • Accept: application/json

[Back to top] [Back to API list] [Back to Model list] [Back to README]

youtubeLiveChatMessages()

youtubeLiveChatMessages($video_id, $continuation, $replay): mixed

Live chat messages

Example

<?php
require_once(__DIR__ . '/vendor/autoload.php');


// Configure API key authorization: ApiKeyAuth
$config = ScrapeBadger\Configuration::getDefaultConfiguration()->setApiKey('X-API-Key', 'YOUR_API_KEY');
// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
// $config = ScrapeBadger\Configuration::getDefaultConfiguration()->setApiKeyPrefix('X-API-Key', 'Bearer');


$apiInstance = new ScrapeBadger\Api\YouTubeApi(
    // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`.
    // This is optional, `GuzzleHttp\Client` will be used as default.
    new GuzzleHttp\Client(),
    $config
);
$video_id = 'video_id_example'; // string
$continuation = 'continuation_example'; // string
$replay = false; // bool

try {
    $result = $apiInstance->youtubeLiveChatMessages($video_id, $continuation, $replay);
    print_r($result);
} catch (Exception $e) {
    echo 'Exception when calling YouTubeApi->youtubeLiveChatMessages: ', $e->getMessage(), PHP_EOL;
}

Parameters

Name Type Description Notes
video_id string
continuation string [optional]
replay bool [optional] [default to false]

Return type

mixed

Authorization

ApiKeyAuth

HTTP request headers

  • Content-Type: Not defined
  • Accept: application/json

[Back to top] [Back to API list] [Back to Model list] [Back to README]

youtubeOembedMetadata()

youtubeOembedMetadata($url): mixed

oEmbed metadata

Example

<?php
require_once(__DIR__ . '/vendor/autoload.php');


// Configure API key authorization: ApiKeyAuth
$config = ScrapeBadger\Configuration::getDefaultConfiguration()->setApiKey('X-API-Key', 'YOUR_API_KEY');
// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
// $config = ScrapeBadger\Configuration::getDefaultConfiguration()->setApiKeyPrefix('X-API-Key', 'Bearer');


$apiInstance = new ScrapeBadger\Api\YouTubeApi(
    // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`.
    // This is optional, `GuzzleHttp\Client` will be used as default.
    new GuzzleHttp\Client(),
    $config
);
$url = 'url_example'; // string | A YouTube URL

try {
    $result = $apiInstance->youtubeOembedMetadata($url);
    print_r($result);
} catch (Exception $e) {
    echo 'Exception when calling YouTubeApi->youtubeOembedMetadata: ', $e->getMessage(), PHP_EOL;
}

Parameters

Name Type Description Notes
url string A YouTube URL

Return type

mixed

Authorization

ApiKeyAuth

HTTP request headers

  • Content-Type: Not defined
  • Accept: application/json

[Back to top] [Back to API list] [Back to Model list] [Back to README]

youtubePlaylistItemsPage()

youtubePlaylistItemsPage($playlist_id): mixed

Playlist items page

Example

<?php
require_once(__DIR__ . '/vendor/autoload.php');


// Configure API key authorization: ApiKeyAuth
$config = ScrapeBadger\Configuration::getDefaultConfiguration()->setApiKey('X-API-Key', 'YOUR_API_KEY');
// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
// $config = ScrapeBadger\Configuration::getDefaultConfiguration()->setApiKeyPrefix('X-API-Key', 'Bearer');


$apiInstance = new ScrapeBadger\Api\YouTubeApi(
    // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`.
    // This is optional, `GuzzleHttp\Client` will be used as default.
    new GuzzleHttp\Client(),
    $config
);
$playlist_id = 'playlist_id_example'; // string

try {
    $result = $apiInstance->youtubePlaylistItemsPage($playlist_id);
    print_r($result);
} catch (Exception $e) {
    echo 'Exception when calling YouTubeApi->youtubePlaylistItemsPage: ', $e->getMessage(), PHP_EOL;
}

Parameters

Name Type Description Notes
playlist_id string

Return type

mixed

Authorization

ApiKeyAuth

HTTP request headers

  • Content-Type: Not defined
  • Accept: application/json

[Back to top] [Back to API list] [Back to Model list] [Back to README]

youtubeRelatedVideos()

youtubeRelatedVideos($video_id): mixed

Related videos

Example

<?php
require_once(__DIR__ . '/vendor/autoload.php');


// Configure API key authorization: ApiKeyAuth
$config = ScrapeBadger\Configuration::getDefaultConfiguration()->setApiKey('X-API-Key', 'YOUR_API_KEY');
// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
// $config = ScrapeBadger\Configuration::getDefaultConfiguration()->setApiKeyPrefix('X-API-Key', 'Bearer');


$apiInstance = new ScrapeBadger\Api\YouTubeApi(
    // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`.
    // This is optional, `GuzzleHttp\Client` will be used as default.
    new GuzzleHttp\Client(),
    $config
);
$video_id = 'video_id_example'; // string

try {
    $result = $apiInstance->youtubeRelatedVideos($video_id);
    print_r($result);
} catch (Exception $e) {
    echo 'Exception when calling YouTubeApi->youtubeRelatedVideos: ', $e->getMessage(), PHP_EOL;
}

Parameters

Name Type Description Notes
video_id string

Return type

mixed

Authorization

ApiKeyAuth

HTTP request headers

  • Content-Type: Not defined
  • Accept: application/json

[Back to top] [Back to API list] [Back to Model list] [Back to README]

youtubeResolveHandleUrlToId()

youtubeResolveHandleUrlToId($handle, $url): mixed

Resolve handle/URL to id

Example

<?php
require_once(__DIR__ . '/vendor/autoload.php');


// Configure API key authorization: ApiKeyAuth
$config = ScrapeBadger\Configuration::getDefaultConfiguration()->setApiKey('X-API-Key', 'YOUR_API_KEY');
// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
// $config = ScrapeBadger\Configuration::getDefaultConfiguration()->setApiKeyPrefix('X-API-Key', 'Bearer');


$apiInstance = new ScrapeBadger\Api\YouTubeApi(
    // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`.
    // This is optional, `GuzzleHttp\Client` will be used as default.
    new GuzzleHttp\Client(),
    $config
);
$handle = 'handle_example'; // string
$url = 'url_example'; // string

try {
    $result = $apiInstance->youtubeResolveHandleUrlToId($handle, $url);
    print_r($result);
} catch (Exception $e) {
    echo 'Exception when calling YouTubeApi->youtubeResolveHandleUrlToId: ', $e->getMessage(), PHP_EOL;
}

Parameters

Name Type Description Notes
handle string [optional]
url string [optional]

Return type

mixed

Authorization

ApiKeyAuth

HTTP request headers

  • Content-Type: Not defined
  • Accept: application/json

[Back to top] [Back to API list] [Back to Model list] [Back to README]

youtubeSearchWithinAChannel()

youtubeSearchWithinAChannel($channel_id, $query): mixed

Search within a channel

Example

<?php
require_once(__DIR__ . '/vendor/autoload.php');


// Configure API key authorization: ApiKeyAuth
$config = ScrapeBadger\Configuration::getDefaultConfiguration()->setApiKey('X-API-Key', 'YOUR_API_KEY');
// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
// $config = ScrapeBadger\Configuration::getDefaultConfiguration()->setApiKeyPrefix('X-API-Key', 'Bearer');


$apiInstance = new ScrapeBadger\Api\YouTubeApi(
    // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`.
    // This is optional, `GuzzleHttp\Client` will be used as default.
    new GuzzleHttp\Client(),
    $config
);
$channel_id = 'channel_id_example'; // string
$query = 'query_example'; // string | Search keywords

try {
    $result = $apiInstance->youtubeSearchWithinAChannel($channel_id, $query);
    print_r($result);
} catch (Exception $e) {
    echo 'Exception when calling YouTubeApi->youtubeSearchWithinAChannel: ', $e->getMessage(), PHP_EOL;
}

Parameters

Name Type Description Notes
channel_id string
query string Search keywords

Return type

mixed

Authorization

ApiKeyAuth

HTTP request headers

  • Content-Type: Not defined
  • Accept: application/json

[Back to top] [Back to API list] [Back to Model list] [Back to README]

youtubeSearchYoutube()

youtubeSearchYoutube($query, $type, $sort_by, $upload_date, $duration, $features, $gl, $hl, $continuation): mixed

Search YouTube

Search videos / channels / playlists with the full filter matrix.

Example

<?php
require_once(__DIR__ . '/vendor/autoload.php');


// Configure API key authorization: ApiKeyAuth
$config = ScrapeBadger\Configuration::getDefaultConfiguration()->setApiKey('X-API-Key', 'YOUR_API_KEY');
// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
// $config = ScrapeBadger\Configuration::getDefaultConfiguration()->setApiKeyPrefix('X-API-Key', 'Bearer');


$apiInstance = new ScrapeBadger\Api\YouTubeApi(
    // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`.
    // This is optional, `GuzzleHttp\Client` will be used as default.
    new GuzzleHttp\Client(),
    $config
);
$query = 'query_example'; // string | Search keywords
$type = 'type_example'; // string | video|channel|playlist|movie|all
$sort_by = 'sort_by_example'; // string | relevance|date|views|rating
$upload_date = 'upload_date_example'; // string | hour|today|week|month|year
$duration = 'duration_example'; // string | short|medium|long
$features = 'features_example'; // string | hd,4k,360,vr180,3d,hdr,cc,subtitles,live
$gl = 'gl_example'; // string | Content region (US, GB, DE…)
$hl = 'hl_example'; // string | UI language
$continuation = 'continuation_example'; // string

try {
    $result = $apiInstance->youtubeSearchYoutube($query, $type, $sort_by, $upload_date, $duration, $features, $gl, $hl, $continuation);
    print_r($result);
} catch (Exception $e) {
    echo 'Exception when calling YouTubeApi->youtubeSearchYoutube: ', $e->getMessage(), PHP_EOL;
}

Parameters

Name Type Description Notes
query string Search keywords
type string video channel
sort_by string relevance date
upload_date string hour today
duration string short medium
features string hd,4k,360,vr180,3d,hdr,cc,subtitles,live [optional]
gl string Content region (US, GB, DE…) [optional]
hl string UI language [optional]
continuation string [optional]

Return type

mixed

Authorization

ApiKeyAuth

HTTP request headers

  • Content-Type: Not defined
  • Accept: application/json

[Back to top] [Back to API list] [Back to Model list] [Back to README]

youtubeSearchYoutubeMusic()

youtubeSearchYoutubeMusic($query): mixed

Search YouTube Music

Example

<?php
require_once(__DIR__ . '/vendor/autoload.php');


// Configure API key authorization: ApiKeyAuth
$config = ScrapeBadger\Configuration::getDefaultConfiguration()->setApiKey('X-API-Key', 'YOUR_API_KEY');
// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
// $config = ScrapeBadger\Configuration::getDefaultConfiguration()->setApiKeyPrefix('X-API-Key', 'Bearer');


$apiInstance = new ScrapeBadger\Api\YouTubeApi(
    // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`.
    // This is optional, `GuzzleHttp\Client` will be used as default.
    new GuzzleHttp\Client(),
    $config
);
$query = 'query_example'; // string | Search keywords

try {
    $result = $apiInstance->youtubeSearchYoutubeMusic($query);
    print_r($result);
} catch (Exception $e) {
    echo 'Exception when calling YouTubeApi->youtubeSearchYoutubeMusic: ', $e->getMessage(), PHP_EOL;
}

Parameters

Name Type Description Notes
query string Search keywords

Return type

mixed

Authorization

ApiKeyAuth

HTTP request headers

  • Content-Type: Not defined
  • Accept: application/json

[Back to top] [Back to API list] [Back to Model list] [Back to README]

youtubeShortsBySound()

youtubeShortsBySound($sound_id): mixed

Shorts by sound

Example

<?php
require_once(__DIR__ . '/vendor/autoload.php');


// Configure API key authorization: ApiKeyAuth
$config = ScrapeBadger\Configuration::getDefaultConfiguration()->setApiKey('X-API-Key', 'YOUR_API_KEY');
// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
// $config = ScrapeBadger\Configuration::getDefaultConfiguration()->setApiKeyPrefix('X-API-Key', 'Bearer');


$apiInstance = new ScrapeBadger\Api\YouTubeApi(
    // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`.
    // This is optional, `GuzzleHttp\Client` will be used as default.
    new GuzzleHttp\Client(),
    $config
);
$sound_id = 'sound_id_example'; // string

try {
    $result = $apiInstance->youtubeShortsBySound($sound_id);
    print_r($result);
} catch (Exception $e) {
    echo 'Exception when calling YouTubeApi->youtubeShortsBySound: ', $e->getMessage(), PHP_EOL;
}

Parameters

Name Type Description Notes
sound_id string

Return type

mixed

Authorization

ApiKeyAuth

HTTP request headers

  • Content-Type: Not defined
  • Accept: application/json

[Back to top] [Back to API list] [Back to Model list] [Back to README]

youtubeStreamFormats()

youtubeStreamFormats($video_id, $client): mixed

Stream formats

Stream/format metadata (best-effort; media URLs may be PO-token gated).

Example

<?php
require_once(__DIR__ . '/vendor/autoload.php');


// Configure API key authorization: ApiKeyAuth
$config = ScrapeBadger\Configuration::getDefaultConfiguration()->setApiKey('X-API-Key', 'YOUR_API_KEY');
// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
// $config = ScrapeBadger\Configuration::getDefaultConfiguration()->setApiKeyPrefix('X-API-Key', 'Bearer');


$apiInstance = new ScrapeBadger\Api\YouTubeApi(
    // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`.
    // This is optional, `GuzzleHttp\Client` will be used as default.
    new GuzzleHttp\Client(),
    $config
);
$video_id = 'video_id_example'; // string
$client = 'IOS'; // string | IOS|ANDROID|WEB

try {
    $result = $apiInstance->youtubeStreamFormats($video_id, $client);
    print_r($result);
} catch (Exception $e) {
    echo 'Exception when calling YouTubeApi->youtubeStreamFormats: ', $e->getMessage(), PHP_EOL;
}

Parameters

Name Type Description Notes
video_id string
client string IOS ANDROID

Return type

mixed

Authorization

ApiKeyAuth

HTTP request headers

  • Content-Type: Not defined
  • Accept: application/json

[Back to top] [Back to API list] [Back to Model list] [Back to README]

youtubeSubscriberCountFast()

youtubeSubscriberCountFast($channel_id): mixed

Subscriber count (fast)

Example

<?php
require_once(__DIR__ . '/vendor/autoload.php');


// Configure API key authorization: ApiKeyAuth
$config = ScrapeBadger\Configuration::getDefaultConfiguration()->setApiKey('X-API-Key', 'YOUR_API_KEY');
// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
// $config = ScrapeBadger\Configuration::getDefaultConfiguration()->setApiKeyPrefix('X-API-Key', 'Bearer');


$apiInstance = new ScrapeBadger\Api\YouTubeApi(
    // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`.
    // This is optional, `GuzzleHttp\Client` will be used as default.
    new GuzzleHttp\Client(),
    $config
);
$channel_id = 'channel_id_example'; // string

try {
    $result = $apiInstance->youtubeSubscriberCountFast($channel_id);
    print_r($result);
} catch (Exception $e) {
    echo 'Exception when calling YouTubeApi->youtubeSubscriberCountFast: ', $e->getMessage(), PHP_EOL;
}

Parameters

Name Type Description Notes
channel_id string

Return type

mixed

Authorization

ApiKeyAuth

HTTP request headers

  • Content-Type: Not defined
  • Accept: application/json

[Back to top] [Back to API list] [Back to Model list] [Back to README]

youtubeSupportedMarkets()

youtubeSupportedMarkets(): mixed

Supported markets

Example

<?php
require_once(__DIR__ . '/vendor/autoload.php');


// Configure API key authorization: ApiKeyAuth
$config = ScrapeBadger\Configuration::getDefaultConfiguration()->setApiKey('X-API-Key', 'YOUR_API_KEY');
// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
// $config = ScrapeBadger\Configuration::getDefaultConfiguration()->setApiKeyPrefix('X-API-Key', 'Bearer');


$apiInstance = new ScrapeBadger\Api\YouTubeApi(
    // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`.
    // This is optional, `GuzzleHttp\Client` will be used as default.
    new GuzzleHttp\Client(),
    $config
);

try {
    $result = $apiInstance->youtubeSupportedMarkets();
    print_r($result);
} catch (Exception $e) {
    echo 'Exception when calling YouTubeApi->youtubeSupportedMarkets: ', $e->getMessage(), PHP_EOL;
}

Parameters

This endpoint does not need any parameter.

Return type

mixed

Authorization

ApiKeyAuth

HTTP request headers

  • Content-Type: Not defined
  • Accept: application/json

[Back to top] [Back to API list] [Back to Model list] [Back to README]

youtubeTrendingShorts()

youtubeTrendingShorts(): mixed

Trending shorts

Example

<?php
require_once(__DIR__ . '/vendor/autoload.php');


// Configure API key authorization: ApiKeyAuth
$config = ScrapeBadger\Configuration::getDefaultConfiguration()->setApiKey('X-API-Key', 'YOUR_API_KEY');
// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
// $config = ScrapeBadger\Configuration::getDefaultConfiguration()->setApiKeyPrefix('X-API-Key', 'Bearer');


$apiInstance = new ScrapeBadger\Api\YouTubeApi(
    // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`.
    // This is optional, `GuzzleHttp\Client` will be used as default.
    new GuzzleHttp\Client(),
    $config
);

try {
    $result = $apiInstance->youtubeTrendingShorts();
    print_r($result);
} catch (Exception $e) {
    echo 'Exception when calling YouTubeApi->youtubeTrendingShorts: ', $e->getMessage(), PHP_EOL;
}

Parameters

This endpoint does not need any parameter.

Return type

mixed

Authorization

ApiKeyAuth

HTTP request headers

  • Content-Type: Not defined
  • Accept: application/json

[Back to top] [Back to API list] [Back to Model list] [Back to README]

youtubeTrendingVideos()

youtubeTrendingVideos($gl, $type): mixed

Trending videos

Example

<?php
require_once(__DIR__ . '/vendor/autoload.php');


// Configure API key authorization: ApiKeyAuth
$config = ScrapeBadger\Configuration::getDefaultConfiguration()->setApiKey('X-API-Key', 'YOUR_API_KEY');
// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
// $config = ScrapeBadger\Configuration::getDefaultConfiguration()->setApiKeyPrefix('X-API-Key', 'Bearer');


$apiInstance = new ScrapeBadger\Api\YouTubeApi(
    // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`.
    // This is optional, `GuzzleHttp\Client` will be used as default.
    new GuzzleHttp\Client(),
    $config
);
$gl = 'gl_example'; // string
$type = 'now'; // string | now|music|gaming|movies

try {
    $result = $apiInstance->youtubeTrendingVideos($gl, $type);
    print_r($result);
} catch (Exception $e) {
    echo 'Exception when calling YouTubeApi->youtubeTrendingVideos: ', $e->getMessage(), PHP_EOL;
}

Parameters

Name Type Description Notes
gl string [optional]
type string now music

Return type

mixed

Authorization

ApiKeyAuth

HTTP request headers

  • Content-Type: Not defined
  • Accept: application/json

[Back to top] [Back to API list] [Back to Model list] [Back to README]

youtubeUiLanguages()

youtubeUiLanguages(): mixed

UI languages

Example

<?php
require_once(__DIR__ . '/vendor/autoload.php');


// Configure API key authorization: ApiKeyAuth
$config = ScrapeBadger\Configuration::getDefaultConfiguration()->setApiKey('X-API-Key', 'YOUR_API_KEY');
// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
// $config = ScrapeBadger\Configuration::getDefaultConfiguration()->setApiKeyPrefix('X-API-Key', 'Bearer');


$apiInstance = new ScrapeBadger\Api\YouTubeApi(
    // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`.
    // This is optional, `GuzzleHttp\Client` will be used as default.
    new GuzzleHttp\Client(),
    $config
);

try {
    $result = $apiInstance->youtubeUiLanguages();
    print_r($result);
} catch (Exception $e) {
    echo 'Exception when calling YouTubeApi->youtubeUiLanguages: ', $e->getMessage(), PHP_EOL;
}

Parameters

This endpoint does not need any parameter.

Return type

mixed

Authorization

ApiKeyAuth

HTTP request headers

  • Content-Type: Not defined
  • Accept: application/json

[Back to top] [Back to API list] [Back to Model list] [Back to README]

youtubeVideoCategories()

youtubeVideoCategories($gl): mixed

Video categories

Example

<?php
require_once(__DIR__ . '/vendor/autoload.php');


// Configure API key authorization: ApiKeyAuth
$config = ScrapeBadger\Configuration::getDefaultConfiguration()->setApiKey('X-API-Key', 'YOUR_API_KEY');
// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
// $config = ScrapeBadger\Configuration::getDefaultConfiguration()->setApiKeyPrefix('X-API-Key', 'Bearer');


$apiInstance = new ScrapeBadger\Api\YouTubeApi(
    // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`.
    // This is optional, `GuzzleHttp\Client` will be used as default.
    new GuzzleHttp\Client(),
    $config
);
$gl = 'US'; // string

try {
    $result = $apiInstance->youtubeVideoCategories($gl);
    print_r($result);
} catch (Exception $e) {
    echo 'Exception when calling YouTubeApi->youtubeVideoCategories: ', $e->getMessage(), PHP_EOL;
}

Parameters

Name Type Description Notes
gl string [optional] [default to 'US']

Return type

mixed

Authorization

ApiKeyAuth

HTTP request headers

  • Content-Type: Not defined
  • Accept: application/json

[Back to top] [Back to API list] [Back to Model list] [Back to README]

youtubeVideoComments()

youtubeVideoComments($video_id, $sort_by, $continuation): mixed

Video comments

Example

<?php
require_once(__DIR__ . '/vendor/autoload.php');


// Configure API key authorization: ApiKeyAuth
$config = ScrapeBadger\Configuration::getDefaultConfiguration()->setApiKey('X-API-Key', 'YOUR_API_KEY');
// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
// $config = ScrapeBadger\Configuration::getDefaultConfiguration()->setApiKeyPrefix('X-API-Key', 'Bearer');


$apiInstance = new ScrapeBadger\Api\YouTubeApi(
    // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`.
    // This is optional, `GuzzleHttp\Client` will be used as default.
    new GuzzleHttp\Client(),
    $config
);
$video_id = 'video_id_example'; // string
$sort_by = 'top'; // string | top|newest
$continuation = 'continuation_example'; // string

try {
    $result = $apiInstance->youtubeVideoComments($video_id, $sort_by, $continuation);
    print_r($result);
} catch (Exception $e) {
    echo 'Exception when calling YouTubeApi->youtubeVideoComments: ', $e->getMessage(), PHP_EOL;
}

Parameters

Name Type Description Notes
video_id string
sort_by string top newest
continuation string [optional]

Return type

mixed

Authorization

ApiKeyAuth

HTTP request headers

  • Content-Type: Not defined
  • Accept: application/json

[Back to top] [Back to API list] [Back to Model list] [Back to README]

youtubeVideoTranscript()

youtubeVideoTranscript($video_id, $language): mixed

Video transcript

Example

<?php
require_once(__DIR__ . '/vendor/autoload.php');


// Configure API key authorization: ApiKeyAuth
$config = ScrapeBadger\Configuration::getDefaultConfiguration()->setApiKey('X-API-Key', 'YOUR_API_KEY');
// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
// $config = ScrapeBadger\Configuration::getDefaultConfiguration()->setApiKeyPrefix('X-API-Key', 'Bearer');


$apiInstance = new ScrapeBadger\Api\YouTubeApi(
    // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`.
    // This is optional, `GuzzleHttp\Client` will be used as default.
    new GuzzleHttp\Client(),
    $config
);
$video_id = 'video_id_example'; // string
$language = 'language_example'; // string | BCP-47 language code

try {
    $result = $apiInstance->youtubeVideoTranscript($video_id, $language);
    print_r($result);
} catch (Exception $e) {
    echo 'Exception when calling YouTubeApi->youtubeVideoTranscript: ', $e->getMessage(), PHP_EOL;
}

Parameters

Name Type Description Notes
video_id string
language string BCP-47 language code [optional]

Return type

mixed

Authorization

ApiKeyAuth

HTTP request headers

  • Content-Type: Not defined
  • Accept: application/json

[Back to top] [Back to API list] [Back to Model list] [Back to README]

youtubeVideosUnderAHashtag()

youtubeVideosUnderAHashtag($tag): mixed

Videos under a hashtag

Example

<?php
require_once(__DIR__ . '/vendor/autoload.php');


// Configure API key authorization: ApiKeyAuth
$config = ScrapeBadger\Configuration::getDefaultConfiguration()->setApiKey('X-API-Key', 'YOUR_API_KEY');
// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
// $config = ScrapeBadger\Configuration::getDefaultConfiguration()->setApiKeyPrefix('X-API-Key', 'Bearer');


$apiInstance = new ScrapeBadger\Api\YouTubeApi(
    // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`.
    // This is optional, `GuzzleHttp\Client` will be used as default.
    new GuzzleHttp\Client(),
    $config
);
$tag = 'tag_example'; // string

try {
    $result = $apiInstance->youtubeVideosUnderAHashtag($tag);
    print_r($result);
} catch (Exception $e) {
    echo 'Exception when calling YouTubeApi->youtubeVideosUnderAHashtag: ', $e->getMessage(), PHP_EOL;
}

Parameters

Name Type Description Notes
tag string

Return type

mixed

Authorization

ApiKeyAuth

HTTP request headers

  • Content-Type: Not defined
  • Accept: application/json

[Back to top] [Back to API list] [Back to Model list] [Back to README]

youtubeYoutubeScraperHealthCheck()

youtubeYoutubeScraperHealthCheck(): mixed

YouTube scraper health check

Check health of the YouTube scraper service (accepts HEAD for UptimeRobot).

Example

<?php
require_once(__DIR__ . '/vendor/autoload.php');


// Configure API key authorization: ApiKeyAuth
$config = ScrapeBadger\Configuration::getDefaultConfiguration()->setApiKey('X-API-Key', 'YOUR_API_KEY');
// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
// $config = ScrapeBadger\Configuration::getDefaultConfiguration()->setApiKeyPrefix('X-API-Key', 'Bearer');


$apiInstance = new ScrapeBadger\Api\YouTubeApi(
    // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`.
    // This is optional, `GuzzleHttp\Client` will be used as default.
    new GuzzleHttp\Client(),
    $config
);

try {
    $result = $apiInstance->youtubeYoutubeScraperHealthCheck();
    print_r($result);
} catch (Exception $e) {
    echo 'Exception when calling YouTubeApi->youtubeYoutubeScraperHealthCheck: ', $e->getMessage(), PHP_EOL;
}

Parameters

This endpoint does not need any parameter.

Return type

mixed

Authorization

ApiKeyAuth

HTTP request headers

  • Content-Type: Not defined
  • Accept: application/json

[Back to top] [Back to API list] [Back to Model list] [Back to README]

youtubeYoutubeScraperHealthCheckHead()

youtubeYoutubeScraperHealthCheckHead(): mixed

YouTube scraper health check

Check health of the YouTube scraper service (accepts HEAD for UptimeRobot).

Example

<?php
require_once(__DIR__ . '/vendor/autoload.php');


// Configure API key authorization: ApiKeyAuth
$config = ScrapeBadger\Configuration::getDefaultConfiguration()->setApiKey('X-API-Key', 'YOUR_API_KEY');
// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
// $config = ScrapeBadger\Configuration::getDefaultConfiguration()->setApiKeyPrefix('X-API-Key', 'Bearer');


$apiInstance = new ScrapeBadger\Api\YouTubeApi(
    // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`.
    // This is optional, `GuzzleHttp\Client` will be used as default.
    new GuzzleHttp\Client(),
    $config
);

try {
    $result = $apiInstance->youtubeYoutubeScraperHealthCheckHead();
    print_r($result);
} catch (Exception $e) {
    echo 'Exception when calling YouTubeApi->youtubeYoutubeScraperHealthCheckHead: ', $e->getMessage(), PHP_EOL;
}

Parameters

This endpoint does not need any parameter.

Return type

mixed

Authorization

ApiKeyAuth

HTTP request headers

  • Content-Type: Not defined
  • Accept: application/json

[Back to top] [Back to API list] [Back to Model list] [Back to README]