What you get#
Onekey exposes Spotify as 10 endpoints behind one API key: 5 endpoints return one record (data is an object) and 5 endpoints return a list (data is an array). Every answer uses the same envelope (success, data, metadata, error), the cost is reported in metadata.credits_charged, and fields are mapped onto the unified schema so the code you write for Spotify also works for the rest of the music & audio category.
Endpoints#
| Endpoint | What it does | Parameters | Credits | Status |
|---|---|---|---|---|
album | Spotify album by id. | id* | 1 | beta |
artist | Spotify artist by id. | id* | 1 | beta |
artist_top_tracks | Top tracks of a Spotify artist (US). | id* | 5 | beta |
new_releases | New album releases on Spotify. | - | 5 | beta |
oembed | Spotify embed metadata for a track/album/playlist/artist/episode/show URL (oEmbed). | url* | 1 | stable |
podcast | A Spotify podcast (show): title, publisher, description, cover, rating where available. | id, url | 2 | beta may need a pack |
podcast_episodes | Episodes of a Spotify podcast, newest first. | id, url, cursor | 2 | beta may need a pack |
search_artists | Search Spotify artists. | q* | 5 | beta |
search_tracks | Search Spotify tracks. | q* | 1 | beta |
track | Spotify track by id. | id* | 1 | beta |
A * marks a required parameter. Each endpoint name links to its reference page with the full parameter table, caching window and a recorded response.
Make a request#
This calls spotify.oembed (1 credit, stable). Replace YOUR_API_KEY with your key; sign up, no card. 1,000 free credits cover the open-platform endpoints. Hard-to-reach platforms (X, TikTok, Instagram, Reddit, and others marked on their page) need a verified email and a purchased pack.
curl "https://api.onekey.dev/v1/spotify/oembed?url=https%3A%2F%2Fopen.spotify.com%2Ftrack%2F4uLU6hMCjMI75M1A2tKUQC" \
-H "x-api-key: YOUR_API_KEY"Fields you get back#
These unified fields come back from Spotify, with the same names as on every other platform. The count is how many of its 10 mapped endpoints return the field; a field the source lacks is null, never missing. 4 platform-specific fields (ext.<name>) come on top, documented on each endpoint page.
| Field | Type | Endpoints |
|---|---|---|
media.thumbnailUrl | URL | 9 |
author.displayName | string | 6 |
content.title | string | 5 |
entity.id | string | 5 |
entity.name | string | 5 |
entity.stats.popularity | number | 5 |
entity.url | URL | 5 |
content.id | string | 4 |
content.url | URL | 4 |
entity.stats.itemCount | integer | 3 |
media.previewUrl | URL | 3 |
entity.category | string | 2 |
entity.releaseDate | ISO 8601 date | 2 |
entity.stats.followers | integer | 2 |
content.createdAt | ISO 8601 date | 1 |
content.text | string | 1 |
entity.description | string | 1 |
entity.language | string | 1 |
media.embedUrl | URL | 1 |
The full schema is in Unified schema.
Pricing#
Spotify calls cost 1 to 5 credits, flat per endpoint. Free when served from cache (0.2 credit for a cached response over 100 KB). Invalid, failed or not-found calls are not charged. See pricing for credit packs.