LoginSignup
3
2

More than 3 years have passed since last update.

Spotify APIで再生情報をリアルタイムに取りたいと調べてた時のこぼれ話

Posted at

Spotifyのweb APIで「再生中の曲をリアルタイムに取得したいなー」と思って、色々調べてた。
Spotifyと開発者コミュニティのやりとりがちょっと面白かったので、こぼれ話的にメモ。


GETのAPIはすぐにみつかった。
https://developer.spotify.com/documentation/web-api/reference/player/get-the-users-currently-playing-track/

まぁ、そりゃあるよね。

が、曲が変わった時に教えてくれるようなwebhookみたいなのは、一向に見つからず。
ありそうでない。。。

「ポーリングは避けたいなー」と粘っていると...

GitHub Issuesでディスカッションされてた。既に2年前から。
https://github.com/spotify/web-api/issues/492

以下、ディスカッションを抜粋。

:speech_balloon: 開発者は、リクエスト上限を気にしつつ、ポーリングで何とか凌いでる様子。
https://developer.spotify.com/documentation/web-api/#rate-limiting

:speech_balloon: clientサイドのweb socketライブラリ作った人もいる(裏ではポーリングらしい)
https://github.com/spotify/web-api/issues/492#issuecomment-342029854

:speech_balloon: 月5万ユーザー持つような開発者も困ってる
https://github.com/spotify/web-api/issues/492#issuecomment-370070771

:speech_balloon: Spotify側も「必要性を認識してる」とコメントしつつ、2年間特にアウトプットなし
https://github.com/spotify/web-api/issues/492#issuecomment-356882740

:speech_balloon: 実はDiscordに対しては、web socketらしきものがサポートされてることが報告される
https://github.com/spotify/web-api/issues/492#issuecomment-370070771

:speech_balloon: 開発者たち「何で俺らには使わせてくれないんだ」とイラつき始める
https://github.com/spotify/web-api/issues/492#issuecomment-455553492
(気持ちはわかる)

:speech_balloon: Spotify側は、リバースエンジニアリングでパートナーとの秘匿情報がさらされてるからとGitHub Issueをlockする
https://github.com/spotify/web-api/issues/492#issuecomment-509317942

:speech_balloon: ディスカッションの場がオフィシャルコミュニティに移ったが、現在もSpotifyからのアウトプットは特になし
https://community.spotify.com/t5/Spotify-for-Developers/Access-to-websockets/m-p/4955299/highlight/true#M146

3
2
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
3
2