> ## 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

export const InstagramAudioNotice = () => <Warning>
  <strong>Requires Instagram linked through Facebook Login.</strong> Instagram's Audio API is only available to accounts connected via <strong>Facebook Login</strong>, which needs a Facebook Page connected to the Instagram account. Accounts connected with <strong>Instagram Login</strong> (the Ayrshare default) cannot search, look up, or attach audio, and every audio request returns <code>code: 514</code>.
  <br /><br />
  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.
  <br /><br />
  <strong>Three things are required:</strong>
  <br />
  1. An Instagram <strong>Business</strong> or <strong>Creator</strong> account<br />
  2. A <strong>Facebook Page connected</strong> to that Instagram account<br />
  3. Instagram linked to Ayrshare with <strong>Instagram Login disabled</strong>, so the Facebook Login flow is used
  <br /><br />
  See the <a href="/docs/dashboard/connect-social-accounts/instagram#music-attach-eligibility-facebook-login-required">step-by-step setup guide</a>.
</Warning>;

export const PlansAvailable = ({plans = [], maxPackRequired}) => {
  let displayPlans = plans;
  if (plans && plans.length === 1) {
    const lowerCasePlan = plans[0].toLowerCase();
    if (lowerCasePlan === "business") {
      displayPlans = ["Launch", "Business", "Enterprise"];
    } else if (lowerCasePlan === "premium") {
      displayPlans = ["Premium", "Launch", "Business", "Enterprise"];
    }
  }
  return <Note>
Available on {displayPlans.length === 1 ? "the " : ""}
{displayPlans.join(", ").replace(/\b\w/g, l => l.toUpperCase())}{" "}
{displayPlans.length > 1 ? "plans" : "plan"}.

{maxPackRequired && <span onClick={() => window.open('https://www.ayrshare.com/docs/additional/maxpack', '_self')} className="flex items-center mt-2 cursor-pointer">
 <span className="px-1.5 py-0.5 rounded text-sm" style={{
    backgroundColor: '#C264B6',
    color: 'white',
    fontSize: '12px'
  }}>
   Max Pack required
 </span>
</span>}
</Note>;
};

export const HeaderAPI = ({noProfileKey, profileKeyRequired}) => <>
    <ParamField header="Authorization" type="string" required>
      <a href="/docs/apis/overview#authorization">API Key</a> of the Primary Profile.
      <br />
      <br />
      Format: <code>Authorization: Bearer API_KEY</code>
    </ParamField>
    {!noProfileKey && (profileKeyRequired ? <ParamField header="Profile-Key" type="string" required>
          <a href="/docs/apis/overview#profile-key-format">Profile Key</a> of a User Profile.
          <br />
          <br />
          Format: <code>Profile-Key: PROFILE_KEY</code>
        </ParamField> : <ParamField header="Profile-Key" type="string">
          <a href="/docs/apis/overview#profile-key-format">Profile Key</a> of a User Profile.
          <br />
          <br />
          Format: <code>Profile-Key: PROFILE_KEY</code>
        </ParamField>)}
  </>;

<PlansAvailable plans={["premium"]} maxPackRequired={false} />

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

<InstagramAudioNotice />

## Header-Parameter

<HeaderAPI />

## Query-Parameter

<ParamField query="query" type="string" required>
  Suchbegriff, z. B. ein Künstler- oder Track-Name. Ein leerer oder nur aus Leerzeichen bestehender Wert gibt
  `code: 101` zurück.
</ParamField>

<ParamField query="audioType" type="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.
</ParamField>

<ParamField query="limit" type="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.
</ParamField>

## Antwortfelder

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

<ResponseField name="status" type="string">
  `success`, wenn die Suche abgeschlossen wurde. Auch ein Katalog-Ergebnis ohne Treffer ist ein Erfolg.
</ResponseField>

<ResponseField name="query" type="string">
  Der gesuchte Suchbegriff, als Echo zurückgegeben.
</ResponseField>

<ResponseField name="audio" type="array">
  Passende Tracks. Ein leeres Array bedeutet, dass die Suche ausgeführt wurde und nichts gefunden hat.

  <Expandable title="Track-Felder">
    <ResponseField name="audioId" type="string">
      Die ID, die beim Veröffentlichen eines Reels als `audioConfiguration.audioId` übergeben wird.
    </ResponseField>

    <ResponseField name="title" type="string">Track-Titel.</ResponseField>
    <ResponseField name="displayArtist" type="string">Künstlername, wie Instagram ihn anzeigt.</ResponseField>
    <ResponseField name="durationMs" type="integer">Track-Länge in Millisekunden.</ResponseField>
    <ResponseField name="thumbnailUrl" type="string">Thumbnail-URL des Cover-Artworks.</ResponseField>
    <ResponseField name="audioType" type="string">Entweder `music` oder `original_sound`.</ResponseField>

    <ResponseField name="isAdsEligible" type="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.
    </ResponseField>
  </Expandable>
</ResponseField>

<ResponseExample>
  ```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"
  }
  ```
</ResponseExample>

## 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](/docs/errors/errors-ayrshare#instagram-reels-audio-errors) beschrieben; die übrigen finden Sie in der [Ayrshare-Fehlerreferenz](/docs/errors/errors-ayrshare).

## Nächste Schritte

<Card title="Den Track an einen Reel anhängen" icon="music" href="/docs/apis/post/social-networks/instagram#adding-music-to-a-reel" horizontal />

<Card title="Einen einzelnen Track nachschlagen" icon="magnifying-glass" href="/docs/apis/media/get-instagram-audio" horizontal />
