{"id":21895153,"url":"https://github.com/shahyar/lyrics-js","last_synced_at":"2026-03-11T17:02:07.729Z","repository":{"id":141317257,"uuid":"84435003","full_name":"shahyar/lyrics-js","owner":"shahyar","description":"Get current Spotify or iTunes track lyrics from a scraper (Genius)","archived":false,"fork":false,"pushed_at":"2019-03-10T20:14:02.000Z","size":9,"stargazers_count":8,"open_issues_count":0,"forks_count":1,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-07-22T14:44:10.230Z","etag":null,"topics":["applescript","javascript","lyrics","nodejs","osascript"],"latest_commit_sha":null,"homepage":null,"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/shahyar.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,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2017-03-09T11:34:33.000Z","updated_at":"2025-06-20T04:22:58.000Z","dependencies_parsed_at":null,"dependency_job_id":"c90014ab-41ce-424f-881b-07b57a2141fa","html_url":"https://github.com/shahyar/lyrics-js","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/shahyar/lyrics-js","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/shahyar%2Flyrics-js","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/shahyar%2Flyrics-js/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/shahyar%2Flyrics-js/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/shahyar%2Flyrics-js/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/shahyar","download_url":"https://codeload.github.com/shahyar/lyrics-js/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/shahyar%2Flyrics-js/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":267163762,"owners_count":24045709,"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","status":"online","status_checked_at":"2025-07-26T02:00:08.937Z","response_time":62,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"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","javascript","lyrics","nodejs","osascript"],"created_at":"2024-11-28T13:31:57.457Z","updated_at":"2026-03-11T17:02:02.707Z","avatar_url":"https://github.com/shahyar.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"Scrape lyrics for a song by \"Artist - Title\", either straight from the command\nline, or in Node.js. Currently only supports Genius lyrics.\n\n## Usage\n### Binary Use (macOS)\nGet an API token for `api.genius.com`, and then put it in `config.json` as\n`{ \"genius\": { \"token\": \"foobar\" } }`.\n\nThen, run `./bin/lyrics`. This only works on macOS, as it uses AppleScript to\nfind out the active track.\n\n### Library Use\n```javascript\nconst Lyrics = require('lyrics');\n\nconst fetcher = new Lyrics({\n    genius: {\n        token: 'foobar'\n    }\n});\n\n\n// Get lyrics for a specific track (artist, title)\nfetcher.getTrackLyrics('Noah', 'Chef')\n  .then(lyrics =\u003e console.log(lyrics))\n  .catch(err =\u003e console.error(err));\n\n\n// Get lyrics for the current track active in Spotify or iTunes (macOS only)\nfetcher.getCurrentTrackLyrics(['Spotify', 'iTunes'])\n  .then(lyrics =\u003e console.log(lyrics))\n  .catch(err =\u003e console.error(err));\n\n\n// Find out the currently active track in Spotify or iTunes (macOS only)\nfetcher.getCurrentTrack(['Spotify', 'iTunes'])\n  .then(({ artist, title }) =\u003e console.log(artist, title))\n  .catch(err =\u003e console.error(err));\n```\n\n### Configuration\nThe `config.json` for `bin/lyrics` and the `config` object passed to `Lyrics`\non construction are one and the same. They accept the following:\n\n```javascript\n{\n    \"genius\": {\n        \"token\": String // Token for api.genius.com\n    },\n    \"log\": Boolean // Whether to log debug info to console (default: true)\n}\n```\n\n## OS support for current track detection\n### macOS (OS X)\nmacOS is natively supported using AppleScript to get the current track from\nSpotify or iTunes.\n\n### Linux\nIn Linux, you can get the current track using D-Bus, as Spotify implements the \nMedia Player Remote Interfacing Specification (MPRIS). I have not tested it,\nbut `mpris-service` is an available package.\n\n### Windows\n~~There isn't a an osascript or D-Bus equivalent way of getting the current track\nfrom Spotify in Windows at the moment, as far as I know. The Spotify Web API\nalso does not have an endpoint to get the /current/ track, though it does have\nan endpoint to fetch the last 50 played tracks -- but this does not include the\ncurrent one, nor does it include any that played for less than 30 seconds.~~\n\nUpdate 2019: You can use Spotify's `/v1/me/player/currently-playing` API endpoint. https://developer.spotify.com/documentation/web-api/reference/player/get-the-users-currently-playing-track/\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fshahyar%2Flyrics-js","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fshahyar%2Flyrics-js","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fshahyar%2Flyrics-js/lists"}