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

# Search Instagram audio

> Search Instagram's licensed audio catalog for a track to attach to a Reel

Search Instagram's audio catalog by keyword. Use the returned `audioId` with [`instagramOptions.audioConfiguration`](/docs/apis/post/social-networks/instagram#adding-music-to-a-reel) to attach the track when you publish a Reel.

> [!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](/docs/dashboard/connect-social-accounts/instagram#music-attach-eligibility-facebook-login-required).

## Header Parameters

**Authorization** `string` *required*

[API Key](/docs/apis/overview#authorization) of the Primary Profile.

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

[Profile Key](/docs/apis/overview#profile-key-format) of a User Profile.

Format: `Profile-Key: PROFILE_KEY`

## Query Parameters

**query** `string` *required*

Keyword to search for, such as an artist or track name. An empty or whitespace-only value returns
`code: 101`.

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

Which catalog to search. Either `music` for licensed commercial tracks or `original_sound` for
audio taken from other creators' Reels. Any other value returns `code: 101`.

**limit** `integer`

Maximum number of tracks to return, from `1` to `100`. Non-integer or out-of-range values return
`code: 101`. When omitted, Instagram's own default applies.

## Response Fields

Instagram does not return every field for every track, so treat all track fields except `audioId` as optional.

**status** `string`

`success` when the search completed. An empty catalog match is still a success.

**query** `string`

The keyword that was searched, echoed back.

**audio** `array`

Matching tracks. An empty array means the search ran and matched nothing.

**Track fields**

**audioId** `string`

The id to pass as `audioConfiguration.audioId` when publishing a Reel.

**title** `string`

Track title.

**displayArtist** `string`

Artist name as Instagram displays it.

**durationMs** `integer`

Track length in milliseconds.

**thumbnailUrl** `string`

Cover artwork thumbnail URL.

**audioType** `string`

Either `music` or `original_sound`.

**isAdsEligible** `boolean`

Whether the track may be used in an ad. Licensed music is frequently unavailable for ads even
when it is available for an organic Reel.

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

## Errors

| Code | Meaning |
| - | - |
| 101 | Missing or empty `query`, an unrecognized `audioType`, or a `limit` outside 1 to 100. |
| 156 | Instagram is not linked to this profile. |
| 161 | Instagram's authorization expired or was revoked. Relink the account. |
| 239 | Instagram rejected the request for an account-level reason, including an unavailable track. On search this reports 239 rather than the 517 the lookup endpoint returns. |
| 258 | Instagram returned a malformed response or an unmapped failure. |
| 425 | The connection is missing a required Instagram permission. Relink and grant all permissions. |
| 435 | Instagram's rate limit was reached. Wait before retrying. |
| 514 | Instagram is linked with Instagram Login. The Audio API requires Facebook Login. |

Codes 514 to 518 are described in [Instagram Reels audio errors](/docs/errors/errors-ayrshare#instagram-reels-audio-errors); the rest are in the [Ayrshare error reference](/docs/errors/errors-ayrshare).

## Next Steps

> **[Attach the track to a Reel](/docs/apis/post/social-networks/instagram#adding-music-to-a-reel)**

> **[Look up a single track](/docs/apis/media/get-instagram-audio)**


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