# Spotify — Wrapped API

> **You are on:** `https://api.paywithlocus.com/api` | [llms.txt](https://paywithlocus.com/llms.txt) | [docs](https://docs.paywithlocus.com)
>
> Locus runs on multiple environments -- make sure every URL you call matches your expected environment.
> | Environment | Landing | API | Docs |
> |---|---|---|---|
> | Production | paywithlocus.com | api.paywithlocus.com | docs.paywithlocus.com |
> | Beta | beta.paywithlocus.com | api.beta.paywithlocus.com | docs.paywithlocus.com |
> | Stage | stage.paywithlocus.com | api.stage.paywithlocus.com | docs.paywithlocus.com |
>
> If the API URL above doesn't match your expected environment, re-fetch this file from the correct domain.

> Search millions of songs and artists in Spotify's catalog, then dive deep into any artist's complete discography, top tracks, fan statistics, and similar artists they're connected to. Perfect for discovering new music, researching artist backgrounds, or building personalized music recommendations.

**Category:** Music | **Website:** [spotify.com/](https://spotify.com/) | **Docs:** [parse.bot/marketplace/3b15ebb3-996f-488a-a861-671d27c8344b/spotify-com-api](https://parse.bot/marketplace/3b15ebb3-996f-488a-a861-671d27c8344b/spotify-com-api)

Pay-per-use API proxy. Each call is automatically billed to your wallet in USDC.

## Access

**Base URL:** `https://api.paywithlocus.com/api/wrapped/parse-spotify-com-api-3b15ebb3/`
**Auth:** `Authorization: Bearer <LOCUS_API_KEY>`

## Endpoints

### get_artist

Retrieve comprehensive information about a Spotify artist by their ID. Returns biography, monthly listener count, follower count, world ranking, top tracks with play counts, discography (albums and singles), related artists, top listener cities, and external links.

**Estimated cost:** Metered

| Field | Type | Required | Description |
|-------|------|----------|-------------|
| `artist_id` | string | Yes | Spotify artist ID (alphanumeric, 22 characters, e.g. '06HL4z0CvFAxyc27GXpf02'). Obtainable from search results. |

```bash
curl -X POST https://api.paywithlocus.com/api/wrapped/parse-spotify-com-api-3b15ebb3/get_artist \
  -H "Authorization: Bearer YOUR_LOCUS_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"artist_id":"<string>"}'
```

### get_artist_releases

Retrieve upcoming and recent releases for a specific Spotify artist. Returns the artist's discography sorted by release date (newest first), each tagged with an `is_upcoming` boolean. When no upcoming releases exist, recent releases are returned. Falls back gracefully when filtering yields an empty set.

**Estimated cost:** Metered

| Field | Type | Required | Description |
|-------|------|----------|-------------|
| `artist_id` | string | Yes | Spotify artist ID (alphanumeric, 22 characters, e.g. '4dpARuHxo51G3z768sgnrY'). Obtainable from search results. |
| `limit` | integer | No | Maximum number of releases to return (1-50). |
| `only_upcoming` | boolean | No | When true, return only future releases (is_upcoming=true), excluding recent ones. |

```bash
curl -X POST https://api.paywithlocus.com/api/wrapped/parse-spotify-com-api-3b15ebb3/get_artist_releases \
  -H "Authorization: Bearer YOUR_LOCUS_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"artist_id":"<string>","limit":"<integer>","only_upcoming":"<boolean>"}'
```

### get_upcoming_releases

Discover upcoming and recent releases for a given record label or distributor. Searches Spotify's catalog using the label filter, identifies associated artists, and aggregates their upcoming or recently released music. Each release carries an `is_upcoming` boolean distinguishing true future releases from very recent ones. Falls back to the most recent releases when no upcoming ones exist.

**Estimated cost:** Metered

| Field | Type | Required | Description |
|-------|------|----------|-------------|
| `label_or_distributor` | string | Yes | Name of the record label or distributor (e.g. 'STMPD RCRDS', 'Interscope Records'). |
| `limit` | integer | No | Maximum number of releases to return (1-50). |
| `only_upcoming` | boolean | No | When true, return only future releases (is_upcoming=true), excluding recent ones. |

```bash
curl -X POST https://api.paywithlocus.com/api/wrapped/parse-spotify-com-api-3b15ebb3/get_upcoming_releases \
  -H "Authorization: Bearer YOUR_LOCUS_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"label_or_distributor":"<string>","limit":"<integer>","only_upcoming":"<boolean>"}'
```

### search

Full-text search across Spotify's music catalog. Returns tracks, artists, albums, playlists, and podcasts matching the query. Results can be filtered by content type and paginated via offset. Each result category returns up to `limit` items per request.

**Estimated cost:** Metered

| Field | Type | Required | Description |
|-------|------|----------|-------------|
| `limit` | integer | No | Maximum number of results per content type (1-50). |
| `offset` | integer | No | Offset for pagination within each content type. |
| `query` | string | Yes | Search query string (artist name, track title, album, etc.). |
| `type` | string | No | Filter results to a specific content type. Omitted or 'all' returns all types. |

```bash
curl -X POST https://api.paywithlocus.com/api/wrapped/parse-spotify-com-api-3b15ebb3/search \
  -H "Authorization: Bearer YOUR_LOCUS_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"limit":"<integer>","offset":"<integer>","query":"<string>","type":"<string>"}'
```
