> For the complete documentation index, see [llms.txt](https://spinamp.gitbook.io/spinamp-sdk/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://spinamp.gitbook.io/spinamp-sdk/reference/api-reference/playlists.md).

# Playlists

#### fetchFeaturedPlaylists(): Promise<[IPlaylist](/spinamp-sdk/reference/api-reference/types.md#iplaylist)\[]>

Returns list of playlists, which are currently marked as featured on spinamp.

#### fetchPlaylistById(playlistId: string): Promise<{playlist: [IPlaylist](/spinamp-sdk/reference/api-reference/types.md#iplaylist)\[], playlistTracks: [ITrack](/spinamp-sdk/reference/api-reference/types.md#itrack)\[]}>

Gets playlist by provided playlist id. Returns `playlist` object and list of full tracks belonging to this playlist.

#### fetchCollectorPlaylists(collectorAddress: string): Promise<[IPlaylist](/spinamp-sdk/reference/api-reference/types.md#iplaylist)\[]>

Returns list of playlists created by user with provided address.

#### createPlaylist(playlist: Omit<[IPlaylist](/spinamp-sdk/reference/api-reference/types.md#iplaylist), 'id'>, signer: [Signer](https://docs.ethers.io/v5/api/signer/)): Promise<{id: string}>

Creates a new playlist and returns the playlist id

{% hint style="info" %}
An ethers signer object is required for API authentication
{% endhint %}

```
  const wallet = ethers.Wallet.createRandom();
  const vibeyPlaylist = {
    title: 'vibey',
    trackIds: ['ethereum/0xd5b2c770dc0a9677cf672d53f554f6f806e75e07/1'],
  };

  const {id} = await createPlaylist(vibeyPlaylist, wallet);

```

#### updatePlaylist(id: string, playlist: Partial<[IPlaylist](/spinamp-sdk/reference/api-reference/types.md#iplaylist)>, signer: [Signer](https://docs.ethers.io/v5/api/signer/)): Promise<{id: string; title: string: trackIds: string\[] }>

Updates a playlist and returns the new values

{% hint style="info" %}
Only the signer that created the playlist is able to update it
{% endhint %}

```
  const wallet = ethers.Wallet.createRandom();
  const vibeyPlaylist = {
    id: 'kfF8MuFHmW6MwHIWNKQF',
    title: 'super vibey',
    trackIds: ['ethereum/0xd5b2c770dc0a9677cf672d53f554f6f806e75e07/1'],
  };

  const playlist = await updatePlaylist(vibeyPlaylist.id, vibeyPlaylist, wallet);

```


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://spinamp.gitbook.io/spinamp-sdk/reference/api-reference/playlists.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
