# spotify-url-info

> Fetch Spotify track, album, and playlist metadata from share URLs without an API key.

Latest version **3.3.3** (published 2026-08-20) · MIT license · 0 weekly downloads

## Install

```sh
npm install spotify-url-info
pnpm add spotify-url-info
yarn add spotify-url-info
bun add spotify-url-info
```

## Health

**Score 65/100 (B)** — status: active.

Positive: has types; no vulnerabilities; recently updated; high maintenance score; high quality score.

Warnings: low downloads; no esm support.

## Facts

| | |
|---|---|
| Version | 3.3.3 |
| Published | 2026-08-20 |
| First published | 2018-06-27 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | bundled |
| Module format | CommonJS |
| Node | >= 12 |
| Dependencies | 2 |
| Unpacked size | 13.7 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 92 |
| Author | Karl Sander |
| Maintainers | kikobeats, kall |
| Keywords | album, embed, metadata, music, oembed, playlist, preview, spotify, track, url |

## Links

- npm: https://www.npmjs.com/package/spotify-url-info
- Repository: https://github.com/microlinkhq/spotify-url-info
- Issues: https://github.com/microlinkhq/spotify-url-info/issues
- npm.io page: https://npm.io/package/spotify-url-info

## Dependencies (2)

- [himalaya](https://npm.io/package/himalaya.md) ~1.1.0
- [spotify-uri](https://npm.io/package/spotify-uri.md) ~4.1.0

## Alternatives

- [base64url](https://npm.io/package/base64url.md) — 6.1M weekly downloads
- [get-installed-path](https://npm.io/package/get-installed-path.md) — 502.9K weekly downloads
- [@uppy/url](https://npm.io/package/@uppy/url.md) — 185.8K weekly downloads
- [@d3fc/d3fc-shape](https://npm.io/package/@d3fc/d3fc-shape.md) — 16.2K weekly downloads
- [localizer](https://npm.io/package/localizer.md) — 226 weekly downloads

## Recent versions

- 3.3.3 (latest) — 2026-08-20
- 3.2.0-0 (prerelease) — 2022-12-29
- 3.3.2 — 2026-08-05
- 3.3.1 — 2026-06-18
- 3.3.0 — 2026-03-04
- 3.2.18 — 2024-11-17
- 3.2.17 — 2024-09-30
- 3.2.16 — 2024-07-06
- 3.2.15 — 2024-05-24
- 3.2.14 — 2024-05-07
- 3.2.13 — 2024-02-08
- 3.2.12 — 2024-01-31
- 3.2.11 — 2024-01-31
- 3.2.10 — 2023-12-06
- 3.2.9 — 2023-10-23
- … 48 more at https://npm.io/package/spotify-url-info/versions

## README

<div align="center">
  <img src="https://github.com/microlinkhq/cdn/raw/master/dist/logo/banner.png#gh-light-mode-only" alt="microlink logo">
  <img src="https://github.com/microlinkhq/cdn/raw/master/dist/logo/banner-dark.png#gh-dark-mode-only" alt="microlink logo">
  <br>
  <br>
</div>

![Last version](https://img.shields.io/github/tag/microlinkhq/spotify-url-info.svg?style=flat-square)
[![Coverage Status](https://img.shields.io/coveralls/microlinkhq/spotify-url-info.svg?style=flat-square)](https://coveralls.io/github/microlinkhq/spotify.url-info)
[![NPM Status](https://img.shields.io/npm/dm/spotify-url-info.svg?style=flat-square)](https://www.npmjs.org/package/spotify-url-info)

> Get metadata from Spotify URLs.

## Install

```bash
npm install spotify-url-info
```

## Usage

In order to use the library, you have to provide the fetch agent to use:

```js
const fetch = require('isomorphic-unfetch')
const { getData, getPreview, getTracks, getDetails } =
  require('spotify-url-info')(fetch)
```

There are four functions:

- **getData**<br/>
  Provides the full available data, in a shape that is very similar to [what the spotify API returns](https://developer.spotify.com/documentation/web-api/reference/object-model/).

- **getPreview** <br/>
  Always returns the same fields for different types of resources (album, artist, playlist, track). The preview track is the first in the Album, Playlist, etc.

- **getTracks** <br/>
  Returns array with tracks. This data is passed on straight from spotify, so the shape could change.Only the first 100 tracks will be returned.

- **getDetails** <br/>
  Returns both the preview and tracks. Should be used if you require information from both of them so that only one request is made.

All the methods receive a Spotify URL (play. or open.) as first argument:

```js
getPreview('https://open.spotify.com/track/5nTtCOCds6I0PHMNtqelas').then(data =>
  console.log(data)
)
```

Additionally, you can provide fetch agent options as second argument:

```js
getPreview('https://open.spotify.com/track/5nTtCOCds6I0PHMNtqelas', {
  headers: {
    'user-agent': 'googlebot'
  }
}).then(data => console.log(data))
```

It returns back the information related to the Spotify URL:

```json
{
  "title": "Immaterial",
  "type": "track",
  "track": "Immaterial",
  "artist": "SOPHIE",
  "image": "https://i.scdn.co/image/d6f496a6708d22a2f867e5acb84afb0eb0b07bc1",
  "audio": "https://p.scdn.co/mp3-preview/6be8eb12ff18ae09b7a6d38ff1e5327fd128a74e?cid=162b7dc01f3a4a2ca32ed3cec83d1e02",
  "link": "https://open.spotify.com/track/5nTtCOCds6I0PHMNtqelas",
  "embed": "https://embed.spotify.com/?uri=spotify:track:5nTtCOCds6I0PHMNtqelas",
  "date": "2018-06-15T00:00:00.000Z",
  "description": "description of a podcast episode"
}
```

When a field can't be retrieved, the value will be `undefined`.

There are no guarantees about the shape of this data, because it varies with different media and scraping methods. Handle it carefully.

## License

**spotify-url-info** © [microlink.io](https://microlink.io), released under the [MIT](https://github.com/microlinkhq/spotify-url-info/blob/master/LICENSE.md) License.<br>
Authored by [Karl Sander](https://github.com/karlsander) and maintained by [Kiko Beats](https://kikobeats.com) with help from [contributors](https://github.com/microlinkhq/spotify-url-info/contributors).

> [microlink.io](https://microlink.io) · GitHub [microlink.io](https://github.com/microlinkhq) · X [@microlinkhq](https://x.com/microlinkhq)

---
_Source: https://npm.io/package/spotify-url-info · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
