Skip to content

Latest commit

 

History

History
487 lines (332 loc) · 14.4 KB

File metadata and controls

487 lines (332 loc) · 14.4 KB

Unifapi\Sdk\YoutubeApi

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

Method HTTP request Description
youtubeChannelsChannelIdGet() GET /youtube/channels/{channel_id} Get a YouTube channel by id
youtubeChannelsChannelIdShortsGet() GET /youtube/channels/{channel_id}/shorts List Shorts uploaded by a YouTube channel
youtubeChannelsChannelIdVideosGet() GET /youtube/channels/{channel_id}/videos List videos uploaded by a YouTube channel
youtubeResolveChannelIdGet() GET /youtube/resolve/channel-id Resolve a YouTube channel URL to its UC… channel id
youtubeSearchGet() GET /youtube/search Search YouTube videos by keyword
youtubeTrendingGet() GET /youtube/trending Browse YouTube's trending videos
youtubeVideosVideoIdGet() GET /youtube/videos/{video_id} Get a YouTube video by id
youtubeVideosVideoIdRelatedGet() GET /youtube/videos/{video_id}/related List YouTube videos related to a given video

youtubeChannelsChannelIdGet()

youtubeChannelsChannelIdGet($channel_id): \Unifapi\\Sdk\Model\YoutubeChannelsChannelIdGet200Response

Get a YouTube channel by id

Example

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


// Configure Bearer authorization: bearerAuth
$config = Unifapi\\Sdk\Configuration::getDefaultConfiguration()->setAccessToken('YOUR_ACCESS_TOKEN');


$apiInstance = new Unifapi\\Sdk\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 | YouTube channel id (`UCxxx...`).

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

Parameters

Name Type Description Notes
channel_id string YouTube channel id (`UCxxx...`).

Return type

\Unifapi\Sdk\Model\YoutubeChannelsChannelIdGet200Response

Authorization

bearerAuth

HTTP request headers

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

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

youtubeChannelsChannelIdShortsGet()

youtubeChannelsChannelIdShortsGet($channel_id, $cursor): \Unifapi\\Sdk\Model\YoutubeChannelsChannelIdShortsGet200Response

List Shorts uploaded by a YouTube channel

Example

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


// Configure Bearer authorization: bearerAuth
$config = Unifapi\\Sdk\Configuration::getDefaultConfiguration()->setAccessToken('YOUR_ACCESS_TOKEN');


$apiInstance = new Unifapi\\Sdk\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
$cursor = 'cursor_example'; // string

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

Parameters

Name Type Description Notes
channel_id string
cursor string [optional]

Return type

\Unifapi\Sdk\Model\YoutubeChannelsChannelIdShortsGet200Response

Authorization

bearerAuth

HTTP request headers

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

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

youtubeChannelsChannelIdVideosGet()

youtubeChannelsChannelIdVideosGet($channel_id, $cursor): \Unifapi\\Sdk\Model\YoutubeChannelsChannelIdShortsGet200Response

List videos uploaded by a YouTube channel

Example

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


// Configure Bearer authorization: bearerAuth
$config = Unifapi\\Sdk\Configuration::getDefaultConfiguration()->setAccessToken('YOUR_ACCESS_TOKEN');


$apiInstance = new Unifapi\\Sdk\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
$cursor = 'cursor_example'; // string

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

Parameters

Name Type Description Notes
channel_id string
cursor string [optional]

Return type

\Unifapi\Sdk\Model\YoutubeChannelsChannelIdShortsGet200Response

Authorization

bearerAuth

HTTP request headers

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

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

youtubeResolveChannelIdGet()

youtubeResolveChannelIdGet($url): \Unifapi\\Sdk\Model\YoutubeResolveChannelIdGet200Response

Resolve a YouTube channel URL to its UC… channel id

Example

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


// Configure Bearer authorization: bearerAuth
$config = Unifapi\\Sdk\Configuration::getDefaultConfiguration()->setAccessToken('YOUR_ACCESS_TOKEN');


$apiInstance = new Unifapi\\Sdk\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 | Full channel URL — supports `youtube.com/@handle`, `/channel/UC…`, `/c/name`.

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

Parameters

Name Type Description Notes
url string Full channel URL — supports `youtube.com/@handle`, `/channel/UC…`, `/c/name`.

Return type

\Unifapi\Sdk\Model\YoutubeResolveChannelIdGet200Response

Authorization

bearerAuth

HTTP request headers

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

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

youtubeSearchGet()

youtubeSearchGet($q, $cursor): \Unifapi\\Sdk\Model\YoutubeChannelsChannelIdShortsGet200Response

Search YouTube videos by keyword

Example

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


// Configure Bearer authorization: bearerAuth
$config = Unifapi\\Sdk\Configuration::getDefaultConfiguration()->setAccessToken('YOUR_ACCESS_TOKEN');


$apiInstance = new Unifapi\\Sdk\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
);
$q = 'q_example'; // string | Search keyword.
$cursor = 'cursor_example'; // string

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

Parameters

Name Type Description Notes
q string Search keyword.
cursor string [optional]

Return type

\Unifapi\Sdk\Model\YoutubeChannelsChannelIdShortsGet200Response

Authorization

bearerAuth

HTTP request headers

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

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

youtubeTrendingGet()

youtubeTrendingGet($language_code): \Unifapi\\Sdk\Model\YoutubeTrendingGet200Response

Browse YouTube's trending videos

Example

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


// Configure Bearer authorization: bearerAuth
$config = Unifapi\\Sdk\Configuration::getDefaultConfiguration()->setAccessToken('YOUR_ACCESS_TOKEN');


$apiInstance = new Unifapi\\Sdk\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
);
$language_code = 'language_code_example'; // string | Optional language code, e.g. `en`.

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

Parameters

Name Type Description Notes
language_code string Optional language code, e.g. `en`. [optional]

Return type

\Unifapi\Sdk\Model\YoutubeTrendingGet200Response

Authorization

bearerAuth

HTTP request headers

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

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

youtubeVideosVideoIdGet()

youtubeVideosVideoIdGet($video_id): \Unifapi\\Sdk\Model\YoutubeVideosVideoIdGet200Response

Get a YouTube video by id

Example

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


// Configure Bearer authorization: bearerAuth
$config = Unifapi\\Sdk\Configuration::getDefaultConfiguration()->setAccessToken('YOUR_ACCESS_TOKEN');


$apiInstance = new Unifapi\\Sdk\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 | YouTube video id, e.g. `oaSNBz4qMQY`.

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

Parameters

Name Type Description Notes
video_id string YouTube video id, e.g. `oaSNBz4qMQY`.

Return type

\Unifapi\Sdk\Model\YoutubeVideosVideoIdGet200Response

Authorization

bearerAuth

HTTP request headers

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

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

youtubeVideosVideoIdRelatedGet()

youtubeVideosVideoIdRelatedGet($video_id, $cursor): \Unifapi\\Sdk\Model\YoutubeChannelsChannelIdShortsGet200Response

List YouTube videos related to a given video

Example

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


// Configure Bearer authorization: bearerAuth
$config = Unifapi\\Sdk\Configuration::getDefaultConfiguration()->setAccessToken('YOUR_ACCESS_TOKEN');


$apiInstance = new Unifapi\\Sdk\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
$cursor = 'cursor_example'; // string

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

Parameters

Name Type Description Notes
video_id string
cursor string [optional]

Return type

\Unifapi\Sdk\Model\YoutubeChannelsChannelIdShortsGet200Response

Authorization

bearerAuth

HTTP request headers

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

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