question

Lily Scott avatar image
Lily Scott asked

How does Alexa plays specific songs on Spotify?

I am curious on how Alexa is able to play requested songs on Spotify? More importantly, if I could see the code used to achieve the task?

alexa skills
10 |5000

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

1 Answer

Will@Amazon avatar image
Will@Amazon answered

Accessing code to view spotify skill is likely not possible if you are not the skill owner. However, Spotify skill certainly makes use of spotify APIs to get your voiced requests to be played on spotify from Alexa and to retrieve specific songs to be played.

Alexa also provides a set of resources and interfaces that can be used to play audio URI including AudioPlayer Interface Reference. For more details about the audio player, see Stream Long-Form Audio with AudioPlayer. And you can certainly create a skill that makes use of these APIs to play songs on Alexa enabled devices. You certainly make use of account linking for your users to offer a more secure or personalized experience.

You can certainly review sample skill with the audio player interface from our Github repository below:

10 |5000

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.