# Spotify API
> Spotify music and podcast metadata as an API — no login, no OAuth. Resolve any Spotify track, album, artist or playlist by its id, spotify: URI or open.spotify.com URL and get clean JSON: names, the canonical Spotify ids and URIs, cover art, release dates, durations, explicit flags and 30-second audio previews. Albums come back with their full track list, artists with their top tracks, and playlists with their tracks and owner. A universal resolve endpoint auto-detects the entity type from any Spotify link, and an oEmbed endpoint returns the title, thumbnail and embeddable player HTML for any Spotify URL. Live data straight from Spotify's public embed. Ideal for enriching your catalogue with Spotify ids, building "listen on Spotify" links, previewing tracks, and matching music across services. 6 data endpoints. Authenticated with an x-oanor-key; fair-use rate limits per plan.

## Authentication
All requests require your oanor API key in the `x-oanor-key` header. Get one at https://www.oanor.com/developer/keys.

```bash
curl -H "x-oanor-key: oanor_live_…" "https://api.oanor.com/spotify-api/..."
```

## Pricing
- **Free** (Free) — 1,500 calls/Mo, 5 req/s
- **Starter** ($13/Mo) — 45,000 calls/Mo, 15 req/s
- **Pro** ($49/Mo) — 280,000 calls/Mo, 30 req/s
- **Mega** ($149/Mo) — 1,300,000 calls/Mo, 80 req/s

## Endpoints

### Lookup

#### `GET /v1/album` — Album with track list

**Parameters:**
- `id` (query, required, string) — Spotify album id, URI or URL Example: `4aawyAB9vmqN3uQ7FjRGTy`

**Example:**
```bash
curl -H "x-oanor-key: $KEY" \
  "https://api.oanor.com/spotify-api/v1/album?id=4aawyAB9vmqN3uQ7FjRGTy"
```

**Response:**
```json
{
    "data": {
        "album": {
            "id": "4aawyAB9vmqN3uQ7FjRGTy",
            "uri": "spotify:album:4aawyAB9vmqN3uQ7FjRGTy",
            "url": "https://open.spotify.com/album/4aawyAB9vmqN3uQ7FjRGTy",
            "name": "Global Warming",
            "type": "album",
            "tracks": [
                {
                    "id": "6OmhkSOpvYBokMKQxpIGx2",
                    "title": "Global Warming (feat. Sensato)",
                    "artists": [
                        "Pitbull",
                        "Sensato"
                    ],
                    "explicit": true,
                    "playable": true,
                    "subtitle": "Pitbull, Sensato",
                    "has_video": false,
                    "duration_ms": 85400,
                    "audio_preview": "https://p.scdn.co/mp3-preview/81b57845f672fa5a0af749489e311ffb9fd552fe"
                },
                {
                    "id": "2iblMMIgSznA464mNov7A8",
                    "title": "Don't Stop the Party (feat. TJR)",
                    "artists": [
                        "Pitbull",
                        "TJR"
                    ],
                    "explicit": false,
                    "playable": true,
                    "subtitle": "Pitbull, TJR",
                    "has_video": false,
                    "duration_ms": 206120,
                    "audio_preview": "https://p.scdn.co/mp3-preview/4791938e88ca063cb96a5fa8a7a2fad53d0c835e"
                },
   
…(truncated, see openapi.json for full schema)
```

#### `GET /v1/artist` — Artist with top tracks

**Parameters:**
- `id` (query, required, string) — Spotify artist id, URI or URL Example: `0OdUWJ0sBjDrqHygGUXeCF`

**Example:**
```bash
curl -H "x-oanor-key: $KEY" \
  "https://api.oanor.com/spotify-api/v1/artist?id=0OdUWJ0sBjDrqHygGUXeCF"
```

**Response:**
```json
{
    "data": {
        "artist": {
            "id": "0OdUWJ0sBjDrqHygGUXeCF",
            "uri": "spotify:artist:0OdUWJ0sBjDrqHygGUXeCF",
            "url": "https://open.spotify.com/artist/0OdUWJ0sBjDrqHygGUXeCF",
            "name": "Band of Horses",
            "type": "artist",
            "explicit": false,
            "subtitle": "Top tracks",
            "cover_art": "https://image-cdn-ak.spotifycdn.com/image/ab676161000051742cb57b092374b2f975ee9adc",
            "top_tracks": [
                {
                    "id": "5lRzWDEe7UuedU2QPsFg0K",
                    "title": "The Funeral",
                    "artists": [
                        "Band of Horses"
                    ],
                    "explicit": false,
                    "playable": true,
                    "subtitle": "Band of Horses",
                    "has_video": false,
                    "duration_ms": 322173,
                    "audio_preview": "https://p.scdn.co/mp3-preview/a3d4810ce9c8ea8771bf5d2de93cadc44ec1ee77"
                },
                {
                    "id": "2IvNxLl01CTAfCOA103Tgx",
                    "title": "No One's Gonna Love You",
                    "artists": [
                        "Band of Horses"
                    ],
                    "explicit": false,
                    "playable": true,
                    "subtitle": "Band of Horses",
                    "has_video": false,
                    "duration_ms": 217333,
                    "aud
…(truncated, see openapi.json for full schema)
```

