Grab band name search results from Spotify API

笑着哭i 提交于 2019-12-12 02:38:51

问题


I am seeking to add a search ability to my custom search bar of a web app I am developing to grab recognized band names and have the result grab the Spotify Result.

I have found this information regarding the search in spotify;

https://developer.spotify.com/technologies/web-api/

I am wondering if anyone has tried this and how I may approach this.

Ultimately I am seeking how to pull in Spotify Playlists based on band searched; utilizing Spotify API


回答1:


As stated in the comment, it doesn't look like the API provides CORS or JSONP so you can't access it directly from JavaScript unless your page is on the same domain as the API (or if you use forcecors plugin for firefox but that means every client visiting your site has to install and activate the plugin).

To use the API on a public website with a different domain as the API your site has to proxy requests from JavaScript to the API. You have to use server side script like PHP, .net, Python or Java for this.



来源:https://stackoverflow.com/questions/19671721/grab-band-name-search-results-from-spotify-api

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!