Requires \$SPOTIFY_ACCESS_TOKEN in the environment, or \$SPOTIFY_ID and \$SPOTIFY_SECRET, in which case it'll call spotify_access_token.sh to generate a new token for the duration of this script
API endpoints you can query with this code:
If accessing API endpoints for private user data that require authorized tokens, such as /v1/me/... , then you'll need to exportSPOTIFY_PRIVATE=1 before generating a token with interactive authorization pop-up due to quirks in the Spotify API
For efficiency to avoid regenerating API tokens for every script call, do the following once an hour in your shell: