Instagram-Audio-Metadaten abrufen
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-Metadaten abrufen
Die Details eines einzelnen Instagram-Audiotracks anhand seiner ID nachschlagen
GET
/
media
/
instagram
/
audio
/
{audioId}
Instagram-Audio-Metadaten abrufen
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"
}
Rufen Sie die Details eines einzelnen Audiotracks anhand seiner
Die Codes 514 bis 518 sind unter Instagram-Reels-Audio-Fehler beschrieben; die übrigen finden Sie in der Ayrshare-Fehlerreferenz.
audioId ab. Verwenden Sie dies, um zu bestätigen, dass eine gespeicherte ID noch gültig ist, oder um Titel und Artwork eines Tracks vor dem Veröffentlichen anzuzeigen.
Header-Parameter
Pfadparameter
string
erforderlich
Die Track-ID, wie sie von der Audio-Suche zurückgegeben wird. Eine ID, die Instagram
nicht erkennt, gibt
code: 517 zurück.Antwortfelder
Die Felder des Tracks werden flach auf dem Antwortobjekt zurückgegeben und nicht verschachtelt. Instagram gibt nicht für jeden Track jedes Feld zurück; behandeln Sie daher alle Felder außeraudioId als optional.
string
success, wenn der Track gefunden wurde.string
Die Track-ID, als Echo zurückgegeben.
string
Track-Titel.
string
Künstlername, wie Instagram ihn anzeigt.
integer
Track-Länge in Millisekunden.
string
Thumbnail-URL des Cover-Artworks.
string
Entweder
music oder original_sound.boolean
Ob der Track in einer Anzeige verwendet werden darf.
{
"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"
}
Die Verfügbarkeit ist regionsabhängig. Meta gibt denselben Fehler für eine ID zurück, die nicht existiert,
eine, die in der Region des Kontos nicht lizenziert ist, und eine, die nicht für diese Nutzung lizenziert ist. Alle
drei melden
517, sodass ein Track, der für ein Konto aufgelöst wird, für ein anderes berechtigterweise fehlschlagen kann.
Schlagen Sie eine ID nach, statt anzunehmen, dass eine gespeicherte noch funktioniert.Fehler
| Code | Bedeutung |
|---|---|
| 156 | Instagram ist nicht mit diesem Profil verknüpft. |
| 161 | Instagrams Autorisierung ist abgelaufen oder wurde widerrufen. Verknüpfen Sie das Konto erneut. |
| 239 | Instagram hat die Anfrage aus einem kontobezogenen Grund abgelehnt. |
| 258 | Instagram hat eine fehlerhafte Antwort oder einen nicht zugeordneten Fehler zurückgegeben. |
| 425 | Der Verbindung fehlt eine erforderliche Instagram-Berechtigung. Verknüpfen Sie erneut und erteilen Sie alle Berechtigungen. |
| 435 | Instagrams Ratenlimit wurde erreicht. Warten Sie vor dem erneuten Versuch. |
| 514 | Instagram ist mit Instagram Login verknüpft. Die Audio API erfordert Facebook Login. |
| 516 | Die audioId fehlt oder ist leer. |
| 517 | Instagram erkennt die ID nicht, oder der Track ist für dieses Konto nicht verfügbar. |