recieve the updates on song without API polling

I want to integrate spotify with my app.
After login and retrieving the tokens, I want to take some actions on my application on the basis of currently playing song.
How can I get the currently playing track details without polling the API
Child Item
Child Item
Child Item

Accepted answers

All comments

You can't do that with the Spotify API.

Here is an example on how you can get the information of the currently playing media with Python on Windows 10.

I can imagine it can be done with other programming languages at other operating systems.

Child Item
Child Item