Skip to content

Latest commit

 

History

History
696 lines (500 loc) · 23.5 KB

File metadata and controls

696 lines (500 loc) · 23.5 KB

unifapi.YoutubeApi

All URIs are relative to https://api.unifapi.com

Method HTTP request Description
youtube_channels_channel_id_get GET /youtube/channels/{channel_id} Get a YouTube channel by id
youtube_channels_channel_id_shorts_get GET /youtube/channels/{channel_id}/shorts List Shorts uploaded by a YouTube channel
youtube_channels_channel_id_videos_get GET /youtube/channels/{channel_id}/videos List videos uploaded by a YouTube channel
youtube_resolve_channel_id_get GET /youtube/resolve/channel-id Resolve a YouTube channel URL to its UC… channel id
youtube_search_get GET /youtube/search Search YouTube videos by keyword
youtube_trending_get GET /youtube/trending Browse YouTube's trending videos
youtube_videos_video_id_get GET /youtube/videos/{video_id} Get a YouTube video by id
youtube_videos_video_id_related_get GET /youtube/videos/{video_id}/related List YouTube videos related to a given video

youtube_channels_channel_id_get

YoutubeChannelsChannelIdGet200Response youtube_channels_channel_id_get(channel_id)

Get a YouTube channel by id

Example

  • Bearer Authentication (bearerAuth):
import unifapi
from unifapi.models.youtube_channels_channel_id_get200_response import YoutubeChannelsChannelIdGet200Response
from unifapi.rest import ApiException
from pprint import pprint

# Defining the host is optional and defaults to https://api.unifapi.com
# See configuration.py for a list of all supported configuration parameters.
configuration = unifapi.Configuration(
    host = "https://api.unifapi.com"
)

# The client must configure the authentication and authorization parameters
# in accordance with the API server security policy.
# Examples for each auth method are provided below, use the example that
# satisfies your auth use case.

# Configure Bearer authorization: bearerAuth
configuration = unifapi.Configuration(
    access_token = os.environ["BEARER_TOKEN"]
)

# Enter a context with an instance of the API client
with unifapi.ApiClient(configuration) as api_client:
    # Create an instance of the API class
    api_instance = unifapi.YoutubeApi(api_client)
    channel_id = 'channel_id_example' # str | YouTube channel id (`UCxxx...`).

    try:
        # Get a YouTube channel by id
        api_response = api_instance.youtube_channels_channel_id_get(channel_id)
        print("The response of YoutubeApi->youtube_channels_channel_id_get:\n")
        pprint(api_response)
    except Exception as e:
        print("Exception when calling YoutubeApi->youtube_channels_channel_id_get: %s\n" % e)

Parameters

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

Return type

YoutubeChannelsChannelIdGet200Response

Authorization

bearerAuth

HTTP request headers

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

HTTP response details

Status code Description Response headers
200 OK -
400 Validation or invalid-id error -
401 Missing, invalid, disabled, revoked, or expired UnifAPI API key -
402 Insufficient workspace credits -
404 Resource not found -
429 Rate limited -
500 Internal error -
502 Source error -
503 Source unavailable -

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

youtube_channels_channel_id_shorts_get

YoutubeChannelsChannelIdShortsGet200Response youtube_channels_channel_id_shorts_get(channel_id, cursor=cursor)

List Shorts uploaded by a YouTube channel

Example

  • Bearer Authentication (bearerAuth):
import unifapi
from unifapi.models.youtube_channels_channel_id_shorts_get200_response import YoutubeChannelsChannelIdShortsGet200Response
from unifapi.rest import ApiException
from pprint import pprint

# Defining the host is optional and defaults to https://api.unifapi.com
# See configuration.py for a list of all supported configuration parameters.
configuration = unifapi.Configuration(
    host = "https://api.unifapi.com"
)

# The client must configure the authentication and authorization parameters
# in accordance with the API server security policy.
# Examples for each auth method are provided below, use the example that
# satisfies your auth use case.

# Configure Bearer authorization: bearerAuth
configuration = unifapi.Configuration(
    access_token = os.environ["BEARER_TOKEN"]
)

