प्लेटफ़ॉर्म इंटेलिजेंस API
YouTube API
YouTube हर महीने 2 बिलियन से अधिक लॉगिन किए गए उपयोगकर्ताओं तक पहुँचता है, जो वीडियो, शॉर्ट्स, लाइव स्ट्रीम और पॉडकास्ट के माध्यम से महत्वपूर्ण है।
API संदर्भ संस्करण: 1.0.0 3 एंडपॉइंट प्रमाणीकरण
बेस URL
https://api.pressmonitor.com/youtube/v1 प्रमाणीकरण
सभी अनुरोध Bearer टोकन प्रमाणीकरण का उपयोग करते हैं। प्रत्येक कॉल में Authorization हेडर जोड़ें।
Authorization: Bearer YOUR_TOKEN GET
/search YouTube वीडियो खोजें
Search
पैरामीटर
| नाम | प्रकार | स्थान | आवश्यक | विवरण |
|---|---|---|---|---|
| query_text | string | query | हां | खोज क्वेरी पाठ |
| num | integer | query | नहीं | अधिकतम परिणामों की संख्या |
| order | string | query | नहीं | क्रमबद्ध करने का आदेश |
| event-type | string | query | नहीं | लाइव इवेंट प्रकार फ़िल्टर |
| token | string | query | नहीं | पृष्ठांकन टोकन |
| country_code | string | query | नहीं | क्षेत्र कोड |
| lang_code | string | query | नहीं | संबंधित भाषा कोड |
कोड उदाहरण
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(); प्रतिक्रियाएं
200 सफलता
GET
/call सामान्य YouTube डेटा API कॉल
Call
पैरामीटर
| नाम | प्रकार | स्थान | आवश्यक | विवरण |
|---|---|---|---|---|
| path | string | query | नहीं | /youtube/v3 के अंतर्गत API पथ |
| endpoint | string | query | नहीं | वैकल्पिक API पथ यदि path उपयोग में नहीं है |
| method | string | query | नहीं | HTTP मेथड, डिफ़ॉल्ट GET |
कोड उदाहरण
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(); प्रतिक्रियाएं
200 सफलता
GET
/video-details वीडियो विवरण प्राप्त करें
Get Video Details
पैरामीटर
| नाम | प्रकार | स्थान | आवश्यक | विवरण |
|---|---|---|---|---|
| video_ids | string | query | हां | अल्पविराम-सेparated YouTube वीडियो आईडी |
कोड उदाहरण
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(); प्रतिक्रियाएं
200 सफलता