有没有一种方法可以通过非高级帐户使用 Spotify API 搜索歌曲但不播放它们?

Is there a way to search for songs using the Spotify API with a non-premium account but not play them?

我正在考虑开发一个使用 Spotify API 的 Android 应用程序。从他们的教程中可以找到:https://developer.spotify.com/technologies/spotify-android-sdk/tutorial/,您必须以高级用户身份登录才能播放歌曲。我更多地研究了它是如何工作的,它涉及使用这一行设置范围:

builder.setScopes(new String[]{"user-read-private", "streaming"});

"streaming" 范围需要高级帐户。我搜索了这个包含所有范围的页面:https://developer.spotify.com/web-api/using-scopes/,我想知道如果我只想搜索一首歌而不是播放它,我会使用哪个。这可能与免费帐户有关吗?

提前致谢!

根据您链接的页面:

If no scope is specified, access is permitted only to publicly available information: that is, only information normally visible to normal logged-in users of the Spotify desktop, web, and mobile clients (e.g. public playlists).

去掉"streaming"范围后,相信你可以搜索歌曲了。话虽这么说,Spotify Web API endpoints for search say that you don't need authentication to search. You can try out an unofficial Spotify web API wrapper 让这更容易一些。