API documentation

Spotify currently playing API

Returns the current listening activity shown on the Soundtrack page, including the active track when available and a short list of recently played tracks.

Endpoints

  • GET https://www.abhishekchoudhury.com/api/spotify/currently-playing

    Returns current playback and recent track history when Spotify data is available.

  • GET https://www.abhishekchoudhury.com/api/spotify/currently-playing/spec

    Machine-readable OpenAPI document for automated discovery and tooling.

  • GET https://www.abhishekchoudhury.com/api/spotify/currently-playing/status

    Non-sensitive health metadata for service discovery.

Operational notes

  • The endpoint is public and read-only.
  • Responses are always JSON and return Cache-Control: no-store.
  • If Spotify credentials are missing or authorization expires, the payload uses a non-ok status field instead of changing the route shape.

Response states

ok

Live data is available and the response includes nowPlaying, recentTracks, and fetchedAt.

missing_config

Spotify credentials are not fully configured on the server.

reauth_required

Stored Spotify authorization is no longer valid and needs to be refreshed.

error

Spotify was temporarily unavailable or the token refresh flow failed.