الذكاء المنصاتي API
يوتيوب واجهة برمجة التطبيقات
يصل يوتيوب إلى أكثر من 2 مليار مستخدم مسجل شهريًا عبر مقاطع الفيديو، والشورتات، والبث المباشر، والبودكاست، مما يجعله مهمًا لرؤية البحث، والتعليم، ورواية العلامات التجارية، والطلب المدعوم من المبدعين.
مرجع API الإصدار: 1.0.0 3 نقاط النهاية المصادقة
عنوان URL الأساسي
https://api.pressmonitor.com/youtube/v1 المصادقة
تستخدم جميع الطلبات مصادقة رمز Bearer. أضف رأس Authorization إلى كل استدعاء.
Authorization: Bearer YOUR_TOKEN GET
/search البحث في فيديوهات يوتيوب
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 استدعاء عام لواجهة بيانات يوتيوب
Call
بارامترات
| الاسم | نوع | الموقع | مطلوب | الوصف |
|---|---|---|---|---|
| path | string | query | لا | مسار API تحت /youtube/v3 |
| endpoint | string | query | لا | مسار API بديل إذا لم يُستخدم المسار |
| 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 | نعم | معرفات فيديوهات يوتيوب مفصولة بفواصل |
أمثلة الشيفرة
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 نجاح