# Music Tagging API: BPM, Key, Mood, Genre and Similar Songs (`nabeelbaghoor/music-tagging-similarity-search-api`) Actor

Music tagging API for your audio library and Spotify tracks: genre, mood, BPM, key, instruments, voice and energy tags, similar song search with BPM and key filters, and free text music search, through the Cyanite API. Bring your own key.

- **URL**: https://apify.com/nabeelbaghoor/music-tagging-similarity-search-api.md
- **Developed by:** [Nabeel Hassan](https://apify.com/nabeelbaghoor) (community)
- **Categories:** Developer tools, AI, Integrations
- **Features:** Limited permissions
- **Stats:** 2 total users, 1 monthly users, 100.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

from $10.00 / 1,000 tagged track with a finished audio analyses

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

## Music Tagging API: BPM, Key, Mood, Genre and Similar Songs

Get AI music tagging (genre, subgenre, mood, BPM, key, instruments, voice, energy and a text caption) for your audio library and Spotify tracks, similar song search with BPM and key filters, and free text music search from the Cyanite API with your own access token, as clean rows you can export to CSV, Excel or JSON.

Cyanite (elceedee UG, Mannheim) is an AI music analysis service used by music publishers, production music libraries, sync agencies, streaming and music tech companies to tag and search catalogues. This actor wraps the documented read operations of the Cyanite GraphQL API: the analysis results of your library tracks, the analysis of Spotify tracks, similarity search and free text search. Use it for catalogue tagging and metadata cleanup, playlist building, DJ set and sync briefs, music recommendation, BI pipelines and spreadsheets. Bring your own API key.

BYOK, not live tested: every operation, argument and field comes from Cyanite's own API documentation and GraphQL schema reference (api-docs.cyanite.ai), and every GraphQL document this actor sends was checked against the live schema on 2026-11-02 with an invalid token (the API validates documents before it checks the key). The actor has not been run against a live token.

### What it does

- **Library track tagging**: every track in your Cyanite library, newest first, 50 per request, with its full audio analysis. Filter by title, by the SHA256 hash of the audio file (duplicate check) or by your external ID.
- **Library tracks by ID**: the analysis of specific library tracks, for example after a webhook told you an analysis finished.
- **Spotify track tagging**: the Cyanite analysis of Spotify tracks by ID, URI or link. Optionally ask Cyanite to analyse a track it has not analysed yet.
- **Similar tracks**: ranked similar songs for library or Spotify seed tracks, from your library, one crate or the Spotify catalogue, with up to 100 matches per seed.
- **Similarity filters**: keep matches within 6 percent of the seed BPM or in a custom BPM range, in the same key or a Camelot compatible key, in the same genre or with the same voice, and compare the complete track, its most representative part or a custom interval.
- **Free text music search**: describe the music in plain English ("uplifting acoustic folk for a travel video") and get ranked tracks from your library, a crate or Spotify.
- **Flat analysis columns**: BPM with confidence, key with confidence, time signature, genre and subgenre tags (both Cyanite taxonomies), free genre tags, mood and advanced mood tags, character and movement tags, instrument tags, voice tags, energy level and dynamics, emotional profile, valence, arousal, musical era, voiceover detection and the auto generated caption.
- **Pay only for results**: unfinished analyses, empty answers and refused lookups become a free row that says why.

### How to get your own key

1. Register at app.cyanite.ai and verify your email address.
2. Open the Integrations section and create a new integration. The webhook URL is required by the form; any public endpoint you control works.
3. Copy the access token shown once after creating the integration.
4. Paste it into the **Cyanite integration access token** field, or set the DATA_API_KEY environment secret. The actor sends it as `Authorization: Bearer <token>`, as documented.
5. Upload some tracks to your library in the web app (or through the API) so the library modes have something to read. Similarity and free text search may need to be enabled for your account by Cyanite.

### Input

| Field | Modes | Notes |
| --- | --- | --- |
| `mode` | all | `libraryTracks`, `libraryTrack`, `spotifyTrack`, `similarTracks`, `freeTextSearch` |
| `apiKey` | all | your integration access token; falls back to the DATA_API_KEY secret |
| `titleFilter`, `sha256`, `externalId` | libraryTracks | at most one; title substring, audio file SHA256 or exact external ID |
| `libraryTrackIds` | libraryTrack, similarTracks | one library track ID per line |
| `spotifyTrackIds` | spotifyTrack, similarTracks | one Spotify ID, `spotify:track:` URI or open.spotify.com link per line |
| `enqueueMissing` | spotifyTrack | ask Cyanite to analyse Spotify tracks with no analysis yet (off by default) |
| `searchTexts` | freeTextSearch | one English description per line |
| `target`, `crateId` | similarTracks, freeTextSearch | `library`, `crate` (with crate ID) or `spotify` |
| `similarCount` | similarTracks, freeTextSearch | matches per seed or description, 1 to 100 (default 10) |
| `includeAnalysis` | similarTracks, freeTextSearch | add the tags to each match (default on) |
| `searchMode`, `intervalStart`, `intervalEnd` | similarTracks | `default`, `mostRepresentative`, `complete` or `interval` in seconds |
| `bpmFilter`, `bpmMin`, `bpmMax` | similarTracks | `none`, `input` (seed BPM plus or minus 6 percent) or `range` |
| `keyFilter` | similarTracks | `none`, `matching` (seed key) or `camelot` (compatible keys) |
| `genreFilter`, `voiceFilter` | similarTracks | keep matches with the seed track's genre or voice |
| `maxResults` | all | stop after this many rows (default 1,000) |

### Output

A tagged library track:

```json
{
    "mode": "libraryTracks",
    "recordType": "track",
    "query": "library",
    "found": true,
    "trackSource": "library",
    "trackId": "1681618",
    "title": "Morning Hue",
    "externalId": "cat-00412",
    "analysisStatus": "finished",
    "bpm": 92,
    "bpmConfidence": 0.81,
    "key": "dMajor",
    "keyConfidence": 0.67,
    "timeSignature": "4/4",
    "advancedGenreTags": ["ambient", "electronicDance"],
    "advancedSubgenreTags": ["minimal"],
    "moodTags": ["calm", "chilled", "ethereal"],
    "characterTags": ["ethereal", "sparse"],
    "advancedInstrumentTags": ["synth", "piano"],
    "voiceTags": ["instrumental"],
    "energyLevel": "low",
    "valence": 0.31,
    "arousal": -0.42,
    "transformerCaption": "A calm ambient piece with soft synth pads and sparse piano."
}
```

A similar track match:

```json
{
    "mode": "similarTracks",
    "recordType": "match",
    "query": "spotify:4cOdK2wGLETKBW3PvgPWqT",
    "found": true,
    "rank": 1,
    "seedSource": "spotify",
    "seedTrackId": "4cOdK2wGLETKBW3PvgPWqT",
    "trackSource": "spotify",
    "trackId": "5P8KKoAiwhzZkwcBuyhdUi",
    "title": "Example Song",
    "spotifyUrl": "https://open.spotify.com/track/5P8KKoAiwhzZkwcBuyhdUi",
    "analysisStatus": "finished",
    "bpm": 124,
    "key": "aMinor"
}
```

Track rows also carry `genreTags`, `subgenreTags`, `freeGenreTags`, `moodAdvancedTags`, `movementTags`, `advancedInstrumentTagsExtended`, `instrumentTags`, `classicalEpochTags`, `musicalEraTag`, `energyDynamics`, `emotionalProfile`, `emotionalDynamics`, `predominantVoiceGender`, `voicePresenceProfile`, `voiceoverExists`, `voiceoverDegree`, `bpmRangeAdjusted` and, for library tracks, `customTags`. A track whose analysis is not finished has `analysisStatus` set to `notStarted`, `enqueued`, `processing`, `failed` or `notAuthorized` and an `analysisNote`. The values above are illustrative.

### Pricing

Pay per event, only for rows with data:

| Event | Price |
| --- | --- |
| Tagged track with a finished analysis (tagging modes, or a search match with tags) | $0.01 |
| Similar track or free text search match without tags | $0.005 |
| Unfinished analyses, empty answers, refused lookups | free |

Your Cyanite plan is billed separately by Cyanite. Requesting analysis of a Spotify track uses your Cyanite analysis allowance.

### FAQ

#### What is the Cyanite API?

The Cyanite API is a GraphQL API from Cyanite (elceedee UG, Mannheim, Germany) for AI music analysis. It tags audio with genre, mood, BPM, key, instruments, voice and energy, finds similar tracks in a library or on Spotify, and searches music by free text descriptions.

#### Do I need my own Cyanite access token?

Yes. This actor is bring your own key: your integration access token, your plan and your analysis and search allowance. Create the token in the Integrations section of app.cyanite.ai.

#### Can this actor upload or analyse my own audio files?

No. Uploading audio is a multi step file upload flow, so this actor reads the analysis of tracks already in your Cyanite library (uploaded in the web app or through the API) and of Spotify tracks. The only write it can make is the optional request to analyse a Spotify track you named.

#### How do I get BPM and key for a Spotify track?

Use the Spotify track tagging mode with the track's ID or open.spotify.com link. If Cyanite has analysed it, the row has `bpm`, `key` and the tags. Cyanite analyses Spotify tracks mainly as similarity search input, so some tags may be empty; turn on the analysis request option for tracks not analysed yet and run again later.

#### How does similar song search work?

Give library track IDs or Spotify track IDs as seeds and pick where to search: your library, one crate or Spotify. Cyanite compares the audio of the seed with the catalogue and returns ranked matches, which you can narrow by BPM, key (same or Camelot compatible), genre and voice.

#### Why did my run stop with "not on your plan"?

Cyanite enables similarity and free text search per account. When it answers `notEligible`, the run ends cleanly and tells you to ask Cyanite (sales@cyanite.ai) to enable the feature. A brand new library can also answer `indexNotFound` for up to 24 hours while Cyanite builds the search index.

#### What do I pay?

$0.01 per track with a finished analysis and $0.005 per search match without tags. Unfinished analyses, empty answers and refused lookups are free.

### Keyword map

music tagging API, AI music tagging, BPM detection API, key detection, song mood detection, music genre classification, audio analysis API, similar songs API, music similarity search, free text music search, Spotify track analysis, Camelot key matching, Cyanite API, production music metadata.

### Routes and verification

| Mode | Operation | Probe with an invalid 191 character token |
| --- | --- | --- |
| Library tracks | query libraryTracks(first, after, filter) | 200 JSON ERR_NOT_AUTHORIZED "Not authorized!", data null (twice) |
| Library tracks by ID | query libraryTrack(id) | 200 JSON ERR_NOT_AUTHORIZED |
| Spotify tracks | query spotifyTrack(id) | 200 JSON ERR_NOT_AUTHORIZED |
| Spotify analysis request | mutation spotifyTrackEnqueue(input) | 200 JSON ERR_NOT_AUTHORIZED |
| Similar tracks | libraryTrack / spotifyTrack { similarTracks(first, target, searchMode, experimental_filter) } | 200 JSON ERR_NOT_AUTHORIZED |
| Free text search | query freeTextSearch(searchText, target, first) | 200 JSON ERR_NOT_AUTHORIZED |
| Invented field control | libraryTracks { edges { node { inventedFieldZ } } } | 400 JSON "Cannot query field" |
| Invented route control | POST /graphql-tracks | 404 text/plain Not Found (twice) |

All operations go to `POST https://api.cyanite.ai/graphql` with the token in the `Authorization: Bearer` header, never in a URL or a log line. Every caller value is sent as a GraphQL variable.

### Licensing and data use

This actor works only with your own Cyanite token, and your agreement with Cyanite applies: the General Terms of Service (cyanite.ai/agb) and the Order for your subscription, which sets your scope of use. The terms grant a non exclusive, non transferable, non sublicensable right to use the services for your authorised Users (which include your employees, contractors and agents), and forbid making the services available to anyone else, for example as a service bureau, and using them to build a competing product. They set no cache or retention limit on analysis results. Use the tags and search results in your own catalogue, products and workflows, do not resell access to the Cyanite service, and check your Order for any further limits. Spotify track IDs and titles in the results come from Spotify's catalogue. This actor is not affiliated with or endorsed by Cyanite or Spotify.

# Actor input Schema

## `mode` (type: `string`):

Each mode sends one documented operation of the Cyanite GraphQL API. Tagging modes return the audio analysis (BPM, key, genre, mood, instruments, voice, energy) of tracks; the search modes return ranked matching tracks.

## `apiKey` (type: `string`):

The access token of your own integration, created in the Integrations section of app.cyanite.ai. Sent as a Bearer token in the Authorization header, never in a URL. Leave empty to use the DATA_API_KEY secret.

## `titleFilter` (type: `string`):

Library tracks. Only tracks whose title includes this text. Use at most one of title, SHA256 hash and external ID.

## `sha256` (type: `string`):

Library tracks. Find the track uploaded from the audio file with this 64 character SHA256 hash, for example to check for a duplicate before uploading.

## `externalId` (type: `string`):

Library tracks. Find tracks with this external ID, the identifier you gave the track when it was created.

## `libraryTrackIds` (type: `array`):

Library tracks by ID and similar tracks. One Cyanite library track ID per line.

## `spotifyTrackIds` (type: `array`):

Spotify tracks and similar tracks. One Spotify track ID, spotify:track: URI or open.spotify.com/track/ link per line.

## `enqueueMissing` (type: `boolean`):

Spotify tracks. When a track has no analysis yet, ask Cyanite to analyse it (spotifyTrackEnqueue). The row then shows the analysis as pending; run again later for the tags. Uses your Cyanite analysis allowance.

## `searchTexts` (type: `array`):

Free text music search. One description per line, in English, such as uplifting acoustic folk for a travel video.

## `target` (type: `string`):

Similar tracks and free text search. Where the matching tracks come from.

## `crateId` (type: `string`):

Similar tracks and free text search, with the crate target. The ID of the crate to search in.

## `similarCount` (type: `integer`):

Similar tracks and free text search. How many ranked matches to return for each seed track or description, up to 100.

## `includeAnalysis` (type: `boolean`):

Similar tracks and free text search. Adds BPM, key, genre, mood and the other tags to each match where Cyanite has analysed it (charged as a tagged track). Turn off for a cheaper list of IDs and titles.

## `searchMode` (type: `string`):

Similar tracks. Which part of the seed track the search compares. The custom interval uses the start and end below.

## `intervalStart` (type: `integer`):

Similar tracks with the custom interval. Start of the part of the seed track to compare, in seconds.

## `intervalEnd` (type: `integer`):

Similar tracks with the custom interval. End of the part of the seed track to compare, in seconds.

## `bpmFilter` (type: `string`):

Similar tracks. Keep only matches in a tempo range. Marked experimental by Cyanite.

## `bpmMin` (type: `integer`):

Similar tracks with the custom BPM range.

## `bpmMax` (type: `integer`):

Similar tracks with the custom BPM range.

## `keyFilter` (type: `string`):

Similar tracks. Keep only matches in the seed track's key, or in keys that mix with it on the Camelot wheel. Marked experimental by Cyanite.

## `genreFilter` (type: `boolean`):

Similar tracks. Keep only matches that share the seed track's genre. Marked experimental by Cyanite.

## `voiceFilter` (type: `boolean`):

Similar tracks. Keep only matches with the seed track's voice tags, such as instrumental. Marked experimental by Cyanite.

## `maxResults` (type: `integer`):

The run stops after this many rows.

## Actor input object example

```json
{
  "mode": "libraryTracks",
  "enqueueMissing": false,
  "target": "library",
  "similarCount": 10,
  "includeAnalysis": true,
  "searchMode": "default",
  "bpmFilter": "none",
  "keyFilter": "none",
  "genreFilter": false,
  "voiceFilter": false,
  "maxResults": 1000
}
```

# Actor output Schema

## `records` (type: `string`):

One row per tagged track, similar track or search match the chosen mode read.

# 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 = {};

// Run the Actor and wait for it to finish
const run = await client.actor("nabeelbaghoor/music-tagging-similarity-search-api").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 = {}

# Run the Actor and wait for it to finish
run = client.actor("nabeelbaghoor/music-tagging-similarity-search-api").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 '{}' |
apify call nabeelbaghoor/music-tagging-similarity-search-api --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "type": "http",
            "url": "https://mcp.apify.com/?tools=fetch-actor-details,nabeelbaghoor/music-tagging-similarity-search-api"
        }
    }
}
```

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/KftHZeLtPcfLOfUI7/builds/YUp28X5hoHsisHR3b/openapi.json
