# SongBPM API

> SongBPM returns song tempo, musical key, length, and time signature as a workflow and API.

SongBPM finds a song match from a title and artist. Get song tempo and key returns tempo, musical key, Camelot key, length, and time signature.

- Page: https://fous.com/tools/songbpm
- Handle: `@songbpm`
- Category: [Entertainment](https://fous.com/tools/category/entertainment)
- Source website: https://songbpm.com
- Last verified: Sep 29, 2026

## Methods

### Get song tempo and key

Operation `get_song_tempo_and_key`, version 1. 1 credit per completed call. Failed calls without a completed billing receipt are free; completed work can remain charged if delivery is interrupted.

Find the best SongBPM match for a song title and artist and return its tempo, musical key, Camelot key, length and time signature. Album and numeric danceability, energy and acousticness may be unavailable on public song pages.

**Input**

| Field | Type | Required | Example | Description |
|---|---|---|---|---|
| `song` | string | yes | `"Shake It Off"` | Song title, for example Blinding Lights. |
| `artist` | string | yes | `"Taylor Swift"` | Performing artist, for example The Weeknd. |

**Input schema**

```json
{
  "type": "object",
  "required": [
    "song",
    "artist"
  ],
  "properties": {
    "song": {
      "type": "string",
      "description": "Song title, for example Blinding Lights.",
      "examples": [
        "Shake It Off",
        "Blinding Lights"
      ]
    },
    "artist": {
      "type": "string",
      "description": "Performing artist, for example The Weeknd.",
      "examples": [
        "Taylor Swift",
        "The Weeknd"
      ]
    }
  },
  "additionalProperties": false,
  "examples": [
    {
      "song": "Shake It Off",
      "artist": "Taylor Swift"
    },
    {
      "song": "Blinding Lights",
      "artist": "The Weeknd"
    }
  ]
}
```

**Output**

| Field | Type | Example | Description |
|---|---|---|---|
| `song` | string | `"Shake It Off"` | Matched song title. |
| `album` | string or null |  | Album name, when available. |
| `artist` | string | `"Taylor Swift"` | Matched artist. |
| `energy` | number or null |  | Energy on a 0–100 scale when shown. |
| `length` | string or null | `"3:39"` | Song length, such as 3:20. |
| `tempo_bpm` | number | `160` | Tempo in beats per minute. |
| `camelot_key` | string or null | `"9B"` | Camelot mixing key derived from musical key and mode. |
| `musical_key` | string or null | `"G major"` | Musical key and mode, when shown. |
| `acousticness` | number or null |  | Acousticness on a 0–100 scale when shown. |
| `danceability` | number or null |  | Danceability on a 0–100 scale when shown. |
| `songbpm_link` | string | `"https://songbpm.com/@taylor-swift/shake-it-off-1000c4cd-c78c-4d56-8b14-ff6f354a3c45"` | Link to the matched SongBPM song page. |
| `length_seconds` | integer or null | `219` | Song length in seconds. |
| `time_signature` | string or null | `"4/4"` | Beats per bar as a time signature when shown. |

**Example input**

```json
{
  "song": "Shake It Off",
  "artist": "Taylor Swift"
}
```

**Example output**

```json
{
  "song": "Shake It Off",
  "album": null,
  "artist": "Taylor Swift",
  "energy": null,
  "length": "3:39",
  "tempo_bpm": 160,
  "camelot_key": "9B",
  "musical_key": "G major",
  "acousticness": null,
  "danceability": null,
  "songbpm_link": "https://songbpm.com/@taylor-swift/shake-it-off-1000c4cd-c78c-4d56-8b14-ff6f354a3c45",
  "length_seconds": 219,
  "time_signature": "4/4"
}
```

## Quick start

Replace `YOUR_API_KEY` with a Fous API key. To create one, open Developers at the bottom of Fous Studio, turn on Developer mode, then go to API keys (https://app.fous.com/keys). Change the values in `input` to run the same tool on new data.

```bash
curl 'https://api.fous.com/v1/query' \
  --fail-with-body --silent --show-error --max-time 180 \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H 'Content-Type: application/json' \
  --data-raw '{
  "api": "@songbpm",
  "visibility": "public",
  "operation": "get_song_tempo_and_key",
  "version": 1,
  "input": {
    "song": "Shake It Off",
    "artist": "Taylor Swift"
  },
  "response": {
    "format": "json"
  }
}'
```

```python
# Save as fous.py and run with python3 fous.py. No packages needed.
import json
import urllib.error
import urllib.request

api_key = "YOUR_API_KEY"

body = json.loads("{\n  \"api\": \"@songbpm\",\n  \"visibility\": \"public\",\n  \"operation\": \"get_song_tempo_and_key\",\n  \"version\": 1,\n  \"input\": {\n    \"song\": \"Shake It Off\",\n    \"artist\": \"Taylor Swift\"\n  },\n  \"response\": {\n    \"format\": \"json\"\n  }\n}")
request = urllib.request.Request(
    "https://api.fous.com/v1/query",
    data=json.dumps(body).encode("utf-8"),
    headers={
        "Authorization": f"Bearer {api_key}",
        "Content-Type": "application/json",
    },
    method="POST",
)
try:
    with urllib.request.urlopen(request, timeout=180) as response:
        result = json.load(response)
except urllib.error.HTTPError as error:
    raise RuntimeError(f"HTTP {error.code}: {error.read().decode('utf-8', errors='replace')}") from error
if result.get("success") is False:
    raise RuntimeError(result.get("error", {}).get("message", "Request failed"))
print(json.dumps(result["data"]["output"], indent=2))
```

```typescript
// Save as fous.mts and run with npx tsx fous.mts.
const apiKey = "YOUR_API_KEY";

const response = await fetch("https://api.fous.com/v1/query", {
  method: "POST",
  headers: {
    "Authorization": `Bearer ${apiKey}`,
    "Content-Type": "application/json",
  },
  signal: AbortSignal.timeout(180_000),
  body: JSON.stringify({
  "api": "@songbpm",
  "visibility": "public",
  "operation": "get_song_tempo_and_key",
  "version": 1,
  "input": {
    "song": "Shake It Off",
    "artist": "Taylor Swift"
  },
  "response": {
    "format": "json"
  }
}),
});
type ApiResult = { success: boolean; data?: { output: unknown }; error?: { message: string } };
const result: ApiResult = await response.json();
if (!response.ok || result.success === false) {
  throw new Error(result.error?.message ?? `HTTP ${response.status}`);
}
if (!result.data) throw new Error("Missing API response data");
console.log(result.data.output);
```

## Use from an AI assistant

Connect this tool to Claude Code, Claude Desktop, Cursor, VS Code, Codex and any MCP client as its own MCP server. Each method is a typed tool whose arguments are the method’s input.

- Server URL: `https://api.fous.com/mcp/tools/songbpm`
- Authorization: `Authorization: Bearer <Fous API key>`

**Tools**

- `get_song_tempo_and_key`: Get song tempo and key. 1 credit per completed call. Failed calls without a completed billing receipt are free; completed work can remain charged if delivery is interrupted.
- `fous_get_run`: the result of a run that was still going, by its `request_id`. Free.

Claude Code:

```bash
claude mcp add --scope user --transport http fous-songbpm https://api.fous.com/mcp/tools/songbpm --header "Authorization: Bearer ${FOUS_API_KEY:?Set FOUS_API_KEY to your Fous API key}"
```

To give the assistant every tool, connect `https://api.fous.com/mcp`: it finds one with `fous_search_tools` and runs it with `fous_run_tool`. Setup for other clients: https://fous.com/llms-full.txt.

## Use cases

- Find tempos for songs in a playlist
- Match songs by title and artist
- Group tracks by musical key
- Check song lengths and time signatures

## FAQ

### Can I run it with my own inputs?

Yes. Change the inputs in Studio and press Run, or send new inputs from your code, or ask a connected AI assistant.

### Can I call this SongBPM tool as an API?

Yes. Send a POST request to /v1/query with your Fous API key and the inputs, and get JSON back.

### How much does it cost?

Each completed run costs 1 credit. Failed runs without a completed receipt are free; completed work can remain charged if delivery is interrupted. With pay as you go, a credit costs 1¢. Monthly plans cost less per credit.

### Do I need a SongBPM account?

No. You only need a Fous account.

### How current is the data?

Fous gets the data from songbpm.com when you run it. Some results are reused for up to 24 hours, and results that use your account or key are never reused. It was last verified on Sep 29, 2026.

### What is a song’s tempo?

Get song tempo and key returns the tempo in beats per minute for a matched song.

### What key is a song in?

Get song tempo and key returns the musical key and mode when shown, plus a Camelot key.

### How long is a song?

Get song tempo and key returns song length as a time and in seconds.

## Related

- [Deezer API](https://fous.com/tools/deezer.md): Deezer provides albums with ordered tracklists, song recording details, and current worldwide charts or official country-playlist tracks; previews and some tempo data may be unavailable or expire.
- [Spotify API](https://fous.com/tools/spotify.md): Spotify returns public artist profiles, album credits and ordered tracks, song details and play counts, up to 500 playlist songs, keyword results, and country-based podcast charts; dates and regional options vary.
- [MusicBrainz API](https://fous.com/tools/musicbrainz.md): MusicBrainz provides community-maintained recording and release information, matching songs to identifiers and release dates and providing artist details and links when available; some release information may be incomplete.
- [Genius API](https://fous.com/tools/genius.md): Genius provides lyrics, annotations, credits, and music knowledge, plus song stories, relationships, page details, and artist song lists by popularity or release date; dates and views may be unavailable.
- [Apple Music API](https://fous.com/tools/apple-music.md): Apple Music returns albums, tracks, artist profiles, latest releases, top music, matching songs, and current charts; prices, previews, and older albums may be unavailable.
- [Last.fm API](https://fous.com/tools/last-fm.md): Last.fm provides listening statistics, artist profiles, discovery, up to 50 tracks or albums, similar artists without percentages, and upcoming events that may be absent.
- [SoundCloud API](https://fous.com/tools/soundcloud.md): SoundCloud lets people listen to and share music, find public tracks with play stats, and browse artists’ tracks, with popular lists limited to 30.
- [Bandcamp API](https://fous.com/tools/bandcamp.md): Bandcamp provides music albums and merchandise from artists and labels, with album details and prices and genre releases ordered by best-selling or new arrivals; availability details appear only when shown.
- [All Entertainment tools](https://fous.com/tools/category/entertainment)
