Skip to content

API

Spotisub exposes a small REST API under http://<host>:5183/api/v1, plus interactive Swagger documentation generated by flask-restx.

Shape of every response

{"status": "ok", "message": "Importing a random playlist"}

status is ok or ko. Import/generate endpoints answer immediately: they start a background job and return, they do not wait for the import to finish. Watch progress in System → Tasks or Logs.

Authentication

The REST API is not behind the web login in this version

The endpoints can be called without a session. Keep Spotisub on a trusted network, or put authentication in front of it at the reverse proxy. The single exception in design intent is /utils/healthcheck, which is public on purpose for container healthchecks.

Automation examples

Nightly full reimport from cron:

curl -fsS http://127.0.0.1:5183/api/v1/import/saved_tracks
curl -fsS http://127.0.0.1:5183/api/v1/import/user_playlist

Monitoring:

curl -fsS http://127.0.0.1:5183/api/v1/utils/healthcheck   # Ok!