# 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/workflows/songbpm
- Handle: `@songbpm`
- Category: [Entertainment](https://fous.com/workflows/category/entertainment)
- Source website: https://songbpm.com
- Last verified: Sep 29, 2026
- Fous is not affiliated with SongBPM.

## Methods

### Get song tempo and key

Operation `get_song_tempo_and_key`, version 1. 1 credit per call.

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

Call the API with a Fous API key (`FOUS_API_KEY`). To create one, turn on Developer mode in Fous Studio, then open Keys & connections → API keys (https://app.fous.com/keys).

```bash
# First set your key: export FOUS_API_KEY='YOUR_FOUS_API_KEY'
: "${FOUS_API_KEY:?Set FOUS_API_KEY before running this example}"

curl 'https://api.fous.com/v1/query' \
  --fail-with-body --silent --show-error --max-time 120 \
  -H "Authorization: Bearer $FOUS_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.
# First set your key: export FOUS_API_KEY='YOUR_FOUS_API_KEY'
import json
import os
import urllib.error
import urllib.request

api_key = os.environ.get("FOUS_API_KEY")
if not api_key:
    raise RuntimeError("Set FOUS_API_KEY before running this example")

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=120) 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.
// First set your key: export FOUS_API_KEY='YOUR_FOUS_API_KEY'
const apiKey = process.env.FOUS_API_KEY;
if (!apiKey) throw new Error("Set FOUS_API_KEY before running this example");

const response = await fetch("https://api.fous.com/v1/query", {
  method: "POST",
  headers: {
    "Authorization": `Bearer ${apiKey}`,
    "Content-Type": "application/json",
  },
  signal: AbortSignal.timeout(120_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);
```

Or describe the data in plain language: send `{"api":"@songbpm","prompt":"Describe the data you need, with every detail"}` to the same URL. Fous fills in the input, runs the method that fits and returns only the fields you asked for; `data.route.calls[].request` is the exact call it made. Routing is free; the run costs the same.

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

### Is Fous affiliated with SongBPM?

No. Fous is not affiliated with SongBPM. This workflow reads the public songbpm.com website and returns its data.

### How much does it cost?

Each run costs 1 credit. 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; repeating the same request within a day may return the saved result. Fous checks this workflow automatically; it last passed a check 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/workflows/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/workflows/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/workflows/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/workflows/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/workflows/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/workflows/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/workflows/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/workflows/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 workflows](https://fous.com/workflows/category/entertainment)
