{"id":13410449,"url":"https://github.com/zmb3/spotify","last_synced_at":"2025-05-13T19:06:29.023Z","repository":{"id":26391257,"uuid":"29840798","full_name":"zmb3/spotify","owner":"zmb3","description":"A Go wrapper for the Spotify Web API","archived":false,"fork":false,"pushed_at":"2025-04-16T21:50:00.000Z","size":586,"stargazers_count":1469,"open_issues_count":39,"forks_count":302,"subscribers_count":20,"default_branch":"master","last_synced_at":"2025-04-28T00:45:05.542Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/zmb3.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":"CODE_OF_CONDUCT.md","threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2015-01-26T02:06:19.000Z","updated_at":"2025-04-22T18:26:16.000Z","dependencies_parsed_at":"2023-10-12T17:43:15.263Z","dependency_job_id":"1f65b1b8-d263-4f69-8766-c6c8ba9f5295","html_url":"https://github.com/zmb3/spotify","commit_stats":{"total_commits":281,"total_committers":76,"mean_commits":"3.6973684210526314","dds":0.6832740213523132,"last_synced_commit":"5c1be564a0239900a232443c55d5ceb1b9bc1561"},"previous_names":[],"tags_count":18,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zmb3%2Fspotify","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zmb3%2Fspotify/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zmb3%2Fspotify/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zmb3%2Fspotify/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/zmb3","download_url":"https://codeload.github.com/zmb3/spotify/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":254010810,"owners_count":21998993,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-07-30T20:01:06.994Z","updated_at":"2025-05-13T19:06:29.005Z","avatar_url":"https://github.com/zmb3.png","language":"Go","readme":"\nSpotify\n=======\n\n[![GoDoc](https://godoc.org/github.com/zmb3/spotify?status.svg)](http://godoc.org/github.com/zmb3/spotify)\n\nThis is a Go wrapper for working with Spotify's\n[Web API](https://developer.spotify.com/web-api/).\n\nIt aims to support every task listed in the Web API Endpoint Reference,\nlocated [here](https://developer.spotify.com/web-api/endpoint-reference/).\n\nBy using this library you agree to Spotify's\n[Developer Terms of Use](https://developer.spotify.com/developer-terms-of-use/).\n\n## Installation\n\nTo install the library, simply\n\n`go get github.com/zmb3/spotify/v2`\n\n## Authentication\n\nSpotify uses OAuth2 for authentication and authorization.  \nAs of May 29, 2017 _all_ Web API endpoints require an access token.\n\nYou can authenticate using a client credentials flow, but this does not provide\nany authorization to access a user's private data.  For most use cases, you'll\nwant to use the authorization code flow.  This package includes an `Authenticator`\ntype to handle the details for you.\n\nStart by registering your application at the following page:\n\nhttps://developer.spotify.com/my-applications/.\n\nYou'll get a __client ID__ and __secret key__ for your application.  An easy way to\nprovide this data to your application is to set the SPOTIFY_ID and SPOTIFY_SECRET\nenvironment variables.  If you choose not to use environment variables, you can\nprovide this data manually.\n\n\n````Go\n// the redirect URL must be an exact match of a URL you've registered for your application\n// scopes determine which permissions the user is prompted to authorize\nauth := spotifyauth.New(spotifyauth.WithRedirectURL(redirectURL), spotifyauth.WithScopes(spotifyauth.ScopeUserReadPrivate))\n\n// get the user to this URL - how you do that is up to you\n// you should specify a unique state string to identify the session\nurl := auth.AuthURL(state)\n\n// the user will eventually be redirected back to your redirect URL\n// typically you'll have a handler set up like the following:\nfunc redirectHandler(w http.ResponseWriter, r *http.Request) {\n      // use the same state string here that you used to generate the URL\n      token, err := auth.Token(r.Context(), state, r)\n      if err != nil {\n            http.Error(w, \"Couldn't get token\", http.StatusNotFound)\n            return\n      }\n      // create a client using the specified token\n      client := spotify.New(auth.Client(r.Context(), token))\n\n      // the client can now be used to make authenticated requests\n}\n````\n\nYou may find the following resources useful:\n\n1. Spotify's Web API Authorization Guide:\nhttps://developer.spotify.com/web-api/authorization-guide/\n\n2. Go's OAuth2 package:\nhttps://godoc.org/golang.org/x/oauth2\n\n\n## Helpful Hints\n\n### Automatic Retries\n\nThe API will throttle your requests if you are sending them too rapidly.\nThe client can be configured to wait and re-attempt the request.\nTo enable this, pass the `WithRetry(true)` option to `New` when creating the client.\n\nFor more information, see Spotify [rate-limits](https://developer.spotify.com/documentation/web-api/concepts/rate-limits).\n\n## API Examples\n\nExamples of the API can be found in the [examples](examples) directory.\n\nYou may find tools such as [Spotify's Web API Console](https://developer.spotify.com/web-api/console/)\nor [Rapid API](https://rapidapi.com/package/SpotifyPublicAPI/functions?utm_source=SpotifyGitHub\u0026utm_medium=button\u0026utm_content=Vendor_GitHub)\nvaluable for experimenting with the API.\n\n### Missing data in responses\n\nIt's extremely common that when there is no market information available in your\nrequest, that the Spotify API will simply return null for details about a track\nor episode.\n\nThis typically occurs when you are just using an application's auth token, and\naren't impersonating a user via OAuth2. As when you are using a token associated\nwith a user, the user's market seems to be extracted from their profile and\nused when producing the response.\n","funding_links":[],"categories":["Go","Uncategorized"],"sub_categories":["Uncategorized"],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fzmb3%2Fspotify","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fzmb3%2Fspotify","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fzmb3%2Fspotify/lists"}