{"id":17767071,"url":"https://github.com/oliverfindl/spotify-current-track","last_synced_at":"2025-04-01T14:18:27.555Z","repository":{"id":57367826,"uuid":"141841905","full_name":"oliverfindl/spotify-current-track","owner":"oliverfindl","description":"Simple wrapper class for obtaining current track from Spotify Web API.","archived":false,"fork":false,"pushed_at":"2019-03-02T13:49:51.000Z","size":8,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-03-18T14:07:02.339Z","etag":null,"topics":["api","current","javascript","spotify","spotify-current-track","track","web","wrapper"],"latest_commit_sha":null,"homepage":"","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/oliverfindl.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2018-07-21T19:52:46.000Z","updated_at":"2019-07-07T07:45:41.000Z","dependencies_parsed_at":"2022-08-23T19:30:53.727Z","dependency_job_id":null,"html_url":"https://github.com/oliverfindl/spotify-current-track","commit_stats":null,"previous_names":[],"tags_count":7,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/oliverfindl%2Fspotify-current-track","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/oliverfindl%2Fspotify-current-track/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/oliverfindl%2Fspotify-current-track/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/oliverfindl%2Fspotify-current-track/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/oliverfindl","download_url":"https://codeload.github.com/oliverfindl/spotify-current-track/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":246651559,"owners_count":20811994,"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":["api","current","javascript","spotify","spotify-current-track","track","web","wrapper"],"created_at":"2024-10-26T20:42:30.085Z","updated_at":"2025-04-01T14:18:27.535Z","avatar_url":"https://github.com/oliverfindl.png","language":"JavaScript","funding_links":["https://paypal.me/oliverfindl"],"categories":[],"sub_categories":[],"readme":"# spotify-current-track\r\n\r\n[![npm](https://img.shields.io/npm/v/spotify-current-track.svg?style=flat)](https://www.npmjs.com/package/spotify-current-track)\r\n[![npm](https://img.shields.io/npm/dt/spotify-current-track.svg?style=flat)](https://www.npmjs.com/package/spotify-current-track)\r\n[![npm](https://img.shields.io/npm/l/spotify-current-track.svg?style=flat)](https://www.npmjs.com/package/spotify-current-track)\r\n[![paypal](https://img.shields.io/badge/donate-paypal-blue.svg?colorB=0070ba\u0026style=flat)](https://paypal.me/oliverfindl)\r\n\r\nSimple wrapper class for obtaining current track from [Spotify](https://www.spotify.com/) Web API.\r\n\r\n---\r\n\r\n## Install\r\n\r\nVia [npm](https://npmjs.com/) [[package](https://www.npmjs.com/package/spotify-current-track)]:\r\n```bash\r\n$ npm install spotify-current-track\r\n```\r\n\r\nVia [yarn](https://yarnpkg.com/en/) [[package](https://yarnpkg.com/en/package/spotify-current-track)]:\r\n```bash\r\n$ yarn add spotify-current-track\r\n```\r\n\r\n## Usage\r\n\r\n```javascript\r\n// require lib\r\nconst SpotifyAPI = require(\"spotify-current-track\");\r\n\r\n// init lib\r\nconst spotify = new SpotifyAPI({\r\n\t// [required] fill in your spotify credentials\r\n\tclientId: \"\u003cCLIENT_ID\u003e\",\r\n\tclientSecret: \"\u003cCLIENT_SECRET\u003e\",\r\n\trefreshToken: \"\u003cREFRESH_TOKEN\u003e\",\r\n\t// [optional] override default request timeout, defaults to 0 (no timeout)\r\n\t_timeout: 1000 // milliseconds\r\n});\r\n\r\n// [optional] set market\r\nspotify.market = \"SK\";\r\n\r\n// get current track\r\nspotify.currentTrack.then(track =\u003e {\r\n\t// ...\r\n}).catch(console.error);\r\n```\r\n\r\n`clientId` and `clientSecret` can be obtained from your own [Spotify App](https://developer.spotify.com/documentation/general/guides/app-settings/).\r\n\r\n`refreshToken` can be obtained by [Authorization Code Flow](https://developer.spotify.com/documentation/general/guides/authorization-guide/#authorization-code-flow) with `user-read-currently-playing` and/or `user-read-playback-state` scope.\r\n\r\nSet `market` if you want to apply [Track Relinking](https://developer.spotify.com/documentation/general/guides/track-relinking-guide/).\r\n\r\nExample `track` object can be found [here](https://developer.spotify.com/documentation/web-api/reference/player/get-the-users-currently-playing-track/).\r\n\r\n---\r\n\r\n## License\r\n\r\n[MIT](http://opensource.org/licenses/MIT)\r\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Foliverfindl%2Fspotify-current-track","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Foliverfindl%2Fspotify-current-track","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Foliverfindl%2Fspotify-current-track/lists"}