# Enter a context with an instance of the API client
with unifapi.ApiClient(configuration) as api_client:
    # Create an instance of the API class
    api_instance = unifapi.YoutubeApi(api_client)
    channel_id = 'channel_id_example' # str | 
    cursor = 'cursor_example' # str |  (optional)

    try:
        # List Shorts uploaded by a YouTube channel
        api_response = api_instance.youtube_channels_channel_id_shorts_get(channel_id, cursor=cursor)
        print("The response of YoutubeApi->youtube_channels_channel_id_shorts_get:\n")
        pprint(api_response)
    except Exception as e:
        print("Exception when calling YoutubeApi->youtube_channels_channel_id_shorts_get: %s\n" % e)

Parameters

Name Type Description Notes
channel_id str
cursor str [optional]

Return type

YoutubeChannelsChannelIdShortsGet200Response

Authorization

bearerAuth

HTTP request headers

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

HTTP response details

Status code Description Response headers
200 OK -
400 Validation or invalid-id error -
401 Missing, invalid, disabled, revoked, or expired UnifAPI API key -
402 Insufficient workspace credits -
404 Resource not found -
429 Rate limited -
500 Internal error -
502 Source error -
503 Source unavailable -

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

youtube_channels_channel_id_videos_get

YoutubeChannelsChannelIdShortsGet200Response youtube_channels_channel_id_videos_get(channel_id, cursor=cursor)

List videos uploaded by a YouTube channel

Example

  • Bearer Authentication (bearerAuth):
import unifapi
from unifapi.models.youtube_channels_channel_id_shorts_get200_response import YoutubeChannelsChannelIdShortsGet200Response
from unifapi.rest import ApiException
from pprint import pprint

# Defining the host is optional and defaults to https://api.unifapi.com
# See configuration.py for a list of all supported configuration parameters.
configuration = unifapi.Configuration(
    host = "https://api.unifapi.com"
)

# The client must configure the authentication and authorization parameters
# in accordance with the API server security policy.
# Examples for each auth method are provided below, use the example that
# satisfies your auth use case.

# Configure Bearer authorization: bearerAuth
configuration = unifapi.Configuration(
    access_token = os.environ["BEARER_TOKEN"]
)

# Enter a context with an instance of the API client
with unifapi.ApiClient(configuration) as api_client:
    # Create an instance of the API class
    api_instance = unifapi.YoutubeApi(api_client)
    channel_id = 'channel_id_example' # str | 
    cursor = 'cursor_example' # str |  (optional)

    try:
        # List videos uploaded by a YouTube channel
        api_response = api_instance.youtube_channels_channel_id_videos_get(channel_id, cursor=cursor)
        print("The response of YoutubeApi->youtube_channels_channel_id_videos_get:\n")
        pprint(api_response)
    except Exception as e:
        print("Exception when calling YoutubeApi->youtube_channels_channel_id_videos_get: %s\n" % e)

Parameters

Name Type Description Notes
channel_id str
cursor str [optional]

Return type

YoutubeChannelsChannelIdShortsGet200Response

Authorization

bearerAuth

HTTP request headers

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

HTTP response details

Status code Description Response headers
200 OK -
400 Validation or invalid-id error -
401 Missing, invalid, disabled, revoked, or expired UnifAPI API key -
402 Insufficient workspace credits -
404 Resource not found -
429 Rate limited -
500 Internal error -
502 Source error -
503 Source unavailable -

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

youtube_resolve_channel_id_get

YoutubeResolveChannelIdGet200Response youtube_resolve_channel_id_get(url)

Resolve a YouTube channel URL to its UC… channel id

Example

  • Bearer Authentication (bearerAuth):
import unifapi
from unifapi.models.youtube_resolve_channel_id_get200_response import YoutubeResolveChannelIdGet200Response
from unifapi.rest import ApiException
from pprint import pprint

# Defining the host is optional and defaults to https://api.unifapi.com
# See configuration.py for a list of all supported configuration parameters.
configuration = unifapi.Configuration(
    host = "https://api.unifapi.com"
)

# The client must configure the authentication and authorization parameters
# in accordance with the API server security policy.
# Examples for each auth method are provided below, use the example that
# satisfies your auth use case.

# Configure Bearer authorization: bearerAuth
configuration = unifapi.Configuration(
    access_token = os.environ["BEARER_TOKEN"]
)

