Tristan Peralta

Libraries 2026

spotc3

A Spotify Web API client for C3, sign-in and tokens included.

spotc3 wraps the current Spotify Web API in a plain C3 API. It sends HTTP through httpc3 and uses C3’s standard library for JSON; it has no UI code, so any application can use it.

Sign-in and tokens

Authorization Code with PKCE. A small callback server on 127.0.0.1 uses a free port, or a fixed one when the application’s redirect URI was registered with a port. Tokens refresh automatically, with a save and load interface that keeps a session between runs. When Spotify’s six-month refresh limit expires, the library reports REAUTH_REQUIRED instead of retrying forever.

What it covers

The player, devices, the queue, and play history; the library, saved items, and followed artists; playlists and their items; search; single-track, album, artist, episode, and show lookups; the profile and top items. Calls that take lists are split into Spotify’s batch sizes — 40 for the library, 100 for a playlist — so the caller passes the whole list.

Results are typed structs: Track, Album, Artist, Episode, Show, Playlist, PlaybackState, Device, and the rest. Fields Spotify may omit are represented explicitly ("", 0, or a Maybe), and the raw JSON stays available when a new field arrives before the struct does.

ISRC lookup

Spotify gives every full track an ISRC. spotc3 has a helper to find a track by that code, which is how a track from one service can be matched to the same recording elsewhere — including the MusicBrainz lookup in musicbrainzc3.

Status

0.6.0. The client is used by Glaze’s Spotify integration; the roadmap tracks the remaining endpoints.