# Spotify API

> Returns Spotify tracks, albums, artists, playlists, podcast shows and episodes: artists, release dates, durations, follower and listener counts. No lyrics or audio.

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

One Spotify track: title, artists, album, duration and release date.

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

| Parameter | Type | Required | Description |
|---|---|---|---|
| `id` | string | yes | Track id, spotify:track URI or open.spotify.com track URL. (e.g. 4cOdK2wGLETKBW3PvgPWqT) |
| `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: `album` (Ref), `album.id` (string), `album.name` (string), `album.url` (string), `artists` (Ref[]), `artists[].id` (string), `artists[].name` (string), `artists[].url` (string), `discNumber` (any), `durationMs` (integer (int64)), `explicit` (boolean), `id` (string), `imageUrl` (string), `name` (string), `playCount` (integer (int64)), `releaseDate` (string), `trackNumber` (any), `url` (string)

```bash
curl "https://api.hoshime.com/v1/spotify/track?id=4cOdK2wGLETKBW3PvgPWqT" -H "Authorization: Bearer $HOSHIME_TOKEN"
```

## GET /v1/spotify/album

One Spotify album with its artists, release date and track list.

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

| Parameter | Type | Required | Description |
|---|---|---|---|
| `id` | string | yes | Album id, spotify:album URI or open.spotify.com album URL. (e.g. 4aawyAB9vmqN3uQ7FjRGTy) |
| `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: `artists` (Ref[]), `artists[].id` (string), `artists[].name` (string), `artists[].url` (string), `id` (string), `imageUrl` (string), `name` (string), `releaseDate` (string), `trackCount` (integer (int64)), `tracks` (Track[]), `tracks[].album` (Ref), `tracks[].artists` (Ref[]), `tracks[].discNumber` (any), `tracks[].durationMs` (integer (int64)), `tracks[].explicit` (boolean), `tracks[].id` (string), `tracks[].imageUrl` (string), `tracks[].name` (string), `tracks[].playCount` (integer (int64)), `tracks[].releaseDate` (string), `tracks[].trackNumber` (any), `tracks[].url` (string), `type` (string), `url` (string)

```bash
curl "https://api.hoshime.com/v1/spotify/album?id=4aawyAB9vmqN3uQ7FjRGTy" -H "Authorization: Bearer $HOSHIME_TOKEN"
```

## GET /v1/spotify/artist

One Spotify artist: followers, monthly listeners, biography, top tracks, releases and related artists.

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

| Parameter | Type | Required | Description |
|---|---|---|---|
| `id` | string | yes | Artist id, spotify:artist URI or open.spotify.com artist URL. (e.g. 0OdUWJ0sBjDrqHygGUXeCF) |
| `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: `albums` (Album[]), `albums[].artists` (Ref[]), `albums[].id` (string), `albums[].imageUrl` (string), `albums[].name` (string), `albums[].releaseDate` (string), `albums[].trackCount` (integer (int64)), `albums[].tracks` (Track[]), `albums[].type` (string), `albums[].url` (string), `avatarUrl` (string), `bio` (string), `createdAt` (string), `followerCount` (integer (int64)), `followingCount` (integer (int64)), `id` (string), `monthlyListenerCount` (integer (int64)), `name` (string), `postCount` (integer (int64)), `relatedArtists` (Ref[]), `relatedArtists[].id` (string), `relatedArtists[].name` (string), `relatedArtists[].url` (string), `topTracks` (Track[]), `topTracks[].album` (Ref), `topTracks[].artists` (Ref[]), `topTracks[].discNumber` (any), `topTracks[].durationMs` (integer (int64)), `topTracks[].explicit` (boolean), `topTracks[].id` (string), `topTracks[].imageUrl` (string), `topTracks[].name` (string), `topTracks[].playCount` (integer (int64)), `topTracks[].releaseDate` (string), `topTracks[].trackNumber` (any), `topTracks[].url` (string), `url` (string), `username` (string), `verified` (boolean)

```bash
curl "https://api.hoshime.com/v1/spotify/artist?id=0OdUWJ0sBjDrqHygGUXeCF" -H "Authorization: Bearer $HOSHIME_TOKEN"
```

## GET /v1/spotify/playlist

One public Spotify playlist: owner, followers, track count and its first tracks.

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

| Parameter | Type | Required | Description |
|---|---|---|---|
| `id` | string | yes | Playlist id, spotify:playlist URI or open.spotify.com playlist URL. (e.g. 37i9dQZF1DXcBWIGoYBM5M) |
| `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: `description` (string), `followerCount` (integer (int64)), `id` (string), `imageUrl` (string), `name` (string), `owner` (Author), `owner.avatarUrl` (string), `owner.id` (string), `owner.name` (string), `owner.url` (string), `owner.username` (string), `trackCount` (integer (int64)), `tracks` (Track[]), `tracks[].album` (Ref), `tracks[].artists` (Ref[]), `tracks[].discNumber` (any), `tracks[].durationMs` (integer (int64)), `tracks[].explicit` (boolean), `tracks[].id` (string), `tracks[].imageUrl` (string), `tracks[].name` (string), `tracks[].playCount` (integer (int64)), `tracks[].releaseDate` (string), `tracks[].trackNumber` (any), `tracks[].url` (string), `url` (string)

```bash
curl "https://api.hoshime.com/v1/spotify/playlist?id=37i9dQZF1DXcBWIGoYBM5M" -H "Authorization: Bearer $HOSHIME_TOKEN"
```

## GET /v1/spotify/episode

One Spotify podcast episode: title, description, show, release time and duration.

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

| Parameter | Type | Required | Description |
|---|---|---|---|
| `id` | string | yes | Episode id, spotify:episode URI or open.spotify.com episode URL. (e.g. 2en2xJFq6PzeSFWqWitPqI) |
| `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: `description` (string), `durationMs` (integer (int64)), `explicit` (boolean), `id` (string), `imageUrl` (string), `language` (string), `name` (string), `releasedAt` (string), `show` (Ref), `show.id` (string), `show.name` (string), `show.url` (string), `url` (string)

```bash
curl "https://api.hoshime.com/v1/spotify/episode?id=2en2xJFq6PzeSFWqWitPqI" -H "Authorization: Bearer $HOSHIME_TOKEN"
```

## GET /v1/spotify/show

One Spotify podcast: publisher, topics, rating and its latest episodes.

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

| Parameter | Type | Required | Description |
|---|---|---|---|
| `id` | string | yes | Show id, spotify:show URI or open.spotify.com show URL. (e.g. 4rOoJ6Egrf8K2IrywzwOMk) |
| `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: `description` (string), `episodeCount` (integer (int64)), `episodes` (Episode[]), `episodes[].description` (string), `episodes[].durationMs` (integer (int64)), `episodes[].explicit` (boolean), `episodes[].id` (string), `episodes[].imageUrl` (string), `episodes[].language` (string), `episodes[].name` (string), `episodes[].releasedAt` (string), `episodes[].show` (Ref), `episodes[].url` (string), `explicit` (boolean), `id` (string), `imageUrl` (string), `language` (string), `name` (string), `publisher` (string), `rating` (number (double)), `ratingCount` (integer (int64)), `topics` (string[]), `url` (string)

```bash
curl "https://api.hoshime.com/v1/spotify/show?id=4rOoJ6Egrf8K2IrywzwOMk" -H "Authorization: Bearer $HOSHIME_TOKEN"
```
