الحصول على البيانات الوصفية لصوت Instagram
curl --request GET \
--url https://api.ayrshare.com/api/media/instagram/audio/{audioId} \
--header 'Authorization: Bearer <token>'const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
fetch('https://api.ayrshare.com/api/media/instagram/audio/{audioId}', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));import requests
url = "https://api.ayrshare.com/api/media/instagram/audio/{audioId}"
headers = {"Authorization": "Bearer <token>"}
response = requests.get(url, headers=headers)
print(response.text)<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.ayrshare.com/api/media/instagram/audio/{audioId}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://api.ayrshare.com/api/media/instagram/audio/{audioId}"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("Authorization", "Bearer <token>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://api.ayrshare.com/api/media/instagram/audio/{audioId}")
.header("Authorization", "Bearer <token>")
.asString();{
"status": "success",
"audioId": "17901234567890123",
"title": "Summer Nights",
"displayArtist": "The Example Band",
"durationMs": 32000,
"thumbnailUrl": "https://scontent.example.com/cover.jpg",
"audioType": "music",
"isAdsEligible": true
}
{
"status": "error",
"code": 517,
"action": "post",
"message": "The selected audio track is unavailable. It may be an invalid audio id, restricted in your region, or not licensed for this use. Please choose a different track using the Instagram audio search endpoint and try again.",
"platform": "instagram"
}
Media
الحصول على البيانات الوصفية لصوت Instagram
استعلم عن تفاصيل مقطع صوتي واحد في Instagram بواسطة معرّفه
GET
/
media
/
instagram
/
audio
/
{audioId}
الحصول على البيانات الوصفية لصوت Instagram
curl --request GET \
--url https://api.ayrshare.com/api/media/instagram/audio/{audioId} \
--header 'Authorization: Bearer <token>'const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
fetch('https://api.ayrshare.com/api/media/instagram/audio/{audioId}', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));import requests
url = "https://api.ayrshare.com/api/media/instagram/audio/{audioId}"
headers = {"Authorization": "Bearer <token>"}
response = requests.get(url, headers=headers)
print(response.text)<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.ayrshare.com/api/media/instagram/audio/{audioId}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://api.ayrshare.com/api/media/instagram/audio/{audioId}"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("Authorization", "Bearer <token>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://api.ayrshare.com/api/media/instagram/audio/{audioId}")
.header("Authorization", "Bearer <token>")
.asString();{
"status": "success",
"audioId": "17901234567890123",
"title": "Summer Nights",
"displayArtist": "The Example Band",
"durationMs": 32000,
"thumbnailUrl": "https://scontent.example.com/cover.jpg",
"audioType": "music",
"isAdsEligible": true
}
{
"status": "error",
"code": 517,
"action": "post",
"message": "The selected audio track is unavailable. It may be an invalid audio id, restricted in your region, or not licensed for this use. Please choose a different track using the Instagram audio search endpoint and try again.",
"platform": "instagram"
}
استرجع تفاصيل مقطع صوتي واحد بواسطة
الرموز من 514 إلى 518 موصوفة في أخطاء صوت Instagram Reels؛ أما البقية ففي مرجع أخطاء Ayrshare.
audioId الخاص به. استخدم هذا للتأكد من أن معرّفًا مخزّنًا لا يزال صالحًا، أو لعرض عنوان المقطع وصورة غلافه قبل النشر.
معلمات الترويسة
معلمات المسار
string
مطلوب
معرّف المقطع، كما يعيده بحث الصوت. المعرّف الذي لا
يتعرّف عليه Instagram يعيد
code: 517.حقول الاستجابة
تُعاد حقول المقطع مسطّحة مباشرة على كائن الاستجابة وليست متداخلة. لا يعيد Instagram كل حقل لكل مقطع، لذا تعامل مع جميع الحقول باستثناءaudioId على أنها اختيارية.
string
success عند العثور على المقطع.string
معرّف المقطع، مُعاد كما هو.
string
عنوان المقطع.
string
اسم الفنان كما يعرضه Instagram.
integer
طول المقطع بالمللي ثانية.
string
عنوان URL للصورة المصغّرة لغلاف المقطع.
string
إمّا
music أو original_sound.boolean
ما إذا كان يمكن استخدام المقطع في إعلان.
{
"status": "success",
"audioId": "17901234567890123",
"title": "Summer Nights",
"displayArtist": "The Example Band",
"durationMs": 32000,
"thumbnailUrl": "https://scontent.example.com/cover.jpg",
"audioType": "music",
"isAdsEligible": true
}
{
"status": "error",
"code": 517,
"action": "post",
"message": "The selected audio track is unavailable. It may be an invalid audio id, restricted in your region, or not licensed for this use. Please choose a different track using the Instagram audio search endpoint and try again.",
"platform": "instagram"
}
يعتمد التوفّر على المنطقة. تعيد Meta الخطأ نفسه لمعرّف غير موجود، ولمعرّف غير مرخّص في
منطقة الحساب، ولمعرّف غير مرخّص لهذا الاستخدام. تُبلَّغ الحالات الثلاث جميعها بـ
517، لذا فإن
مقطعًا يُحلّ لحساب ما يمكن أن يفشل بشكل مشروع لحساب آخر. استعلم عن المعرّف بدلًا من افتراض أن
معرّفًا مخزّنًا لا يزال يعمل.الأخطاء
| الرمز | المعنى |
|---|---|
| 156 | Instagram غير مرتبط بملف التعريف هذا. |
| 161 | انتهت صلاحية تفويض Instagram أو أُلغي. أعد ربط الحساب. |
| 239 | رفض Instagram الطلب لسبب على مستوى الحساب. |
| 258 | أعاد Instagram استجابة مشوّهة أو فشلًا غير مُطابَق. |
| 425 | يفتقر الاتصال إلى إذن Instagram مطلوب. أعد الربط وامنح جميع الأذونات. |
| 435 | تم بلوغ حد المعدّل الخاص بـ Instagram. انتظر قبل إعادة المحاولة. |
| 514 | Instagram مرتبط بواسطة Instagram Login. يتطلّب Audio API استخدام Facebook Login. |
| 516 | audioId مفقود أو فارغ. |
| 517 | لا يتعرّف Instagram على المعرّف، أو المقطع غير متاح لهذا الحساب. |