# Enter a context with an instance of the API client
with unifapi.ApiClient(configuration) as api_client:
    # Create an instance of the API class
    api_instance = unifapi.YoutubeApi(api_client)
    url = 'url_example' # str | Full channel URL — supports `youtube.com/@handle`, `/channel/UC…`, `/c/name`.

    try:
        # Resolve a YouTube channel URL to its UC… channel id
        api_response = api_instance.youtube_resolve_channel_id_get(url)
        print("The response of YoutubeApi->youtube_resolve_channel_id_get:\n")
        pprint(api_response)
    except Exception as e:
        print("Exception when calling YoutubeApi->youtube_resolve_channel_id_get: %s\n" % e)

Parameters

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

Return type

YoutubeResolveChannelIdGet200Response

Authorization

bearerAuth

HTTP request headers

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

HTTP response details

Status code Description Response headers
200 OK -
400 Validation or invalid-id error -
401 Missing, invalid, disabled, revoked, or expired UnifAPI API key -
402 Insufficient workspace credits -
404 Resource not found -
429 Rate limited -
500 Internal error -
502 Source error -
503 Source unavailable -

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

youtube_search_get

YoutubeChannelsChannelIdShortsGet200Response youtube_search_get(q, cursor=cursor)

Search YouTube videos by keyword

Example

  • Bearer Authentication (bearerAuth):
import unifapi
from unifapi.models.youtube_channels_channel_id_shorts_get200_response import YoutubeChannelsChannelIdShortsGet200Response
from unifapi.rest import ApiException
from pprint import pprint

# Defining the host is optional and defaults to https://api.unifapi.com
# See configuration.py for a list of all supported configuration parameters.
configuration = unifapi.Configuration(
    host = "https://api.unifapi.com"
)

# The client must configure the authentication and authorization parameters
# in accordance with the API server security policy.
# Examples for each auth method are provided below, use the example that
# satisfies your auth use case.

# Configure Bearer authorization: bearerAuth
configuration = unifapi.Configuration(
    access_token = os.environ["BEARER_TOKEN"]
)

# Enter a context with an instance of the API client
with unifapi.ApiClient(configuration) as api_client:
    # Create an instance of the API class
    api_instance = unifapi.YoutubeApi(api_client)
    q = 'q_example' # str | Search keyword.
    cursor = 'cursor_example' # str |  (optional)

    try:
        # Search YouTube videos by keyword
        api_response = api_instance.youtube_search_get(q, cursor=cursor)
        print("The response of YoutubeApi->youtube_search_get:\n")
        pprint(api_response)
    except Exception as e:
        print("Exception when calling YoutubeApi->youtube_search_get: %s\n" % e)

Parameters

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

Return type

YoutubeChannelsChannelIdShortsGet200Response

Authorization

bearerAuth

HTTP request headers

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

HTTP response details

Status code Description Response headers
200 OK -
400 Validation or invalid-id error -
401 Missing, invalid, disabled, revoked, or expired UnifAPI API key -
402 Insufficient workspace credits -
404 Resource not found -
429 Rate limited -
500 Internal error -
502 Source error -
503 Source unavailable -

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

youtube_trending_get

YoutubeTrendingGet200Response youtube_trending_get(language_code=language_code)

Browse YouTube's trending videos

Example

  • Bearer Authentication (bearerAuth):
import unifapi
from unifapi.models.youtube_trending_get200_response import YoutubeTrendingGet200Response
from unifapi.rest import ApiException
from pprint import pprint

# Defining the host is optional and defaults to https://api.unifapi.com
# See configuration.py for a list of all supported configuration parameters.
configuration = unifapi.Configuration(
    host = "https://api.unifapi.com"
)

# The client must configure the authentication and authorization parameters
# in accordance with the API server security policy.
# Examples for each auth method are provided below, use the example that
# satisfies your auth use case.

# Configure Bearer authorization: bearerAuth
configuration = unifapi.Configuration(
    access_token = os.environ["BEARER_TOKEN"]
)

# Enter a context with an instance of the API client
with unifapi.ApiClient(configuration) as api_client:
    # Create an instance of the API class
    api_instance = unifapi.YoutubeApi(api_client)
    language_code = 'language_code_example' # str | Optional language code, e.g. `en`. (optional)

    try:
        # Browse YouTube's trending videos
        api_response = api_instance.youtube_trending_get(language_code=language_code)
        print("The response of YoutubeApi->youtube_trending_get:\n")
        pprint(api_response)
    except Exception as e:
        print("Exception when calling YoutubeApi->youtube_trending_get: %s\n" % e)

Parameters

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

Return type

YoutubeTrendingGet200Response

Authorization

bearerAuth

HTTP request headers

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

HTTP response details

