# SongBPM API

> Returns songs with tempo, key, length and streaming links, plus artists and their songs from SongBPM.

Category: Music & Audio. Region: global. 4 endpoints at `https://api.hoshime.com/v1/songbpm/<endpoint>`, `GET` with query parameters, answering `{data, meta}` (see https://hoshime.com/docs/responses.md). Reference: https://hoshime.com/docs/platforms/songbpm
## GET /v1/songbpm/search

Songs the site matches to a search text, each with its tempo, key, length and streaming links.

Scope: `social:read` · Units: 1 · Cached: 360 min · Paginated: cursor

| Parameter | Type | Required | Description |
|---|---|---|---|
| `query` | string | yes | Song and artist, such as coldplay yellow. (e.g. coldplay yellow) |
| `tunnel` | string | no | Id or name of one of your tunnels: the call reads the source from the machine that runs `hoshime tunnel`, through its own connection. Fails with 409 tunnel_unavailable when no machine is connected. Cannot be combined with proxy. |
| `proxy` | string | no | Your own http:// or https:// proxy, such as http://user:pass@proxy.example.com:8080, on a public address. The call reads the source only through it. |
| `profileId` | string | no | Browser profile whose login the call sends (its cookies), so the source answers as that account. Without tunnel or proxy it leaves through the profile's own residential IP. Needs the browser:read scope. Data read logged in is for your account only. |

Response data fields: `amazonUrl` (string), `appleUrl` (string), `artist` (string), `artworkUrl` (string), `bpm` (integer (int64)), `durationSec` (integer (int64)), `key` (string), `path` (string), `spotifyUrl` (string), `title` (string), `url` (string)

```bash
curl "https://api.hoshime.com/v1/songbpm/search?query=coldplay+yellow" -H "Authorization: Bearer $HOSHIME_TOKEN"
```

## GET /v1/songbpm/song

One song's page: its tempo, key, length, title, artist and streaming links.

Scope: `social:read` · Units: 1 · Cached: 1440 min

| Parameter | Type | Required | Description |
|---|---|---|---|
| `path` | string | yes | Song path from the site, artist and song slugs joined by a slash, such as coldplay/yellow. (e.g. coldplay/yellow) |
| `tunnel` | string | no | Id or name of one of your tunnels: the call reads the source from the machine that runs `hoshime tunnel`, through its own connection. Fails with 409 tunnel_unavailable when no machine is connected. Cannot be combined with proxy. |
| `proxy` | string | no | Your own http:// or https:// proxy, such as http://user:pass@proxy.example.com:8080, on a public address. The call reads the source only through it. |
| `profileId` | string | no | Browser profile whose login the call sends (its cookies), so the source answers as that account. Without tunnel or proxy it leaves through the profile's own residential IP. Needs the browser:read scope. Data read logged in is for your account only. |

Response data fields: `amazonUrl` (string), `appleUrl` (string), `artist` (string), `artworkUrl` (string), `bpm` (integer (int64)), `durationSec` (integer (int64)), `key` (string), `path` (string), `spotifyUrl` (string), `title` (string), `url` (string)

```bash
curl "https://api.hoshime.com/v1/songbpm/song?path=coldplay%2Fyellow" -H "Authorization: Bearer $HOSHIME_TOKEN"
```

## GET /v1/songbpm/artist

The songs of one artist on the site, with their tempo and key, with cursor paging.

Scope: `social:read` · Units: 1 · Cached: 360 min · Paginated: cursor

| Parameter | Type | Required | Description |
|---|---|---|---|
| `path` | string | yes | Artist slug from the site, such as coldplay. (e.g. coldplay) |
| `cursor` | string | no | meta.pagination.nextCursor of the previous page. Omit it for the first page. |
| `tunnel` | string | no | Id or name of one of your tunnels: the call reads the source from the machine that runs `hoshime tunnel`, through its own connection. Fails with 409 tunnel_unavailable when no machine is connected. Cannot be combined with proxy. |
| `proxy` | string | no | Your own http:// or https:// proxy, such as http://user:pass@proxy.example.com:8080, on a public address. The call reads the source only through it. |
| `profileId` | string | no | Browser profile whose login the call sends (its cookies), so the source answers as that account. Without tunnel or proxy it leaves through the profile's own residential IP. Needs the browser:read scope. Data read logged in is for your account only. |

Response data fields: `amazonUrl` (string), `appleUrl` (string), `artist` (string), `artworkUrl` (string), `bpm` (integer (int64)), `durationSec` (integer (int64)), `key` (string), `path` (string), `spotifyUrl` (string), `title` (string), `url` (string)

```bash
curl "https://api.hoshime.com/v1/songbpm/artist?path=coldplay" -H "Authorization: Bearer $HOSHIME_TOKEN"
```

## GET /v1/songbpm/artists

The artists of the site's index, optionally those starting with one letter, with cursor paging.

Scope: `social:read` · Units: 1 · Cached: 1440 min · Paginated: cursor

| Parameter | Type | Required | Description |
|---|---|---|---|
| `letter` | string | no | First letter of the artist name. Omit it for the whole index. (one of a, b, c, d, e, f, g, h, i, j, k, l, m, n, o, p, q, r, s, t, u, v, w, x, y, z; e.g. c) |
| `cursor` | string | no | meta.pagination.nextCursor of the previous page. Omit it for the first page. |
| `tunnel` | string | no | Id or name of one of your tunnels: the call reads the source from the machine that runs `hoshime tunnel`, through its own connection. Fails with 409 tunnel_unavailable when no machine is connected. Cannot be combined with proxy. |
| `proxy` | string | no | Your own http:// or https:// proxy, such as http://user:pass@proxy.example.com:8080, on a public address. The call reads the source only through it. |
| `profileId` | string | no | Browser profile whose login the call sends (its cookies), so the source answers as that account. Without tunnel or proxy it leaves through the profile's own residential IP. Needs the browser:read scope. Data read logged in is for your account only. |

Response data fields: `artworkUrl` (string), `name` (string), `path` (string), `url` (string)

```bash
curl "https://api.hoshime.com/v1/songbpm/artists?letter=c" -H "Authorization: Bearer $HOSHIME_TOKEN"
```
