Skip to content

Get Instagram Audio ​

GEThttps://api.repliz.com/public/addon/instagram/audio

Searches the music and original sounds that can go on a scheduled Instagram Reel. The account needs Music & Research turned on with Authorize Instagram Music & Research and Connect Instagram Music & Research. Put the id you pick in additionalInfo.music of Create Schedule, see Music Object.

Endpoint Details ​

  • Authentication: Basic Auth (Authorization: Basic Base64(AccessKey:SecretKey)) or Bearer token from Login with Repliz
  • Scope (Bearer only): addon:read (or addon:write)
  • Access Tier: Premium+

Parameters ​

ParameterTypeRequiredDescription
accountIdstringYesID of an Instagram account with Music & Research turned on, the _id from Get Account.
typestringNomusic for licensed tracks, or original_sound for sounds made by Instagram accounts. Default music. Any other value is 400.
searchstringNoTitle or artist to search for, up to 100 characters. Left out or empty, Instagram returns trending audio.
nextTokenstringNoThe nextToken of the previous response, for the next page.

Example Request ​

bash
curl -X GET "https://api.repliz.com/public/addon/instagram/audio?accountId=680affa5ce12f2f72916f67e&type=music&search=tulus" \
  -H "Authorization: Basic $(echo -n 'YOUR_ACCESS_KEY:YOUR_SECRET_KEY' | base64)"
javascript
import axios from 'axios';

const response = await axios.get('https://api.repliz.com/public/addon/instagram/audio', {
  params: {
    accountId: '680affa5ce12f2f72916f67e',
    type: 'music',
    search: 'tulus',
  },
  auth: {
    username: 'YOUR_ACCESS_KEY',
    password: 'YOUR_SECRET_KEY',
  },
});

console.log(response.data);
javascript
const credentials = btoa('YOUR_ACCESS_KEY:YOUR_SECRET_KEY');

const response = await fetch(
  'https://api.repliz.com/public/addon/instagram/audio?accountId=680affa5ce12f2f72916f67e&type=music&search=tulus',
  {
    headers: {
      Authorization: `Basic ${credentials}`,
    },
  },
);

const data = await response.json();
console.log(data);

Response ​

json
{
  "docs": [
    {
      "id": "1234567890123456",
      "type": "music",
      "artist": "Tulus",
      "name": "Hati-Hati di Jalan",
      "thumbnail": "https://scontent.cdninstagram.com/v/t39.30808-6/cover.jpg",
      "duration": 30,
      "url": "https://scontent.cdninstagram.com/v/t39.12345-6/audio.m4a",
      "link": "https://www.instagram.com/reels/audio/1234567890123456/"
    }
  ],
  "nextToken": ""
}
json
{
  "code": 400,
  "message": "turn on music and research for this instagram account first"
}
json
{
  "code": 404,
  "message": "account not found"
}
json
{
  "code": 401,
  "message": "unauthorized"
}
FieldDescription
docs[].idInstagram audio ID. Send it as additionalInfo.music.id.
docs[].typemusic or original_sound, the type you asked for.
docs[].artistArtist of a track, or the username of the account that made an original sound.
docs[].nameTitle of the audio.
docs[].thumbnailCover image URL, or the profile picture of the account for an original sound. Empty when there's none.
docs[].durationLength in seconds.
docs[].urlFile to preview the audio. Empty when Instagram doesn't send one.
docs[].linkThe audio page on Instagram. Empty when Instagram doesn't send one.
nextTokenCursor for the next page. Only trending audio has more pages, so a search always returns "".

Instagram only returns audio licensed for third-party apps, so the list is shorter than the one in the Instagram app. 400 with turn on music and research for this instagram account first means the account doesn't have Music & Research yet, and invalid account type means accountId isn't an Instagram account. An error from Instagram, for example after the user removed Repliz from their business portfolio, comes back with the status and message from Instagram. Connect Music & Research again to fix it.