Hey there. I haven't seen you yet but, welcome to CodeForum.org!
Anyways, as for your Question...
At first, I thought Spotify was built on something like Electron. But after looking at their Careers that are available, it appears that they do use Java for some of their stuff so that's something.
But, it appears that Spotify only has a Web-API and not a native Desktop-API. So, if you wanted to use an API then you're unfortunately, out of luck. Secondly, Spotify is Proprietary-Software. So, if you wanted to figure out how to control the Desktop-Program and make Mods for it, you'd need access to the Source-Code. Unfortunately, only Spotify has access to this Source-Code so learning Spotify's Code to try and modify it is essentially impossible and you'd need to work there just to get access to that Source-Code.
But, if you did work there and you modified that Source-Code and released a Modified-Version of Spotify to the world or only used it for Personal-Use, you'd probably be fired.
I think you may want to skip this one and do something much simpler. Maybe look for an Open-Source Project that has a Desktop-API for you to work on.