#### `GET /v1/playlist` — Playlist with tracks

**Parameters:**
- `id` (query, required, string) — Spotify playlist id, URI or URL Example: `37i9dQZF1DXcBWIGoYBM5M`

**Example:**
```bash
curl -H "x-oanor-key: $KEY" \
  "https://api.oanor.com/spotify-api/v1/playlist?id=37i9dQZF1DXcBWIGoYBM5M"
```

**Response:**
```json
{
    "data": {
        "playlist": {
            "id": "37i9dQZF1DXcBWIGoYBM5M",
            "uri": "spotify:playlist:37i9dQZF1DXcBWIGoYBM5M",
            "url": "https://open.spotify.com/playlist/37i9dQZF1DXcBWIGoYBM5M",
            "name": "Today’s Top Hits",
            "type": "playlist",
            "owners": [
                "Spotify"
            ],
            "tracks": [
                {
                    "id": "20jbSiX29FDX4oQxBXyUEi",
                    "title": "hate that i made you love me",
                    "artists": [
                        "Ariana Grande"
                    ],
                    "explicit": false,
                    "playable": true,
                    "subtitle": "Ariana Grande",
                    "has_video": false,
                    "duration_ms": 197949,
                    "audio_preview": "https://p.scdn.co/mp3-preview/9fb8e09c9facc2d9443b6e57ae36d47bf83c01b8"
                },
                {
                    "id": "5uPaqMMt59KGrdKIitDRqa",
                    "title": "I Knew It, I Knew You",
                    "artists": [
                        "Taylor Swift"
                    ],
                    "explicit": false,
                    "playable": true,
                    "subtitle": "Taylor Swift",
                    "has_video": false,
                    "duration_ms": 178186,
                    "audio_preview": "https://p.scdn.co/mp3-preview/d21ded2a54dde5461f908b1bf26f1b4bae5ac139"
            
…(truncated, see openapi.json for full schema)
```

#### `GET /v1/track` — Track by id/uri/url

**Parameters:**
- `id` (query, required, string) — Spotify track id, spotify: URI or open.spotify.com URL Example: `4uLU6hMCjMI75M1A2tKUQC`

**Example:**
```bash
curl -H "x-oanor-key: $KEY" \
  "https://api.oanor.com/spotify-api/v1/track?id=4uLU6hMCjMI75M1A2tKUQC"
```

**Response:**
```json
{
    "data": {
        "track": {
            "id": "4uLU6hMCjMI75M1A2tKUQC",
            "uri": "spotify:track:4uLU6hMCjMI75M1A2tKUQC",
            "url": "https://open.spotify.com/track/4uLU6hMCjMI75M1A2tKUQC",
            "name": "Never Gonna Give You Up",
            "type": "track",
            "artists": [
                "Rick Astley"
            ],
            "explicit": false,
            "cover_art": "https://image-cdn-fa.spotifycdn.com/image/ab67616d00001e0215ebbedaacef61af244262a8",
            "duration_ms": 213573,
            "release_date": "1987-11-12T00:00:00Z",
            "audio_preview": "https://p.scdn.co/mp3-preview/b4c682084c3fd05538726d0a126b7e14b6e92c83",
            "related_artist_uri": "spotify:artist:0gxyHStUsqpMadRV0Di1Qt"
        }
    },
    "meta": {
        "timestamp": "2026-06-07T16:47:10.353Z",
        "request_id": "3e0ffe30-4fd2-4383-8d12-c7039014a226"
    },
    "status": "ok",
    "message": "Track retrieved successfully",
    "success": true
}
```

### Resolve

#### `GET /v1/oembed` — oEmbed for a Spotify URL

**Parameters:**
- `url` (query, required, string) — Any Spotify URL Example: `https://open.spotify.com/album/4aawyAB9vmqN3uQ7FjRGTy`