Status code Description Response headers
200 OK -
400 Validation or invalid-id error -
401 Missing, invalid, disabled, revoked, or expired UnifAPI API key -
402 Insufficient workspace credits -
404 Resource not found -
429 Rate limited -
500 Internal error -
502 Source error -
503 Source unavailable -

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

youtube_videos_video_id_get

YoutubeVideosVideoIdGet200Response youtube_videos_video_id_get(video_id)

Get a YouTube video by id

Example

  • Bearer Authentication (bearerAuth):
import unifapi
from unifapi.models.youtube_videos_video_id_get200_response import YoutubeVideosVideoIdGet200Response
from unifapi.rest import ApiException
from pprint import pprint

# Defining the host is optional and defaults to https://api.unifapi.com
# See configuration.py for a list of all supported configuration parameters.
configuration = unifapi.Configuration(
    host = "https://api.unifapi.com"
)

# The client must configure the authentication and authorization parameters
# in accordance with the API server security policy.
# Examples for each auth method are provided below, use the example that
# satisfies your auth use case.

# Configure Bearer authorization: bearerAuth
configuration = unifapi.Configuration(
    access_token = os.environ["BEARER_TOKEN"]
)

# Enter a context with an instance of the API client
with unifapi.ApiClient(configuration) as api_client:
    # Create an instance of the API class
    api_instance = unifapi.YoutubeApi(api_client)
    video_id = 'video_id_example' # str | YouTube video id, e.g. `oaSNBz4qMQY`.

    try:
        # Get a YouTube video by id
        api_response = api_instance.youtube_videos_video_id_get(video_id)
        print("The response of YoutubeApi->youtube_videos_video_id_get:\n")
        pprint(api_response)
    except Exception as e:
        print("Exception when calling YoutubeApi->youtube_videos_video_id_get: %s\n" % e)

Parameters

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

Return type

YoutubeVideosVideoIdGet200Response

Authorization

bearerAuth

HTTP request headers

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

HTTP response details

Status code Description Response headers
200 OK -
400 Validation or invalid-id error -
401 Missing, invalid, disabled, revoked, or expired UnifAPI API key -
402 Insufficient workspace credits -
404 Resource not found -
429 Rate limited -
500 Internal error -
502 Source error -
503 Source unavailable -

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

youtube_videos_video_id_related_get

YoutubeChannelsChannelIdShortsGet200Response youtube_videos_video_id_related_get(video_id, cursor=cursor)

List YouTube videos related to a given video

Example

  • Bearer Authentication (bearerAuth):
import unifapi
from unifapi.models.youtube_channels_channel_id_shorts_get200_response import YoutubeChannelsChannelIdShortsGet200Response
from unifapi.rest import ApiException
from pprint import pprint

# Defining the host is optional and defaults to https://api.unifapi.com
# See configuration.py for a list of all supported configuration parameters.
configuration = unifapi.Configuration(
    host = "https://api.unifapi.com"
)

# The client must configure the authentication and authorization parameters
# in accordance with the API server security policy.
# Examples for each auth method are provided below, use the example that
# satisfies your auth use case.

# Configure Bearer authorization: bearerAuth
configuration = unifapi.Configuration(
    access_token = os.environ["BEARER_TOKEN"]
)

# Enter a context with an instance of the API client
with unifapi.ApiClient(configuration) as api_client:
    # Create an instance of the API class
    api_instance = unifapi.YoutubeApi(api_client)
    video_id = 'video_id_example' # str | 
    cursor = 'cursor_example' # str |  (optional)

    try:
        # List YouTube videos related to a given video
        api_response = api_instance.youtube_videos_video_id_related_get(video_id, cursor=cursor)
        print("The response of YoutubeApi->youtube_videos_video_id_related_get:\n")
        pprint(api_response)
    except Exception as e:
        print("Exception when calling YoutubeApi->youtube_videos_video_id_related_get: %s\n" % e)

Parameters

Name Type Description Notes
video_id str
cursor str [optional]

Return type

YoutubeChannelsChannelIdShortsGet200Response

Authorization

bearerAuth

HTTP request headers

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

HTTP response details

Status code Description Response headers
200 OK -
400 Validation or invalid-id error -
401 Missing, invalid, disabled, revoked, or expired UnifAPI API key -
402 Insufficient workspace credits -
404 Resource not found -
429 Rate limited -
500 Internal error -
502 Source error -
503 Source unavailable -

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