All URIs are relative to https://api.unifapi.com
| 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 |
YoutubeChannelsChannelIdGet200Response youtubeChannelsChannelIdGet(channelId)
Get a YouTube channel by id
// Import classes:
import com.unifapi.sdk.ApiClient;
import com.unifapi.sdk.ApiException;
import com.unifapi.sdk.Configuration;
import com.unifapi.sdk.auth.*;
import com.unifapi.sdk.models.*;
import com.unifapi.sdk.api.YoutubeApi;
public class Example {
public static void main(String[] args) {
ApiClient defaultClient = Configuration.getDefaultApiClient();
defaultClient.setBasePath("https://api.unifapi.com");
// Configure HTTP bearer authorization: bearerAuth
HttpBearerAuth bearerAuth = (HttpBearerAuth) defaultClient.getAuthentication("bearerAuth");
bearerAuth.setBearerToken("BEARER TOKEN");
YoutubeApi apiInstance = new YoutubeApi(defaultClient);
String channelId = "channelId_example"; // String | YouTube channel id (`UCxxx...`).
try {
YoutubeChannelsChannelIdGet200Response result = apiInstance.youtubeChannelsChannelIdGet(channelId);
System.out.println(result);
} catch (ApiException e) {
System.err.println("Exception when calling YoutubeApi#youtubeChannelsChannelIdGet");
System.err.println("Status code: " + e.getCode());
System.err.println("Reason: " + e.getResponseBody());
System.err.println("Response headers: " + e.getResponseHeaders());
e.printStackTrace();
}
}
}| Name | Type | Description | Notes |
|---|---|---|---|
| channelId | String | YouTube channel id (`UCxxx...`). |
YoutubeChannelsChannelIdGet200Response
- Content-Type: Not defined
- Accept: application/json
| 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 | - |
YoutubeChannelsChannelIdShortsGet200Response youtubeChannelsChannelIdShortsGet(channelId, cursor)
List Shorts uploaded by a YouTube channel
// Import classes:
import com.unifapi.sdk.ApiClient;
import com.unifapi.sdk.ApiException;
import com.unifapi.sdk.Configuration;
import com.unifapi.sdk.auth.*;
import com.unifapi.sdk.models.*;
import com.unifapi.sdk.api.YoutubeApi;
public class Example {
public static void main(String[] args) {
ApiClient defaultClient = Configuration.getDefaultApiClient();
defaultClient.setBasePath("https://api.unifapi.com");
// Configure HTTP bearer authorization: bearerAuth
HttpBearerAuth bearerAuth = (HttpBearerAuth) defaultClient.getAuthentication("bearerAuth");
bearerAuth.setBearerToken("BEARER TOKEN");
YoutubeApi apiInstance = new YoutubeApi(defaultClient);
String channelId = "channelId_example"; // String |
String cursor = "cursor_example"; // String |
try {
YoutubeChannelsChannelIdShortsGet200Response result = apiInstance.youtubeChannelsChannelIdShortsGet(channelId, cursor);
System.out.println(result);
} catch (ApiException e) {
System.err.println("Exception when calling YoutubeApi#youtubeChannelsChannelIdShortsGet");
System.err.println("Status code: " + e.getCode());
System.err.println("Reason: " + e.getResponseBody());
System.err.println("Response headers: " + e.getResponseHeaders());
e.printStackTrace();
}
}
}| Name | Type | Description | Notes |
|---|---|---|---|
| channelId | String | ||
| cursor | String | [optional] |
YoutubeChannelsChannelIdShortsGet200Response
- Content-Type: Not defined
- Accept: application/json
| 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 | - |
YoutubeChannelsChannelIdShortsGet200Response youtubeChannelsChannelIdVideosGet(channelId, cursor)
List videos uploaded by a YouTube channel
// Import classes:
import com.unifapi.sdk.ApiClient;
import com.unifapi.sdk.ApiException;
import com.unifapi.sdk.Configuration;
import com.unifapi.sdk.auth.*;
import com.unifapi.sdk.models.*;
import com.unifapi.sdk.api.YoutubeApi;
public class Example {
public static void main(String[] args) {
ApiClient defaultClient = Configuration.getDefaultApiClient();
defaultClient.setBasePath("https://api.unifapi.com");
// Configure HTTP bearer authorization: bearerAuth
HttpBearerAuth bearerAuth = (HttpBearerAuth) defaultClient.getAuthentication("bearerAuth");
bearerAuth.setBearerToken("BEARER TOKEN");
YoutubeApi apiInstance = new YoutubeApi(defaultClient);
String channelId = "channelId_example"; // String |
String cursor = "cursor_example"; // String |
try {
YoutubeChannelsChannelIdShortsGet200Response result = apiInstance.youtubeChannelsChannelIdVideosGet(channelId, cursor);
System.out.println(result);
} catch (ApiException e) {
System.err.println("Exception when calling YoutubeApi#youtubeChannelsChannelIdVideosGet");
System.err.println("Status code: " + e.getCode());
System.err.println("Reason: " + e.getResponseBody());
System.err.println("Response headers: " + e.getResponseHeaders());
e.printStackTrace();
}
}
}| Name | Type | Description | Notes |
|---|---|---|---|
| channelId | String | ||
| cursor | String | [optional] |
YoutubeChannelsChannelIdShortsGet200Response
- Content-Type: Not defined
- Accept: application/json
| 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 | - |
YoutubeResolveChannelIdGet200Response youtubeResolveChannelIdGet(url)
Resolve a YouTube channel URL to its UC… channel id
// Import classes:
import com.unifapi.sdk.ApiClient;
import com.unifapi.sdk.ApiException;
import com.unifapi.sdk.Configuration;
import com.unifapi.sdk.auth.*;
import com.unifapi.sdk.models.*;
import com.unifapi.sdk.api.YoutubeApi;
public class Example {
public static void main(String[] args) {
ApiClient defaultClient = Configuration.getDefaultApiClient();
defaultClient.setBasePath("https://api.unifapi.com");
// Configure HTTP bearer authorization: bearerAuth
HttpBearerAuth bearerAuth = (HttpBearerAuth) defaultClient.getAuthentication("bearerAuth");
bearerAuth.setBearerToken("BEARER TOKEN");
YoutubeApi apiInstance = new YoutubeApi(defaultClient);
URI url = new URI(); // URI | Full channel URL — supports `youtube.com/@handle`, `/channel/UC…`, `/c/name`.
try {
YoutubeResolveChannelIdGet200Response result = apiInstance.youtubeResolveChannelIdGet(url);
System.out.println(result);
} catch (ApiException e) {
System.err.println("Exception when calling YoutubeApi#youtubeResolveChannelIdGet");
System.err.println("Status code: " + e.getCode());
System.err.println("Reason: " + e.getResponseBody());
System.err.println("Response headers: " + e.getResponseHeaders());
e.printStackTrace();
}
}
}| Name | Type | Description | Notes |
|---|---|---|---|
| url | URI | Full channel URL — supports `youtube.com/@handle`, `/channel/UC…`, `/c/name`. |
YoutubeResolveChannelIdGet200Response
- Content-Type: Not defined
- Accept: application/json
| 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 | - |
YoutubeChannelsChannelIdShortsGet200Response youtubeSearchGet(q, cursor)
Search YouTube videos by keyword
// Import classes:
import com.unifapi.sdk.ApiClient;
import com.unifapi.sdk.ApiException;
import com.unifapi.sdk.Configuration;
import com.unifapi.sdk.auth.*;
import com.unifapi.sdk.models.*;
import com.unifapi.sdk.api.YoutubeApi;
public class Example {
public static void main(String[] args) {
ApiClient defaultClient = Configuration.getDefaultApiClient();
defaultClient.setBasePath("https://api.unifapi.com");
// Configure HTTP bearer authorization: bearerAuth
HttpBearerAuth bearerAuth = (HttpBearerAuth) defaultClient.getAuthentication("bearerAuth");
bearerAuth.setBearerToken("BEARER TOKEN");
YoutubeApi apiInstance = new YoutubeApi(defaultClient);
String q = "q_example"; // String | Search keyword.
String cursor = "cursor_example"; // String |
try {
YoutubeChannelsChannelIdShortsGet200Response result = apiInstance.youtubeSearchGet(q, cursor);
System.out.println(result);
} catch (ApiException e) {
System.err.println("Exception when calling YoutubeApi#youtubeSearchGet");
System.err.println("Status code: " + e.getCode());
System.err.println("Reason: " + e.getResponseBody());
System.err.println("Response headers: " + e.getResponseHeaders());
e.printStackTrace();
}
}
}| Name | Type | Description | Notes |
|---|---|---|---|
| q | String | Search keyword. | |
| cursor | String | [optional] |
YoutubeChannelsChannelIdShortsGet200Response
- Content-Type: Not defined
- Accept: application/json
| 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 | - |
YoutubeTrendingGet200Response youtubeTrendingGet(languageCode)
Browse YouTube's trending videos
// Import classes:
import com.unifapi.sdk.ApiClient;
import com.unifapi.sdk.ApiException;
import com.unifapi.sdk.Configuration;
import com.unifapi.sdk.auth.*;
import com.unifapi.sdk.models.*;
import com.unifapi.sdk.api.YoutubeApi;
public class Example {
public static void main(String[] args) {
ApiClient defaultClient = Configuration.getDefaultApiClient();
defaultClient.setBasePath("https://api.unifapi.com");
// Configure HTTP bearer authorization: bearerAuth
HttpBearerAuth bearerAuth = (HttpBearerAuth) defaultClient.getAuthentication("bearerAuth");
bearerAuth.setBearerToken("BEARER TOKEN");
YoutubeApi apiInstance = new YoutubeApi(defaultClient);
String languageCode = "languageCode_example"; // String | Optional language code, e.g. `en`.
try {
YoutubeTrendingGet200Response result = apiInstance.youtubeTrendingGet(languageCode);
System.out.println(result);
} catch (ApiException e) {
System.err.println("Exception when calling YoutubeApi#youtubeTrendingGet");
System.err.println("Status code: " + e.getCode());
System.err.println("Reason: " + e.getResponseBody());
System.err.println("Response headers: " + e.getResponseHeaders());
e.printStackTrace();
}
}
}| Name | Type | Description | Notes |
|---|---|---|---|
| languageCode | String | Optional language code, e.g. `en`. | [optional] |
- Content-Type: Not defined
- Accept: application/json
| 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 | - |
YoutubeVideosVideoIdGet200Response youtubeVideosVideoIdGet(videoId)
Get a YouTube video by id
// Import classes:
import com.unifapi.sdk.ApiClient;
import com.unifapi.sdk.ApiException;
import com.unifapi.sdk.Configuration;
import com.unifapi.sdk.auth.*;
import com.unifapi.sdk.models.*;
import com.unifapi.sdk.api.YoutubeApi;
public class Example {
public static void main(String[] args) {
ApiClient defaultClient = Configuration.getDefaultApiClient();
defaultClient.setBasePath("https://api.unifapi.com");
// Configure HTTP bearer authorization: bearerAuth
HttpBearerAuth bearerAuth = (HttpBearerAuth) defaultClient.getAuthentication("bearerAuth");
bearerAuth.setBearerToken("BEARER TOKEN");
YoutubeApi apiInstance = new YoutubeApi(defaultClient);
String videoId = "videoId_example"; // String | YouTube video id, e.g. `oaSNBz4qMQY`.
try {
YoutubeVideosVideoIdGet200Response result = apiInstance.youtubeVideosVideoIdGet(videoId);
System.out.println(result);
} catch (ApiException e) {
System.err.println("Exception when calling YoutubeApi#youtubeVideosVideoIdGet");
System.err.println("Status code: " + e.getCode());
System.err.println("Reason: " + e.getResponseBody());
System.err.println("Response headers: " + e.getResponseHeaders());
e.printStackTrace();
}
}
}| Name | Type | Description | Notes |
|---|---|---|---|
| videoId | String | YouTube video id, e.g. `oaSNBz4qMQY`. |
YoutubeVideosVideoIdGet200Response
- Content-Type: Not defined
- Accept: application/json
| 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 | - |
YoutubeChannelsChannelIdShortsGet200Response youtubeVideosVideoIdRelatedGet(videoId, cursor)
List YouTube videos related to a given video
// Import classes:
import com.unifapi.sdk.ApiClient;
import com.unifapi.sdk.ApiException;
import com.unifapi.sdk.Configuration;
import com.unifapi.sdk.auth.*;
import com.unifapi.sdk.models.*;
import com.unifapi.sdk.api.YoutubeApi;
public class Example {
public static void main(String[] args) {
ApiClient defaultClient = Configuration.getDefaultApiClient();
defaultClient.setBasePath("https://api.unifapi.com");
// Configure HTTP bearer authorization: bearerAuth
HttpBearerAuth bearerAuth = (HttpBearerAuth) defaultClient.getAuthentication("bearerAuth");
bearerAuth.setBearerToken("BEARER TOKEN");
YoutubeApi apiInstance = new YoutubeApi(defaultClient);
String videoId = "videoId_example"; // String |
String cursor = "cursor_example"; // String |
try {
YoutubeChannelsChannelIdShortsGet200Response result = apiInstance.youtubeVideosVideoIdRelatedGet(videoId, cursor);
System.out.println(result);
} catch (ApiException e) {
System.err.println("Exception when calling YoutubeApi#youtubeVideosVideoIdRelatedGet");
System.err.println("Status code: " + e.getCode());
System.err.println("Reason: " + e.getResponseBody());
System.err.println("Response headers: " + e.getResponseHeaders());
e.printStackTrace();
}
}
}| Name | Type | Description | Notes |
|---|---|---|---|
| videoId | String | ||
| cursor | String | [optional] |
YoutubeChannelsChannelIdShortsGet200Response
- Content-Type: Not defined
- Accept: application/json
| 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 | - |