# Instagram Trending Audio (`adaptable_wheelhouse/instagram-trending-audio`) Actor

Ranks Reel audio by how many sampled public profiles are using it. Instagram's in-app trending flag is not available logged out. Price is unset until publish.

- **URL**: https://apify.com/adaptable_wheelhouse/instagram-trending-audio.md
- **Developed by:** [Mr T](https://apify.com/adaptable_wheelhouse) (community)
- **Categories:** Social media
- **Stats:** 1 total users, 1 monthly users, 70.6% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

$1.50 / 1,000 sounds

This Actor is paid per event. You are not charged for the Apify platform usage, but only a fixed price for specific events.

Learn more: https://docs.apify.com/actors/running/actors-in-store.md#pay-per-event

## What's an Apify Actor?

An Actor is a serverless cloud program that runs on the Apify platform. It has two run modes.
In Batch mode, an Actor accepts a well-defined JSON input, performs an action which can take anything from a few seconds to a few hours,
and optionally produces a well-defined JSON output, datasets with results, or files in key-value store.
In Standby mode, an Actor provides a web server which can be used as a website, API, or an MCP server.

Apify vocabulary and the platform model are defined once, in the agent quickstart at https://apify.com/agents.md.

## How to integrate an Actor?

If asked about integration, you help developers integrate Actors into their projects.
You adapt to their stack and deliver integrations that are safe, well-documented, and production-ready.

Do not guess an integration path. Every one of them is in the agent quickstart at https://apify.com/agents.md: the Apify MCP server, Agent Skills with the Apify CLI, the JavaScript and Python clients, the REST API, and the account-free path for an agent with no human to sign in. It also carries the rule on stating cost before the first paid run.

For examples already wired to this Actor's own input schema, see the [API](#api) section below.

Each client library has reference documentation the quickstart does not restate: [JavaScript/TypeScript](https://docs.apify.com/api/client/js/docs.md) (`npm install apify-client`) and [Python](https://docs.apify.com/api/client/python/docs.md) (`pip install apify-client`).

# README

### Instagram Trending Audio

Trending Instagram Reels audio for any country: songs and original sounds that **Instagram marks as trending** there, ranked by how many sampled creators use them, with the **exact number of Reels** made with each sound and its **daily growth**.

```json
{ "countries": ["US"], "maxSounds": 50 }
```

#### How it works

No login and no browser. The actor calls Instagram's logged-out API on the Android app host (`i.instagram.com`), which, unlike the web API, also answers residential IPs:

1. Creators come from the public Reels tab, from creators found in earlier runs, and from the Reels pages of the sample's top sounds (a second wave). Only creators whose captions are mostly in the country's languages count.
2. `clips/user` gives each creator's latest Reels. Every Reel names its audio and carries Instagram's `is_trending_in_clips` flag for the visitor's country. Reels from the last 14 days are kept.
3. `clips/music` gives each sound's page: the exact Reels count, Spotify track, preview, cover and top Reels.

Each country is read from an IP in that country: the US through Apify datacenter proxies, other countries through Apify residential proxies. If the account has no residential access, the country is read from the Apify server and the trending flag is that location's; the run's status message says so.

Each country's list is built once per UTC day and saved in the `instagram-trending-audio` key-value store. Later runs that day reuse it. Growth compares the Reels count with the most recent earlier list (up to 7 days back), so it appears from a country's second day.

#### Fields

`position`, `title`, `artist`, `artistUsername`, `isTrending`, `creatorsInSample`, `reelsInSample`, `samplePlays`, `reelsCount`, `reelsCountText`, `reelsGrowth`, `reelsGrowthPerDay`, `reelsGrowthPercent`, `isOriginalAudio`, `topReelUrl`, `topReelPlays`, `topReels`, `audioUrl`, `spotifyUrl`, `previewUrl`, `coverUrl`, `durationSeconds`, `isExplicit`, `newestReelAt`, `isNew`, `previousPosition`, `country`, `listDate`, `audioId`.

#### Pricing events

| Event | When |
|---|---|
| `sound` | each sound in the results |
| `fresh-list` | once per country, only when this run builds today's list itself |
| `local-sample` | with a fresh list outside the US, whose creators' Reels are read through residential IPs in the country |

Later runs the same day reuse the country's list and pay only for sounds.

# Actor input Schema

## `countries` (type: `array`):

Two-letter country codes (US, GB, IN, CA, AU, DE, BR, NG...). Instagram marks different sounds as trending in each country, so each country is read from an IP there: US through Apify datacenter IPs, other countries through Apify residential IPs in the country.

## `maxSounds` (type: `integer`):

The top N sounds per country, used by the most creators first.

## `soundType` (type: `string`):

Songs are released tracks from Instagram's music library; original audio is recorded by creators (voiceovers, memes, remixes).

## `trendingOnly` (type: `boolean`):

Keep only sounds with Instagram's trending arrow in that country. Turn off to also get popular sounds of the sample that are not flagged (isTrending column).

## `minCreators` (type: `integer`):

Only sounds used by at least this many different creators of the sample. Empty or 1 = every sound.

## `topReels` (type: `integer`):

The most played Reels that use each sound (link, plays, likes, creator). 0 = none.

## `sampleCreators` (type: `integer`):

How many creators' latest Reels are read to rank the sounds. More creators = more sounds and a steadier ranking. Today's shared list is reused when it was built from at least 80% of this number.

## `forceFresh` (type: `boolean`):

Ignore today's saved list for the country and sample again.

## `onlyNew` (type: `boolean`):

For scheduled runs. The first run returns the list and remembers it; later runs return only sounds that were not returned before under the same monitor name.

## `monitorName` (type: `string`):

Name of the memory used by isNew, previousPosition and Only new sounds. Use a different name for each scheduled task.

## `maxConcurrency` (type: `integer`):

How many Instagram requests run at the same time.

## `proxyConfiguration` (type: `object`):

US requests go through Apify datacenter proxies, other countries through Apify residential IPs in the country. Without residential access, other countries are read from the Apify server and get that location's trending flags.

## `debugLog` (type: `boolean`):

Log every refused request (for troubleshooting).

## Actor input object example

```json
{
  "countries": [
    "US"
  ],
  "maxSounds": 50,
  "soundType": "all",
  "trendingOnly": true,
  "topReels": 3,
  "sampleCreators": 150,
  "forceFresh": false,
  "onlyNew": false,
  "monitorName": "default",
  "maxConcurrency": 8,
  "proxyConfiguration": {
    "useApifyProxy": true
  },
  "debugLog": false
}
```

# Actor output Schema

## `results` (type: `string`):

Rows saved to the dataset.

# API

You can run this Actor programmatically using our API. Below are code examples in JavaScript, Python, and CLI, as well as the OpenAPI specification and MCP server setup.

## JavaScript example

```javascript
import { ApifyClient } from 'apify-client';

// Initialize the ApifyClient with your Apify API token
// Replace the '<YOUR_API_TOKEN>' with your token
const client = new ApifyClient({
    token: '<YOUR_API_TOKEN>',
});

// Prepare Actor input
const input = {
    "countries": [
        "US"
    ]
};

// Run the Actor and wait for it to finish
const run = await client.actor("adaptable_wheelhouse/instagram-trending-audio").call(input);

// Fetch and print Actor results from the run's dataset (if any)
console.log('Results from dataset');
console.log(`💾 Check your data here: https://console.apify.com/storage/datasets/${run.defaultDatasetId}`);
const { items } = await client.dataset(run.defaultDatasetId).listItems();
items.forEach((item) => {
    console.dir(item);
});

// 📚 Want to learn more 📖? Go to → https://docs.apify.com/api/client/js/docs

```

## Python example

```python
from apify_client import ApifyClient

# Initialize the ApifyClient with your Apify API token
# Replace '<YOUR_API_TOKEN>' with your token.
client = ApifyClient("<YOUR_API_TOKEN>")

# Prepare the Actor input
run_input = { "countries": ["US"] }

# Run the Actor and wait for it to finish
run = client.actor("adaptable_wheelhouse/instagram-trending-audio").call(run_input=run_input)

# Fetch and print Actor results from the run's dataset (if there are any)
print(f"💾 Check your data here: https://console.apify.com/storage/datasets/{run.default_dataset_id}")
for item in client.dataset(run.default_dataset_id).iterate_items():
    print(item)

# 📚 Want to learn more 📖? Go to → https://docs.apify.com/api/client/python/docs/quick-start

```

## CLI example

```bash
echo '{
  "countries": [
    "US"
  ]
}' |
apify call adaptable_wheelhouse/instagram-trending-audio --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "type": "http",
            "url": "https://mcp.apify.com/?tools=fetch-actor-details,adaptable_wheelhouse/instagram-trending-audio"
        }
    }
}
```

The hosted server signs you in with OAuth on first connect, so no API token belongs in this config. Clients without OAuth support can send an `Authorization: Bearer <APIFY_API_TOKEN>` header instead, using a token from API & Integrations in Apify Console (https://console.apify.com/settings/integrations).

## OpenAPI specification

Download the OpenAPI definition: https://api.apify.com/v2/actors/mkYcQxVCTghwIh664/builds/vYXntS6FWNpKY5VxC/openapi.json
