API Reference
YouTube API
Access YouTube data through cloud-google1 routing in api-hub for AI Agents
Version
1.0.0
Endpoints
3
Base URL
https://api.pressmonitor.com/youtube/v1 Authentication
All requests use Bearer token authentication. Add the Authorization header to every call.
Authorization: Bearer YOUR_TOKEN GET
/search Search YouTube videos
Search
Parameters
| Name | Type | Location | Required | Description |
|---|---|---|---|---|
| query_text | string | query | Yes | Search query text |
| num | integer | query | No | Maximum number of results |
| order | string | query | No | Sort order |
| event-type | string | query | No | Live event type filter |
| token | string | query | No | Pagination token |
| country_code | string | query | No | Region code |
| lang_code | string | query | No | Relevance language code |
Code Examples
curl --request GET \ --url 'https://api.pressmonitor.com/youtube/v1/search?query_text=SOME_STRING_VALUE&num=SOME_INTEGER_VALUE&order=SOME_STRING_VALUE&event-type=SOME_STRING_VALUE&token=SOME_STRING_VALUE&country_code=SOME_STRING_VALUE&lang_code=SOME_STRING_VALUE' const http = require("https"); const options = { "method": "GET", "hostname": "api.pressmonitor.com", "port": null, "path": "/youtube/v1/search?query_text=SOME_STRING_VALUE&num=SOME_INTEGER_VALUE&order=SOME_STRING_VALUE&event-type=SOME_STRING_VALUE&token=SOME_STRING_VALUE&country_code=SOME_STRING_VALUE&lang_code=SOME_STRING_VALUE", "headers": {} }; const req = http.request(options, function (res) { const chunks = []; res.on("data", function (chunk) { chunks.push(chunk); }); res.on("end", function () { const body = Buffer.concat(chunks); console.log(body.toString()); }); }); req.end(); import requests url = "https://api.pressmonitor.com/youtube/v1/search" querystring = {"query_text":"SOME_STRING_VALUE","num":"SOME_INTEGER_VALUE","order":"SOME_STRING_VALUE","event-type":"SOME_STRING_VALUE","token":"SOME_STRING_VALUE","country_code":"SOME_STRING_VALUE","lang_code":"SOME_STRING_VALUE"} response = requests.request("GET", url, params=querystring) print(response.text) <?php $curl = curl_init(); curl_setopt_array($curl, [ CURLOPT_URL => "https://api.pressmonitor.com/youtube/v1/search?query_text=SOME_STRING_VALUE&num=SOME_INTEGER_VALUE&order=SOME_STRING_VALUE&event-type=SOME_STRING_VALUE&token=SOME_STRING_VALUE&country_code=SOME_STRING_VALUE&lang_code=SOME_STRING_VALUE", CURLOPT_RETURNTRANSFER => true, CURLOPT_ENCODING => "", CURLOPT_MAXREDIRS => 10, CURLOPT_TIMEOUT => 30, CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1, CURLOPT_CUSTOMREQUEST => "GET", ]); $response = curl_exec($curl); $err = curl_error($curl); curl_close($curl); if ($err) { echo "cURL Error #:" . $err; } else { echo $response; } OkHttpClient client = new OkHttpClient(); Request request = new Request.Builder() .url("https://api.pressmonitor.com/youtube/v1/search?query_text=SOME_STRING_VALUE&num=SOME_INTEGER_VALUE&order=SOME_STRING_VALUE&event-type=SOME_STRING_VALUE&token=SOME_STRING_VALUE&country_code=SOME_STRING_VALUE&lang_code=SOME_STRING_VALUE") .get() .build(); Response response = client.newCall(request).execute(); Responses
200 Success
GET
/call Generic YouTube Data API call
Call
Parameters
| Name | Type | Location | Required | Description |
|---|---|---|---|---|
| path | string | query | No | API path under /youtube/v3 |
| endpoint | string | query | No | Alternative API path if path is not used |
| method | string | query | No | HTTP method, default GET |
Code Examples
curl --request GET \ --url 'https://api.pressmonitor.com/youtube/v1/call?path=SOME_STRING_VALUE&endpoint=SOME_STRING_VALUE&method=SOME_STRING_VALUE' const http = require("https"); const options = { "method": "GET", "hostname": "api.pressmonitor.com", "port": null, "path": "/youtube/v1/call?path=SOME_STRING_VALUE&endpoint=SOME_STRING_VALUE&method=SOME_STRING_VALUE", "headers": {} }; const req = http.request(options, function (res) { const chunks = []; res.on("data", function (chunk) { chunks.push(chunk); }); res.on("end", function () { const body = Buffer.concat(chunks); console.log(body.toString()); }); }); req.end(); import requests url = "https://api.pressmonitor.com/youtube/v1/call" querystring = {"path":"SOME_STRING_VALUE","endpoint":"SOME_STRING_VALUE","method":"SOME_STRING_VALUE"} response = requests.request("GET", url, params=querystring) print(response.text) <?php $curl = curl_init(); curl_setopt_array($curl, [ CURLOPT_URL => "https://api.pressmonitor.com/youtube/v1/call?path=SOME_STRING_VALUE&endpoint=SOME_STRING_VALUE&method=SOME_STRING_VALUE", CURLOPT_RETURNTRANSFER => true, CURLOPT_ENCODING => "", CURLOPT_MAXREDIRS => 10, CURLOPT_TIMEOUT => 30, CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1, CURLOPT_CUSTOMREQUEST => "GET", ]); $response = curl_exec($curl); $err = curl_error($curl); curl_close($curl); if ($err) { echo "cURL Error #:" . $err; } else { echo $response; } OkHttpClient client = new OkHttpClient(); Request request = new Request.Builder() .url("https://api.pressmonitor.com/youtube/v1/call?path=SOME_STRING_VALUE&endpoint=SOME_STRING_VALUE&method=SOME_STRING_VALUE") .get() .build(); Response response = client.newCall(request).execute(); Responses
200 Success
GET
/video-details Get video details
Get Video Details
Parameters
| Name | Type | Location | Required | Description |
|---|---|---|---|---|
| video_ids | string | query | Yes | Comma-separated YouTube video IDs |
Code Examples
curl --request GET \ --url 'https://api.pressmonitor.com/youtube/v1/video-details?video_ids=SOME_STRING_VALUE' const http = require("https"); const options = { "method": "GET", "hostname": "api.pressmonitor.com", "port": null, "path": "/youtube/v1/video-details?video_ids=SOME_STRING_VALUE", "headers": {} }; const req = http.request(options, function (res) { const chunks = []; res.on("data", function (chunk) { chunks.push(chunk); }); res.on("end", function () { const body = Buffer.concat(chunks); console.log(body.toString()); }); }); req.end(); import requests url = "https://api.pressmonitor.com/youtube/v1/video-details" querystring = {"video_ids":"SOME_STRING_VALUE"} response = requests.request("GET", url, params=querystring) print(response.text) <?php $curl = curl_init(); curl_setopt_array($curl, [ CURLOPT_URL => "https://api.pressmonitor.com/youtube/v1/video-details?video_ids=SOME_STRING_VALUE", CURLOPT_RETURNTRANSFER => true, CURLOPT_ENCODING => "", CURLOPT_MAXREDIRS => 10, CURLOPT_TIMEOUT => 30, CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1, CURLOPT_CUSTOMREQUEST => "GET", ]); $response = curl_exec($curl); $err = curl_error($curl); curl_close($curl); if ($err) { echo "cURL Error #:" . $err; } else { echo $response; } OkHttpClient client = new OkHttpClient(); Request request = new Request.Builder() .url("https://api.pressmonitor.com/youtube/v1/video-details?video_ids=SOME_STRING_VALUE") .get() .build(); Response response = client.newCall(request).execute(); Responses
200 Success