> ## Documentation Index
> Fetch the complete documentation index at: https://www.ayrshare.com/docs/llms.txt
> Use this file to discover all available pages before exploring further.

# Instagram-Audio suchen

> Instagrams lizenzierten Audiokatalog nach einem Track durchsuchen, der an einen Reel angehängt werden soll

Durchsuchen Sie Instagrams Audiokatalog per Suchbegriff. Verwenden Sie die zurückgegebene `audioId` mit [`instagramOptions.audioConfiguration`](https://www.ayrshare.com/docs/apis/post/social-networks/instagram#adding-music-to-a-reel), um den Track beim Veröffentlichen eines Reels anzuhängen.

> [!WARNING]
>
> **Requires Instagram linked through Facebook Login.** Instagram's Audio API is only available to accounts connected via **Facebook Login**, which needs a Facebook Page connected to the Instagram account. Accounts connected with **Instagram Login** (the Ayrshare default) cannot search, look up, or attach audio, and every audio request returns `code: 514`.
>
> This is a Meta restriction, not an Ayrshare one. Meta's documentation states the Audio API "is only available on the Instagram API with Facebook Login. It is not supported on the Instagram API with Instagram Login." No permission or plan upgrade changes it.
>
> **Three things are required:**
>
> 1. An Instagram **Business** or **Creator** account
>
> 2. A **Facebook Page connected** to that Instagram account
>
> 3. Instagram linked to Ayrshare with **Instagram Login disabled**, so the Facebook Login flow is used
>
> See the [step-by-step setup guide](https://www.ayrshare.com/docs/dashboard/connect-social-accounts/instagram.md#music-attach-eligibility-facebook-login-required).

## Header-Parameter

**Authorization** `string` *required*

[API Key](https://www.ayrshare.com/docs/apis/overview.md#authorization) of the Primary Profile.

Format: `Authorization: Bearer API_KEY`
**Profile-Key** `string`

[Profile Key](https://www.ayrshare.com/docs/apis/overview.md#profile-key-format) of a User Profile.

Format: `Profile-Key: PROFILE_KEY`

## Query-Parameter

**query** `string` *required*

Suchbegriff, z. B. ein Künstler- oder Track-Name. Ein leerer oder nur aus Leerzeichen bestehender Wert gibt
`code: 101` zurück.

**audioType** `string` (default: music)

Welcher Katalog durchsucht wird. Entweder `music` für lizenzierte kommerzielle Tracks oder `original_sound` für
Audio aus den Reels anderer Creator. Jeder andere Wert gibt `code: 101` zurück.

**limit** `integer`

Maximale Anzahl zurückzugebender Tracks, von `1` bis `100`. Nicht ganzzahlige Werte oder Werte außerhalb des Bereichs geben
`code: 101` zurück. Wird der Parameter weggelassen, gilt Instagrams eigener Standardwert.

## Antwortfelder

Instagram gibt nicht für jeden Track jedes Feld zurück; behandeln Sie daher alle Track-Felder außer `audioId` als optional.

**status** `string`

`success`, wenn die Suche abgeschlossen wurde. Auch ein Katalog-Ergebnis ohne Treffer ist ein Erfolg.

**query** `string`

Der gesuchte Suchbegriff, als Echo zurückgegeben.

**audio** `array`

Passende Tracks. Ein leeres Array bedeutet, dass die Suche ausgeführt wurde und nichts gefunden hat.

**Track-Felder**

**audioId** `string`

Die ID, die beim Veröffentlichen eines Reels als `audioConfiguration.audioId` übergeben wird.

**title** `string`

Track-Titel.

**displayArtist** `string`

Künstlername, wie Instagram ihn anzeigt.

**durationMs** `integer`

Track-Länge in Millisekunden.

**thumbnailUrl** `string`

Thumbnail-URL des Cover-Artworks.

**audioType** `string`

Entweder `music` oder `original_sound`.

**isAdsEligible** `boolean`

Ob der Track in einer Anzeige verwendet werden darf. Lizenzierte Musik ist häufig nicht für Anzeigen verfügbar,
selbst wenn sie für einen organischen Reel verfügbar ist.

```json 200: Success theme={"system"}
{
  "status": "success",
  "query": "summer",
  "audio": [
    {
      "audioId": "17901234567890123",
      "title": "Summer Nights",
      "displayArtist": "The Example Band",
      "durationMs": 32000,
      "thumbnailUrl": "https://scontent.example.com/cover.jpg",
      "audioType": "music",
      "isAdsEligible": true
    }
  ]
}
```

```json 200: No matches theme={"system"}
{
  "status": "success",
  "query": "asdfghjkl",
  "audio": []
}
```

```json 400: Instagram Login account theme={"system"}
{
  "status": "error",
  "code": 514,
  "action": "post",
  "message": "Adding music to a Reel requires an Instagram account connected via Facebook Login. This profile is connected with Instagram Login, which Meta does not permit for music attach, search, or lookup. Please relink Instagram using Facebook Login and grant the instagram_content_publish permission, then try again.",
  "platform": "instagram"
}
```

## Fehler

| Code | Bedeutung |
| - | - |
| 101 | Fehlende oder leere `query`, ein unbekannter `audioType` oder ein `limit` außerhalb von 1 bis 100. |
| 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, einschließlich eines nicht verfügbaren Tracks. Bei der Suche wird 239 gemeldet statt der 517, die der Lookup-Endpunkt zurückgibt. |
| 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. |

Die Codes 514 bis 518 sind unter [Instagram-Reels-Audio-Fehler](https://www.ayrshare.com/docs/errors/errors-ayrshare.md#instagram-reels-audio-errors) beschrieben; die übrigen finden Sie in der [Ayrshare-Fehlerreferenz](https://www.ayrshare.com/docs/errors/errors-ayrshare.md).

## Nächste Schritte

> [card] [Den Track an einen Reel anhängen](https://www.ayrshare.com/docs/apis/post/social-networks/instagram.md#adding-music-to-a-reel)

> [card] [Einen einzelnen Track nachschlagen](https://www.ayrshare.com/docs/apis/media/get-instagram-audio.md)


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.