# Bandcamp API

> Returns Bandcamp album and track metadata and search results for artists, albums, tracks and fans.

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

Metadata of one Bandcamp album, with its tracks in order.

Scope: `social:read` · Units: 5 · Cached: 60 min

| Parameter | Type | Required | Description |
|---|---|---|---|
| `url` | string | yes | Bandcamp album URL, such as https://artist.bandcamp.com/album/name. (e.g. https://radiohead.bandcamp.com/album/in-rainbows) |
| `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: `artist` (string), `artistUrl` (string), `durationSeconds` (integer (int64)), `imageUrl` (string), `label` (string), `releaseDate` (string), `title` (string), `trackCount` (integer (int64)), `tracks` (AlbumTrack[]), `tracks[].durationSeconds` (integer (int64)), `tracks[].position` (integer (int64)), `tracks[].title` (string), `tracks[].url` (string), `url` (string)

```bash
curl "https://api.hoshime.com/v1/bandcamp/album?url=https%3A%2F%2Fradiohead.bandcamp.com%2Falbum%2Fin-rainbows" -H "Authorization: Bearer $HOSHIME_TOKEN"
```

## GET /v1/bandcamp/track

Metadata of one Bandcamp track: its artist, album and duration.

Scope: `social:read` · Units: 5 · Cached: 60 min

| Parameter | Type | Required | Description |
|---|---|---|---|
| `url` | string | yes | Bandcamp track URL, such as https://artist.bandcamp.com/track/name. (e.g. https://radiohead.bandcamp.com/track/nude) |
| `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: `albumTitle` (string), `albumUrl` (string), `artist` (string), `artistUrl` (string), `durationSeconds` (integer (int64)), `imageUrl` (string), `title` (string), `url` (string)

```bash
curl "https://api.hoshime.com/v1/bandcamp/track?url=https%3A%2F%2Fradiohead.bandcamp.com%2Ftrack%2Fnude" -H "Authorization: Bearer $HOSHIME_TOKEN"
```

## GET /v1/bandcamp/search

Artists, albums, tracks and fans that match a search, from Bandcamp's search box (a few best matches).

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

| Parameter | Type | Required | Description |
|---|---|---|---|
| `query` | string | yes | Search text. (e.g. lofi beats) |
| `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: `bandId` (string), `bandName` (string), `id` (string), `imageUrl` (string), `name` (string), `type` (string), `url` (string)

```bash
curl "https://api.hoshime.com/v1/bandcamp/search?query=lofi+beats" -H "Authorization: Bearer $HOSHIME_TOKEN"
```
