Instagram Audio Metadata प्राप्त करें
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 Audio Metadata प्राप्त करें
किसी एक Instagram audio track का विवरण उसकी id से लुकअप करें
GET
/
media
/
instagram
/
audio
/
{audioId}
Instagram Audio Metadata प्राप्त करें
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"
}
किसी एक audio track का विवरण उसकी
Code 514 से 518 का वर्णन Instagram Reels audio त्रुटियों में किया गया है; बाकी Ayrshare त्रुटि संदर्भ में हैं।
audioId से पुनर्प्राप्त करें। इसका उपयोग यह पुष्टि करने के लिए करें कि कोई stored id अभी भी वैध है, या publish करने से पहले track का शीर्षक और artwork दिखाने के लिए।
Header Parameters
Path Parameters
string
आवश्यक
Track id, जैसा audio खोज द्वारा लौटाया गया। ऐसी id जिसे
Instagram नहीं पहचानता,
code: 517 लौटाती है।Response Fields
Track की फ़ील्ड nested होने के बजाय प्रतिक्रिया object पर flat लौटाई जाती हैं। Instagram हर track के लिए हर फ़ील्ड नहीं लौटाता, इसलिएaudioId को छोड़कर सभी फ़ील्ड को वैकल्पिक मानें।
string
success जब track मिल गया।string
Track id, वापस echo की गई।
string
Track का शीर्षक।
string
Artist का नाम, जैसा Instagram दिखाता है।
integer
मिलीसेकंड में track की लंबाई।
string
Cover artwork thumbnail URL।
string
या तो
music या original_sound।boolean
क्या track किसी ad में उपयोग किया जा सकता है।
{
"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"
}
उपलब्धता क्षेत्र-निर्भर है। ऐसी id जो मौजूद नहीं है, ऐसी id जो खाते के क्षेत्र में लाइसेंस-प्राप्त नहीं
है, और ऐसी id जो इस उपयोग के लिए लाइसेंस-प्राप्त नहीं है — तीनों के लिए Meta एक ही त्रुटि लौटाता है। तीनों
517 रिपोर्ट करते हैं, इसलिए जो track एक खाते के लिए resolve होता है वह दूसरे के लिए वैध रूप से विफल हो
सकता है। यह मानने के बजाय कि stored id अभी भी काम करती है, id को लुकअप करें।त्रुटियाँ
| Code | अर्थ |
|---|---|
| 156 | Instagram इस profile से लिंक नहीं है। |
| 161 | Instagram का authorization समाप्त हो गया या रद्द कर दिया गया। खाते को रिलिंक करें। |
| 239 | Instagram ने account-स्तरीय कारण से अनुरोध अस्वीकार किया। |
| 258 | Instagram ने malformed प्रतिक्रिया या unmapped विफलता लौटाई। |
| 425 | कनेक्शन में एक आवश्यक Instagram permission गुम है। रिलिंक करें और सभी permissions दें। |
| 435 | Instagram की rate limit तक पहुँच गई। पुनः प्रयास से पहले प्रतीक्षा करें। |
| 514 | Instagram, Instagram Login से लिंक है। Audio API के लिए Facebook Login आवश्यक है। |
| 516 | audioId गुम या खाली है। |
| 517 | Instagram id को नहीं पहचानता, या track इस खाते के लिए अनुपलब्ध है। |