**Example:**
```bash
curl -H "x-oanor-key: $KEY" \
  "https://api.oanor.com/spotify-api/v1/oembed?url=https%3A%2F%2Fopen.spotify.com%2Falbum%2F4aawyAB9vmqN3uQ7FjRGTy"
```

**Response:**
```json
{
    "data": {
        "oembed": {
            "html": "<iframe style=\"border-radius: 12px\" width=\"100%\" height=\"352\" title=\"Spotify Embed: Global Warming\" frameborder=\"0\" allowfullscreen allow=\"autoplay; clipboard-write; encrypted-media; fullscreen; picture-in-picture\" loading=\"lazy\" src=\"https://open.spotify.com/embed/album/4aawyAB9vmqN3uQ7FjRGTy?utm_source=oembed\"></iframe>",
            "type": "rich",
            "title": "Global Warming",
            "width": 456,
            "height": 352,
            "provider": "Spotify",
            "thumbnail_url": "https://image-cdn-fa.spotifycdn.com/image/ab67616d00001e022c5b24ecfa39523a75c993c4"
        }
    },
    "meta": {
        "timestamp": "2026-06-07T16:47:10.706Z",
        "request_id": "cfe8c797-a6e3-423a-9b33-ded6dd58b866"
    },
    "status": "ok",
    "message": "oEmbed retrieved successfully",
    "success": true
}
```

#### `GET /v1/resolve` — Resolve any Spotify link

**Parameters:**
- `url` (query, required, string) — Any Spotify URL, URI or id (type auto-detected) Example: `https://open.spotify.com/track/4uLU6hMCjMI75M1A2tKUQC`
- `type` (query, optional, string) — Type hint for a bare id (track, album, artist, playlist) Example: `track`

**Example:**
```bash
curl -H "x-oanor-key: $KEY" \
  "https://api.oanor.com/spotify-api/v1/resolve?url=https%3A%2F%2Fopen.spotify.com%2Ftrack%2F4uLU6hMCjMI75M1A2tKUQC&type=track"
```

**Response:**
```json
{
    "data": {
        "entity": {
            "id": "4uLU6hMCjMI75M1A2tKUQC",
            "uri": "spotify:track:4uLU6hMCjMI75M1A2tKUQC",
            "url": "https://open.spotify.com/track/4uLU6hMCjMI75M1A2tKUQC",
            "name": "Never Gonna Give You Up",
            "type": "track",
            "artists": [
                "Rick Astley"
            ],
            "explicit": false,
            "cover_art": "https://image-cdn-fa.spotifycdn.com/image/ab67616d00001e0215ebbedaacef61af244262a8",
            "duration_ms": 213573,
            "release_date": "1987-11-12T00:00:00Z",
            "audio_preview": "https://p.scdn.co/mp3-preview/b4c682084c3fd05538726d0a126b7e14b6e92c83",
            "related_artist_uri": "spotify:artist:0gxyHStUsqpMadRV0Di1Qt"
        }
    },
    "meta": {
        "timestamp": "2026-06-07T16:47:10.886Z",
        "request_id": "df694b6e-bb81-489c-948c-00a9715b72cf"
    },
    "status": "ok",
    "message": "Entity resolved successfully",
    "success": true
}
```

### Meta

#### `GET /v1/meta` — Spec

**Example:**
```bash
curl -H "x-oanor-key: $KEY" \
  "https://api.oanor.com/spotify-api/v1/meta"
```

**Response:**
```json
{
    "data": {
        "service": "spotify-api",
        "endpoints": {
            "GET /v1/meta": "This document.",
            "GET /v1/album": "Album with its track list.",
            "GET /v1/track": "Track by id/uri/url.",
            "GET /v1/artist": "Artist with top tracks.",
            "GET /v1/oembed": "oEmbed (title, thumbnail, embed html) for any Spotify url.",
            "GET /v1/resolve": "Any Spotify link → entity (auto-detect type).",
            "GET /v1/playlist": "Playlist with its tracks."
        },
        "description": "Spotify metadata: track, album (with tracks), artist (with top tracks) and playlist (with tracks) lookups by Spotify id, uri or url, plus a universal resolver and oEmbed — real live data, no login."
    },
    "meta": {
        "timestamp": "2026-06-07T16:47:10.987Z",
        "request_id": "39fa83d7-04ef-4412-90d7-111e89cbd21a"
    },
    "status": "ok",
    "message": "Meta",
    "success": true
}
```


---
Marketplace page: https://www.oanor.com/api/spotify-api
OpenAPI spec: https://www.oanor.com/api/spotify-api/openapi.json
