简体   繁体   中英

Generate song suggestions (auto-complete)

I'm developing an app and I want a user to be able to start typing a song name/artist/whatever and then have a list/drop-down show suggestions on the fly depending on what the user typed (preferably as the user is typing).

I was thinking I would need to use some sort of API which queried the iTunes database for songs available for purchase (or any other large database with song information), but I'm open to using any other source.

Does anybody know of an API I can look into or a framework I can use. I don't need a solution in code or anything, I'm simply asking for a nod in the right direction.

Let me know if you need anymore information. Thanks.

Apple exposes a search API for the iTunes Store. That should help you. https://www.apple.com/itunes/affiliates/resources/documentation/itunes-store-web-service-search-api.html

Here's a writeup by Apple describing the API: https://www.apple.com/itunes/affiliates/resources/blog/introduction---search-api.html

From there, you just have to hit the endpoint with the appropriate parameters and then display the results. The endpoint is:

https://itunes.apple.com/search?parameterkeyvalue

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM