{"id":17246988,"url":"https://github.com/jmperez/spotify-app-stats","last_synced_at":"2025-04-14T04:41:46.302Z","repository":{"id":40712158,"uuid":"283403284","full_name":"JMPerez/spotify-app-stats","owner":"JMPerez","description":"A library to fetch the stats for your Spotify App from Spotify's developer site","archived":false,"fork":false,"pushed_at":"2022-06-25T14:37:46.000Z","size":45,"stargazers_count":19,"open_issues_count":2,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-03-27T18:50:12.783Z","etag":null,"topics":["spotify","spotify-api","spotify-application","spotify-library","spotify-web-api"],"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/JMPerez.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":"2020-07-29T05:04:21.000Z","updated_at":"2024-11-05T00:02:28.000Z","dependencies_parsed_at":"2022-08-23T20:10:57.442Z","dependency_job_id":null,"html_url":"https://github.com/JMPerez/spotify-app-stats","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/JMPerez%2Fspotify-app-stats","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/JMPerez%2Fspotify-app-stats/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/JMPerez%2Fspotify-app-stats/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/JMPerez%2Fspotify-app-stats/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/JMPerez","download_url":"https://codeload.github.com/JMPerez/spotify-app-stats/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248824662,"owners_count":21167343,"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":["spotify","spotify-api","spotify-application","spotify-library","spotify-web-api"],"created_at":"2024-10-15T06:35:39.686Z","updated_at":"2025-04-14T04:41:46.269Z","avatar_url":"https://github.com/JMPerez.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Spotify App Stats\n\nThis library lets you fetch your Spotify app stats from Spotify's developer site programmatically.\n\n## How to\n\nYou need to use the Spotify credentials for the owner of the app. Make sure you don't leak the password committing it to a public repository, and use secret environment variables instead.\n\nYou find the application id navigating to https://developer.spotify.com/dashboard/applications, clicking on the application you are interested, and taking the last bit of the URL. For a URL like https://developer.spotify.com/dashboard/applications/04dca0de1c4e4aca88cc615ac23581be the application id is `04dca0de1c4e4aca88cc615ac23581be`.\n\n```js\nconst SpotifyAppStats = require(\"@jmperez/spotify-app-stats\");\n\n(async () =\u003e {\n  const spotifyAppStats = new SpotifyAppStats();\n  await spotifyAppStats.init();\n  await spotifyAppStats.login(\"username\", \"password\");\n  const stats = await spotifyAppStats.getStats(\"application_id\");\n  spotifyAppStats.destroy();\n  console.log(stats);\n})();\n```\n\nThe stats will have a similar format to this:\n\n```json\n{\n  \"dau\": [\n    { \"date\": \"2020-06-29\", \"number_of_daus\": 314 },\n    { \"date\": \"2020-06-30\", \"number_of_daus\": 282 },\n    { \"date\": \"2020-07-01\", \"number_of_daus\": 276 },\n    { \"date\": \"2020-07-02\", \"number_of_daus\": 289 },\n    { \"date\": \"2020-07-03\", \"number_of_daus\": 325 },\n    { \"date\": \"2020-07-04\", \"number_of_daus\": 269 },\n    { \"date\": \"2020-07-05\", \"number_of_daus\": 257 },\n    { \"date\": \"2020-07-06\", \"number_of_daus\": 291 },\n    { \"date\": \"2020-07-07\", \"number_of_daus\": 297 },\n    { \"date\": \"2020-07-08\", \"number_of_daus\": 263 },\n    { \"date\": \"2020-07-09\", \"number_of_daus\": 290 },\n    { \"date\": \"2020-07-10\", \"number_of_daus\": 320 },\n    { \"date\": \"2020-07-11\", \"number_of_daus\": 261 },\n    { \"date\": \"2020-07-12\", \"number_of_daus\": 238 },\n    { \"date\": \"2020-07-13\", \"number_of_daus\": 300 },\n    { \"date\": \"2020-07-14\", \"number_of_daus\": 317 },\n    { \"date\": \"2020-07-15\", \"number_of_daus\": 382 },\n    { \"date\": \"2020-07-16\", \"number_of_daus\": 333 },\n    { \"date\": \"2020-07-17\", \"number_of_daus\": 304 },\n    { \"date\": \"2020-07-18\", \"number_of_daus\": 291 },\n    { \"date\": \"2020-07-19\", \"number_of_daus\": 311 },\n    { \"date\": \"2020-07-20\", \"number_of_daus\": 351 },\n    { \"date\": \"2020-07-21\", \"number_of_daus\": 339 },\n    { \"date\": \"2020-07-22\", \"number_of_daus\": 290 },\n    { \"date\": \"2020-07-23\", \"number_of_daus\": 306 },\n    { \"date\": \"2020-07-24\", \"number_of_daus\": 334 },\n    { \"date\": \"2020-07-25\", \"number_of_daus\": 273 },\n    { \"date\": \"2020-07-26\", \"number_of_daus\": 274 },\n    { \"date\": \"2020-07-27\", \"number_of_daus\": 333 },\n    { \"date\": \"2020-07-28\", \"number_of_daus\": 337 }\n  ],\n  \"mau\": [\n    { \"date\": \"2020-06-29\", \"number_of_maus\": 5202 },\n    { \"date\": \"2020-06-30\", \"number_of_maus\": 5196 },\n    { \"date\": \"2020-07-01\", \"number_of_maus\": 5194 },\n    { \"date\": \"2020-07-02\", \"number_of_maus\": 5190 },\n    { \"date\": \"2020-07-03\", \"number_of_maus\": 5209 },\n    { \"date\": \"2020-07-04\", \"number_of_maus\": 5200 },\n    { \"date\": \"2020-07-05\", \"number_of_maus\": 5196 },\n    { \"date\": \"2020-07-06\", \"number_of_maus\": 5210 },\n    { \"date\": \"2020-07-07\", \"number_of_maus\": 5216 },\n    { \"date\": \"2020-07-08\", \"number_of_maus\": 5193 },\n    { \"date\": \"2020-07-09\", \"number_of_maus\": 5189 },\n    { \"date\": \"2020-07-10\", \"number_of_maus\": 5194 },\n    { \"date\": \"2020-07-11\", \"number_of_maus\": 5194 },\n    { \"date\": \"2020-07-12\", \"number_of_maus\": 5151 },\n    { \"date\": \"2020-07-13\", \"number_of_maus\": 5172 },\n    { \"date\": \"2020-07-14\", \"number_of_maus\": 5220 },\n    { \"date\": \"2020-07-15\", \"number_of_maus\": 5306 },\n    { \"date\": \"2020-07-16\", \"number_of_maus\": 5338 },\n    { \"date\": \"2020-07-17\", \"number_of_maus\": 5330 },\n    { \"date\": \"2020-07-18\", \"number_of_maus\": 5349 },\n    { \"date\": \"2020-07-19\", \"number_of_maus\": 5380 },\n    { \"date\": \"2020-07-20\", \"number_of_maus\": 5437 },\n    { \"date\": \"2020-07-21\", \"number_of_maus\": 5480 },\n    { \"date\": \"2020-07-22\", \"number_of_maus\": 5466 },\n    { \"date\": \"2020-07-23\", \"number_of_maus\": 5458 },\n    { \"date\": \"2020-07-24\", \"number_of_maus\": 5459 },\n    { \"date\": \"2020-07-25\", \"number_of_maus\": 5482 },\n    { \"date\": \"2020-07-26\", \"number_of_maus\": 5482 },\n    { \"date\": \"2020-07-27\", \"number_of_maus\": 5529 },\n    { \"date\": \"2020-07-28\", \"number_of_maus\": 0 }\n  ],\n  \"endpoints\": [\n    { \"endpoint\": \"/v1/playlists/\u003cplaylist-id\u003e/tracks\", \"days\": [Array] },\n    { \"endpoint\": \"/v1/me/tracks\", \"days\": [Array] },\n    {\n      \"endpoint\": \"/v1/users/\u003cusername\u003e/playlists/\u003cplaylist-id\u003e/tracks\",\n      \"days\": [Array]\n    },\n    { \"endpoint\": \"/v1/users/\u003cusername\u003e/playlists\", \"days\": [Array] },\n    { \"endpoint\": \"/v1/me\", \"days\": [Array] }\n  ],\n  \"total_requests\": [\n    { \"date\": \"2020-06-29\", \"number_of_requests\": 71565 },\n    { \"date\": \"2020-06-30\", \"number_of_requests\": 72256 },\n    { \"date\": \"2020-07-01\", \"number_of_requests\": 53315 },\n    { \"date\": \"2020-07-02\", \"number_of_requests\": 22298 },\n    { \"date\": \"2020-07-03\", \"number_of_requests\": 85267 },\n    { \"date\": \"2020-07-04\", \"number_of_requests\": 68736 },\n    { \"date\": \"2020-07-05\", \"number_of_requests\": 63188 },\n    { \"date\": \"2020-07-06\", \"number_of_requests\": 84165 },\n    { \"date\": \"2020-07-07\", \"number_of_requests\": 87114 },\n    { \"date\": \"2020-07-08\", \"number_of_requests\": 62112 },\n    { \"date\": \"2020-07-09\", \"number_of_requests\": 59252 },\n    { \"date\": \"2020-07-10\", \"number_of_requests\": 93852 },\n    { \"date\": \"2020-07-11\", \"number_of_requests\": 49616 },\n    { \"date\": \"2020-07-12\", \"number_of_requests\": 63348 },\n    { \"date\": \"2020-07-13\", \"number_of_requests\": 55169 },\n    { \"date\": \"2020-07-14\", \"number_of_requests\": 73339 },\n    { \"date\": \"2020-07-15\", \"number_of_requests\": 67275 },\n    { \"date\": \"2020-07-16\", \"number_of_requests\": 73587 },\n    { \"date\": \"2020-07-17\", \"number_of_requests\": 55189 },\n    { \"date\": \"2020-07-18\", \"number_of_requests\": 62868 },\n    { \"date\": \"2020-07-19\", \"number_of_requests\": 70360 },\n    { \"date\": \"2020-07-20\", \"number_of_requests\": 72152 },\n    { \"date\": \"2020-07-21\", \"number_of_requests\": 92881 },\n    { \"date\": \"2020-07-22\", \"number_of_requests\": 83735 },\n    { \"date\": \"2020-07-23\", \"number_of_requests\": 80332 },\n    { \"date\": \"2020-07-24\", \"number_of_requests\": 73998 },\n    { \"date\": \"2020-07-25\", \"number_of_requests\": 58472 },\n    { \"date\": \"2020-07-26\", \"number_of_requests\": 87560 },\n    { \"date\": \"2020-07-27\", \"number_of_requests\": 124465 },\n    { \"date\": \"2020-07-28\", \"number_of_requests\": 0 }\n  ],\n  \"map_data\": {\n    \"last_known_date\": \"2020-07-27\",\n    \"locations\": [\n      [Object],\n      [Object],\n      [Object],\n      [Object],\n      [Object],\n      [Object],\n      [Object],\n      [Object],\n      [Object],\n      [Object],\n      [Object],\n      [Object],\n      [Object],\n      [Object],\n      [Object],\n      [Object],\n      [Object],\n      [Object],\n      [Object],\n      [Object],\n      [Object],\n      [Object],\n      [Object],\n      [Object],\n      [Object],\n      [Object],\n      [Object],\n      [Object],\n      [Object],\n      [Object],\n      [Object],\n      [Object],\n      [Object],\n      [Object],\n      [Object],\n      [Object],\n      [Object],\n      [Object],\n      [Object],\n      [Object],\n      [Object],\n      [Object],\n      [Object],\n      [Object],\n      [Object],\n      [Object],\n      [Object],\n      [Object]\n    ]\n  }\n}\n```\n\n## Applications\n\nThere are several ways yoou could leverage this data:\n\n- Creating a public dashboard so anyone can see the stats for your app. See [Spotify Dedup' Stats](https://spotify-dedup.com/stats) as an example.\n- Integrating the data in a personal dashboard\n- Storing the data so you can get more than 30 days worth of stats, which is what Spotify's developer site shows today.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjmperez%2Fspotify-app-stats","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fjmperez%2Fspotify-app-stats","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjmperez%2Fspotify-app-stats/lists"}