{"id":20333050,"url":"https://github.com/jaebradley/spotify-application-client","last_synced_at":"2025-04-11T21:33:06.522Z","repository":{"id":57153819,"uuid":"82319871","full_name":"jaebradley/spotify-application-client","owner":"jaebradley","description":"JavaScript Client for the Spotify Application on MacOS","archived":false,"fork":false,"pushed_at":"2017-08-31T19:31:14.000Z","size":42,"stargazers_count":5,"open_issues_count":3,"forks_count":1,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-03-25T17:46:44.628Z","etag":null,"topics":["applescript","macos","npm","osascript","spotify"],"latest_commit_sha":null,"homepage":"","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/jaebradley.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2017-02-17T17:10:51.000Z","updated_at":"2019-07-08T23:14:43.000Z","dependencies_parsed_at":"2022-09-06T19:21:40.701Z","dependency_job_id":null,"html_url":"https://github.com/jaebradley/spotify-application-client","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jaebradley%2Fspotify-application-client","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jaebradley%2Fspotify-application-client/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jaebradley%2Fspotify-application-client/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jaebradley%2Fspotify-application-client/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/jaebradley","download_url":"https://codeload.github.com/jaebradley/spotify-application-client/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248027142,"owners_count":21035587,"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":["applescript","macos","npm","osascript","spotify"],"created_at":"2024-11-14T20:29:10.507Z","updated_at":"2025-04-11T21:33:06.471Z","avatar_url":"https://github.com/jaebradley.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"[![Build Status](https://travis-ci.org/jaebradley/spotify-application-client.svg?branch=master)](https://travis-ci.org/jaebradley/spotify-application-client)\n[![npm version](https://badge.fury.io/js/spotify-application-client.svg)](https://badge.fury.io/js/spotify-application-client)\n\n# Spotify Application Client for MacOS\nNode Client for the Spotify App on Mac OS\n\n## Overview\nSpotify built an [AppleScript API](https://developer.spotify.com/applescript-api/) that enables programmatic control of the player (on Mac OS).\n\nThis client sits on top of this AppleScript API to provide a simple abstraction layer.\n\n### Install\n`npm install spotify-application-client`\n\n### API\n* [`isSpotifyRunning`](https://github.com/jaebradley/spotify-application-client#isspotifyrunning)\n* [`getTrackId`](https://github.com/jaebradley/spotify-application-client#gettrackid)\n* [`getTrackName`](https://github.com/jaebradley/spotify-application-client#gettrackname)\n* [`getAlbumName`](https://github.com/jaebradley/spotify-application-client#getalbumname)\n* [`getArtistName`](https://github.com/jaebradley/spotify-application-client#getartistname)\n* [`getPlayerState`](https://github.com/jaebradley/spotify-application-client#getplayerstate)\n* [`getPlayerPositionInSeconds`](https://github.com/jaebradley/spotify-application-client#getplayerpositioninseconds)\n* [`getTrackDurationInMilliseconds`](https://github.com/jaebradley/spotify-application-client#gettrackdurationinmilliseconds)\n* [`turnOffRepeat`](https://github.com/jaebradley/spotify-application-client#turnoffrepeat)\n* [`turnOnRepeat`](https://github.com/jaebradley/spotify-application-client#turnonrepeat)\n* [`isRepeating`](https://github.com/jaebradley/spotify-application-client#isrepeating)\n* [`toggleRepeat`](https://github.com/jaebradley/spotify-application-client#togglerepeat)\n* [`turnOnShuffle`](https://github.com/jaebradley/spotify-application-client#turnonshuffle)\n* [`isShuffling`](https://github.com/jaebradley/spotify-application-client#isshuffling)\n* [`toggleShuffle`](https://github.com/jaebradley/spotify-application-client#toggleshuffle)\n* [`togglePlayPause`](https://github.com/jaebradley/spotify-application-client#toggleplaypause)\n* [`play`](https://github.com/jaebradley/spotify-application-client#play)\n* [`pause`](https://github.com/jaebradley/spotify-application-client#pause)\n* [`playNextTrack`](https://github.com/jaebradley/spotify-application-client#playnexttrack)\n* [`playPreviousTrack`](https://github.com/jaebradley/spotify-application-client#playprevioustrack)\n* [`playTrack(trackId)`](https://github.com/jaebradley/spotify-application-client#playtrackfromalbumtrackid)\n* [`playTrackFromAlbum(trackId, albumId)`](https://github.com/jaebradley/spotify-application-client#playtrackfromalbumtrackid-albumid)\n* [`getTrackDetails`](https://github.com/jaebradley/spotify-application-client#gettrackdetails)\n* [`getPlayerDetails`](https://github.com/jaebradley/spotify-application-client#getplayerdetails)\n\n#### `isSpotifyRunning`\n* Check to see if the Spotify application is running\n* Returns a `Promise` containing a `Boolean`\n\n#### `getTrackId`\n* Returns a `Promise` containing [the `Base-62` identifier for the current song](https://developer.spotify.com/web-api/user-guide/#spotify-uris-and-ids)\n\n#### `getTrackName`\n* Fetch the current track name\n* Returns a `Promise` containing the track name as a `String`\n\n#### `getAlbumName`\n* Fetch the current album name\n* Returns a `Promise` containing the album name as a `String`\n\n#### `getArtistName`\n* Fetch the current artist name\n* Returns a `Promise` containing the artist name as a `String`\n\n#### `getPlayerState`\n* Fetch the Spotify application player state\n* The three states are `PLAYING`, `PAUSED`, `STOPPED`\n* Returns a `Promise` containing one of these states\n\n#### `getPlayerPositionInSeconds`\n* Fetch the Spotify application player position, in seconds\n* Returns a `Promise` containing a `Float` that describes the player's position, in seconds\n\n#### `getTrackDurationInMilliseconds`\n* Fetch the current track duration, in milliseconds\n* Returns a `Promise` containing an `Integer` that describes the current track's duration, in milliseconds\n\n#### `turnOffRepeat`\n* Turn off the repeat state\n* Returns a `Promise` containing `null` if the state change is successful\n\n#### `turnOnRepeat`\n* Turn on the repeat state\n* Returns a `Promise` containing `null` if the state change is successful\n\n#### `isRepeating`\n* Check if the repeat state is on\n* Returns a `Promise` containing a `Boolean`\n\n#### `toggleRepeat`\n* Flips the repeat state; if repeat is turned on, turn it off and if its turned off, turn it on\n* Returns a `Promise` containing `null` if the state change is successful\n\n#### `turnOffShuffle`\n* Turn off the shuffle state\n* Returns a `Promise` containing `null` if the state change is successful\n\n#### `turnOnShuffle`\n* Turns on the shuffle state\n* Returns a `Promise` containing `null` if the state change is successful\n\n#### `isShuffling`\n* Check if the shuffle state is on\n* Returns a `Promise` containing a `Boolean`\n\n#### `toggleShuffle`\n* Flips the shuffle state; if shuffle is turned on, turn it off and if its turned off, turn it on\n* Returns a `Promise` containing `null` if the state change is successful\n\n#### `togglePlayPause`\n* Change the player state between `PLAYING` and `PAUSED`; if the player is `PLAYING`, then it will be `PAUSED`, and if its `PAUSED`, then it will be `PLAYING`.\n* Returns a `Promise` containing `null` if the state change is successful\n\n#### `play`\n* Change the player state to `PLAYING`\n* Returns a `Promise` containing `null` if the state change is successful\n\n#### `pause`\n* Change the player state to `PAUSED`\n* Returns a `Promise` containing `null` if the state change is successful\n\n#### `playNextTrack`\n* Plays the next track\n* Returns a `Promise` containing `null` if the state change is successful\n\n#### `playPreviousTrack`\n* Plays the previous track\n* Returns a `Promise` containing `null` if the state change is successful\n\n#### `playTrack(trackId)`\n* Plays a track with a given `trackId`\n* Returns a `Promise` containing `null` if the state change is successful\n\n#### `playTrackFromAlbum(trackId, albumId)`\n* Plays a track from an album with a given `trackId` and `albumId`\n* Returns a `Promise` containing `null` if the state change is successful\n\n#### `getTrackDetails`\n* Fetches details about the current track\n* Returns a `Promise` containing a [`TrackDetails`](https://github.com/jaebradley/spotify-application-client/blob/master/src/data/TrackDetails.js) object.\n* The [`TrackDetails`](https://github.com/jaebradley/spotify-application-client/blob/master/src/data/TrackDetails.js) object has the following fields:\n  * `name`: the track name\n  * `albumName`: the track's album name\n  * `artistName`: the track's artist's name\n  * `trackDurationInMilliseconds`: the track's duration in milliseconds\n\n#### `getPlayerDetails`\n* Fetches details about the player\n* Returns a `Promise` a containing a [`PlayerDetails`](https://github.com/jaebradley/spotify-application-client/blob/master/src/data/PlayerDetails.js) object\n* The [`PlayerDetails`](https://github.com/jaebradley/spotify-application-client/blob/master/src/data/PlayerDetails.js) object has the following fields:\n  * `state`: a [`PlayerState`](https://github.com/jaebradley/spotify-application-client/blob/master/src/data/PlayerState.js) object (`PLAYING`, `PAUSED`, `STOPPED`)\n  * `positionInSeconds`: the player's position, in seconds\n  * `isShuffling`: a `Boolean` representing the player's shuffle state\n  * `isRepeating`: a `Boolean` representing the player's repeat state\n  * `isSpotifyRunning`: a `Boolean` representing if the Spotify application is active\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjaebradley%2Fspotify-application-client","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fjaebradley%2Fspotify-application-client","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjaebradley%2Fspotify-application-client/lists"}