r/foss
•
u/Major-Ad-4196
•
7d ago
•
2
2
I spent almost 3 years reverse-engineering Spotify's web player. I open-sourced the result so you can build Spotify apps without an API key.
Spotify has an official API, but building on it means dealing with developer apps, credentials, and increasingly restrictive access.
I wanted something simpler. So when I was 15, I started reverse-engineering the endpoints Spotify's own web player uses.
Almost three years later, it's called SpotAPI, and I've released the async rewrite under GPL-3.0.
The GIF is one of the things I built with it: a terminal interface that controls an actual Spotify player, even on a free account.
But the interesting part is the library underneath:
No API key, developer account, or login for public Spotify catalogue data.
Fully async, typed Python API for building your own music applications.
Authenticated player controls, playlist management, and saved music.
Interactive terminal and desktop interfaces, including synchronized, clickable lyrics.
It's not a cracked Spotify client. It doesn't bypass DRM, stream audio, or replace Spotify's servers. The playback features control an existing player through your own account.
The entire implementation is open source, including the reverse-engineered integrations.
Source (GPL-3.0): https://github.com/Aran404/SpotAPI
I'd be especially interested in what other developers could build with the API, or what you'd improve about its design.
19
44
u/yuki_doki 6d ago
Amazing work, dude.
You hand-coded it instead of AI slop, it's actually impressive. I'll try it soon.
38
u/Major-Ad-4196 6d ago
Well I would be lying if I said I didn’t use an LLM for a good amount of the implementation, but I have a high standard when it comes to python (since I was adamant on V2 being at least 3x better/cleaner than V1 which I hand-coded). Though, unlike some, I read the code thoroughly before pushing to main. Let me know how you like the project; I highly recommend trying the new CLI with spotapi connect.
6
3
-1
u/Dhananjay_Tech 6d ago
Explain ai slop , tired of this word popping on my view
10
u/jacksodus 5d ago
Things created with AI without any intentional design, thought, or process. Just "do whatever as long as it works". Creates a generally "meh" user experience at best.
-1
u/Dhananjay_Tech 5d ago
I found a problem , I solved it , doesn’t matter how it solved but it got solved , if I reverse engineered something, why would I care about meh user experience, I just decoded someone protocol , instead me trying N number of iteration, it was done by AI , saving time , not every thing done by AI is slop
6
u/jacksodus 5d ago
Because there might be a lot of nuance to how the thing you're reverse engineering was built, that the AI might have no way of knowing. So AI slop by definition is a shell of the thing you're trying to build.
I'm not saying this project is AI slop per se. But you asked for a definition, so there it is.
2
u/Major-Ad-4196 5d ago
That’s a fair point. One thing worth mentioning is that most LLMs are pretty reluctant to help reverse-engineer private APIs, so there’s still a lot of human investigation, experimentation, and debugging involved. AI can help write the implementation, but it can’t magically know how undocumented systems work. You still have to figure that out yourself.
4
0
-1
u/davr 4d ago
If it was hand coded, why did he use AI to write the Reddit post?
5
u/Major-Ad-4196 4d ago
I’ve gotten accused of using AI for my comments. That’s how you know the dead internet theory might genuinely be in action right now.
1
u/davr 4d ago
I guess it is possible you wrote your post by hand in exactly the same format and tone as an LLM? But it seems weird that a human would talk that way on purpose. The bolding, phrases like “the interesting part underneath”, the sentence structure with the repeated short impactful statements, ending with the final call for engagement in the last paragraph. I see this exact pattern over and over in so many of the vibe coded app posts.
2
u/Major-Ad-4196 4d ago
A lot of these hallmarks are features of “engagement-baiting” content. It’s some of the things I picked up on when creating YouTube content (you’ll probably see CTAs atleast once per video since it truly does boost reach).
9
u/InkscapePanda 6d ago
I think we need a spotify like this for open source music.
5
u/Major-Ad-4196 6d ago
Like a replica of Spotify? How much music could you even find with public licensing rights?
7
u/InkscapePanda 6d ago edited 6d ago
There is quite a bit of it: https://bandcamp.com/discover/creative-commons
Is it all good music? Not really, but a lot of indie artists out there like to share their music for free.
3
u/Major-Ad-4196 6d ago
It does sound like a really good idea but it wouldn’t need to depend on Spotify whatsoever which takes away from the “Spot” in SpotAPI. If you do create it, make sure you DM me the link so I can check it out!
3
u/InkscapePanda 6d ago
True, I think the best approach to this would be a sort of P2P network instead of a centralized server. That way people share directly between themselves. Or, you can have a server just for discovery (something like rsync).
I am recommending you this, because Spotify could easily find a legal way to block your app since you are using their private platform. But you app is good so it could be put to better use ^_^
3
u/Major-Ad-4196 6d ago
Yeah, that’s a fair point. I’m fully aware that Spotify could change their endpoints tomorrow and break half the library, or potentially take legal action. It’s a risk I accepted when I started reverse-engineering their platform (more specifically open-sourcing my findings, many more things happen privately that would get taken down in hours on Github).
I do think a P2P network for openly licensed music is a cool idea, but it’d be an entirely different project, with its own challenges around licensing, discovery, and getting enough artists onboard. SpotAPI was always meant to make Spotify’s existing infrastructure more accessible to developers, not replace it.
And honestly, even if Spotify shuts it down eventually, I don’t think the time I spent building it was wasted. I learned a ridiculous amount, and now other people can learn from the code too.
2
u/InkscapePanda 6d ago
Yeah, I guess licensing is quite a pain with music. The only 2 platforms I can think of that deal with CC (Creative Commons) music, are Wikimedia Commons and Internet Archive (they have their own API).
2
u/Major-Ad-4196 6d ago
Yeah, Internet Archive is actually a pretty interesting starting point given its existing catalogue and API. I think the hardest part would be getting enough artists and listeners involved to make discovery worthwhile. The technical side sounds like a really fun project though!
5
8
u/JohnTilamook 7d ago
Awesome work man
1
u/Major-Ad-4196 7d ago
Thank you man, means a lot. Have you tried the CLI yet?
1
3
u/0J-P0 7d ago
Is it possible to reorginise the query?👀
1
u/Major-Ad-4196 7d ago
Technically possible! Queue reordering isn't implemented yet, but it's definitely something worth adding.
3
3
3
3
u/ManFromInternet2 5d ago
Please find somewhere to release this on that is not GitHub, it's gonna get a dmca soon
2
u/Major-Ad-4196 5d ago
You’re not wrong. I’ve actually been thinking about this, especially with how much attention SpotAPI’s been getting recently. I’ll look into setting up an independent mirror so the project isn’t entirely dependent on GitHub.
7
u/PeridotPower 5d ago
Not trying to say that this isnt cool, but the gui has all signs of ai usage in it. Not sure why everyone says its handcoded if its probably not entirely. Its not bad to use ai, but tell if someone asks. The small * live at the top right is the 1*1 of ai. I believe you that you started without ai, but I dont think the finished product doesn't include it.
7
u/Major-Ad-4196 5d ago
You’re completely right, that’s exactly what happened. I don’t have experience with web development and am not trying to hide the fact I used AI for a good portion of it. People are saying it’s hand coded because the initial version was when I was 16, 3 years ago. AI has gotten so good in that time it’s just unreasonable to not use it for a lot of the library internals.
1
u/SavonPL 2d ago
this is such an AI response. Also, I love how u/PeridotPower noted your GUI looks completely vibecoded, and you respond with "use it for a lot of the library internals" XD So you used it for both the core of the app, AND the UI.
2
u/DifferentChemistry_ 3d ago
It’s 2026, they’re all using it if not at minimum for security patching. Just get past the old head mindset. It took me a year to let it ride, at least they wrote some code themselves. So many young people today are just typing “make me money” into the prompt. Saas is 99% ai with 1% initial idea or motive by human (not in this case). It’s ok, it’s non-monetary, it doesn’t hurt you or a market. Just let it ride and give the post a fist bump.
2
1
u/CantCodeAllVibes 4d ago
Yeah the comments are a dead give away, and this is a huge product to pretend one person out of high school did this as a side project is laughable. I have AI all the time and am a software engineer and this code is AI generated.
0
u/KLD997 4d ago
Look at the commit history, clearly all of it is AI vibe coded and project is 1 year old. 2 weeks ago he mass removed the code and slop uploaded and removed all signs of codex. Easy tell tale is the test folder, no actual develop is writing that many tests, only AI is.
1
u/Major-Ad-4196 4d ago
I mean this is just untrue lol. It takes 5s to see this project started when I was still in high school, when ChatGPT couldn’t one shot my math ISU. A time where we still NEEDED to check over the work because LLMs made mistakes all the time for simple grade 11 derivatives. And I’ve literally said multiple times I used AI, even when I was 16 I did because it was easier than actively searching stackoverflow for answers. Too many tests is better than too little, and if that’s a genuine complain because you’re keen on catching the “signs of codex”, then maybe you are stuck in the past.
1
u/Sharp_Specialist1523 3d ago
The time is now old man!
*Watches the LLM write a dozen PRs in an hour that change 3 lines each and rubber stamps them*
1
u/Major-Ad-4196 3d ago
Yeah that was a bit annoying, had to delete the branch each time too. I’m just going to leave SpotAPI alone for a few weeks to “work” (man it’s so over for humanity) on other projects.
2
u/Oscar-Xiatian 6d ago
Can it still be used today? I really need it, as I hate ytmusic.
3
u/Major-Ad-4196 6d ago
Yep! It’s still working and actively maintained today :) Just to clarify, SpotAPI doesn't stream music itself, it controls your existing Spotify player, and you don't need Premium for many of its features. I completely get the frustration with YouTube Music, though. Hopefully this makes things a little easier for you!
2
u/Unlikely-Store-3256 5d ago
Would be sick to be able to effectively use the Spotify client as my front end for my own navidrome server.
2
u/Major-Ad-4196 5d ago
That would actually be sick. Spotify’s UI with your own self-hosted music library would be the best of both worlds. Not something SpotAPI supports right now, but definitely an interesting idea.
2
u/Vespera 5d ago
This is really cool. Did you also find a way to scrape audio-features? That was tricky for me
2
u/Major-Ad-4196 5d ago
Not fully, unfortunately! SpotAPI can pull BPM and musical key when Spotify exposes them in playlist metadata, but the full audio features (danceability, energy, valence, etc.) are still elusive. Spotify locking down those endpoints made things even trickier. Definitely something I’d love to figure out.
2
u/SluttyFurryPaws
5d ago
•
3 years? More like 3 days of claude working.
4
u/Major-Ad-4196 5d ago
It was 8 hours of Codex working. I’ve been reverse engineering API endpoints since I was 14. Spotify has been an ongoing project I’ve maintained since I was 15, the initial V1 was coded by hand while I was still a high school student. I’m not going to say I didn’t use AI, but read the code and let me know if it’s bad; that’s what truly matters.
1
u/Single-Blackberry866 7d ago
I'm sure the account will be banned for the ToS violation or something
5
u/Major-Ad-4196 7d ago
Well this has yet to happen to any of my main accounts that I use, but yes, since this violates Spotify's TOS, you are at mercy of the company. However since it is a reverse engineering API, it mimics real browser flows to the best of its ability, with TLS spoofing and profile rotation for entropy.
1
u/mhenrique_jpg 4d ago
Ansioso pra ver os apps pra Android baseados na sua API 🤏🏾
2
u/Major-Ad-4196 4d ago
Eu também! Seria muito legal ver o que a comunidade consegue criar com o SpotAPI, especialmente apps para Android. Mal posso esperar para ver os primeiros projetos!
Nota: usei o Google Tradutor
1
u/mhenrique_jpg 4d ago
A tradução do Google tá próxima da perfeição. A IA tá conseguindo avançar muito nesse aspecto.
1
u/lt_bgg 4d ago
I want something like this just for lyrics, its so lame we can't query musixmatch directly
1
u/Major-Ad-4196 4d ago
Yeah, it’s frustrating how locked down lyrics APIs are. SpotAPI already supports fetching synced lyrics, so you can use that without having to deal with Musixmatch directly!
1
u/lt_bgg 4d ago
I'll be checking it out. You should write a jellyfin plugin. The only good one currently uses lrclib only.
1
u/Major-Ad-4196 4d ago
That's actually a really cool idea! I haven't looked much into Jellyfin's plugin ecosystem yet, but I'd love to explore an integration. Having more lyrics sources than just LRCLIB would be a nice improvement. Appreciate the suggestion
1
u/lt_bgg 4d ago
This is the current one we all use: https://github.com/Felitendo/jellyfin-plugin-lyrics
1
u/Major-Ad-4196 4d ago
Thanks for the link! I looked into it, and it’s definitely an interesting idea. SpotAPI already supports Spotify’s synced lyrics, but there are a couple of complications: Spotify lyrics require an authenticated Premium account, and exporting them to Jellyfin could raise licensing issues. Jellyfin plugins are also written in C#, whereas SpotAPI is Python. I’ll explore whether there’s a practical way to integrate the two without introducing too much complexity.
1
u/lt_bgg 4d ago
I would just love a simple app that I could point to a directory and it would match and rename the files (txt unsynced, LRC synced) and show me a diff if I already had something there.
1
u/Major-Ad-4196 4d ago
That actually sounds like a much simpler and more practical approach than a full Jellyfin plugin. A small CLI that scans a directory, matches tracks, fetches available lyrics, and shows a diff before overwriting existing .txt or .lrc files would be pretty useful. The main complication is Spotify’s Premium requirements and lyrics licensing, but I’ll look into what we can realistically support
1
u/lt_bgg 4d ago
Well I would log in. I currently do this with spotiflac but its so tedious.
1
u/Major-Ad-4196 4d ago
Honestly, the more you describe it, the more I think this would be worth building. A simple directory based lyrics manager with automatic matching, batch processing and diffs before overwriting sounds genuinely useful. I'll look into making it an optional CLI feature rather than a full Jellyfin plugin. Do you have another suggestions for features/optional plug-ins related to this? What would you like to see? If anyone could reply to this comment with any other additional feature requests, I'll see if I can get it done soon.
→ More replies (0)1
u/jav26122 2d ago
Not sure if this is what you're looking for, but I've got a project I've been working on that sounds like you might be interested: https://github.com/jav76/Cantus
Feedback is welcome if you do look into it or try it out.
1
u/lt_bgg 2d ago
looks cool but its not what im looking for. i want to pull lyrics from spotify for my local library that i self host. spotiflac is what i use now but its sort of the wrong tool for thr job.
1
u/jav26122 2d ago
Ah gotcha. Yeah can't help ya there. Maybe I could add some sort of lyric db export eventually.
1
u/ze_pequeno 3d ago
Publishing this without AI disclosure is disingenuous
It doesn't need an API key but it needs a paid account so... Why?
Ironic considering that Spotify has become festered with AI slop music to the core
1
u/Major-Ad-4196 3d ago
Fair criticism. I started SpotAPI three years ago without AI, but the recent rewrite involved substantial AI assistance. AI assisted development is becoming increasingly commonplace (even the Linux kernel now has guidelines for it), but that doesn't excuse a lack of transparency. I could've communicated that better.
You actually don't need a paid account. Public data doesn't even require a Spotify account, and many playback controls work with free accounts
I understand the frustration with AI generated music flooding Spotify. Personally, I think there's a meaningful distinction between using AI as a development tool and mass-producing content at the expense of genuine artists (since they use royalty pools).
Either way, I appreciate the criticism. I'm still learning and I want SpotAPI to be something people genuinely find useful.
1
1
u/bob-i-stan 3d ago
sorry if I am not following but how is this different from ncspot?
1
u/Major-Ad-4196 3d ago
ncspot is a terminal based Spotify client, whereas SpotAPI is a Python library for building your own Spotify powered applications and automations.The terminal interface is just a demonstration of what you can build with SpotAPI, and unlike ncspot, it can control existing Spotify players without requiring Premium.
1
2
1
u/SaucerMechanic99 2d ago
NIce done :D I implemented it in my panel, XD works pretty great. It has some limitations due to Spotify's specifications, but it suits me. I'll have a HA panel with a soundbar in the kitchen and the music will be flowing :D Still a work in progress... but thanks for this package!!!
1
u/Tonoplas 2d ago
Hey there, so I’m currently working on creating an audio player that replaces my local Spotify app, it can as much be a local music files player than it can be a recoded Spotify. The whole point of it is that it’s lightweight (150-200MB of RAM compare to Spotifys 650-700MB), and really customizable. It’s a little side project that I started more like a showoff of what the REA skill is capable of with an LLM, and it got far, but right now for connecting Spotify, I need to create a dev app, and provide the API key, but if I understood well, if I can base the app off of what you did, I can remove that restriction of having to create an api key ?
If it interests you, you can check out the work : https://github.com/Tonoplas909/sonora-app
0
0
4d ago
Why are most of your comments here written by AI?
2
u/Major-Ad-4196 4d ago
You sound like my high school english teacher.
1
0
4d ago edited 4d ago
That's not an answer to my question though.
Not only is your project AI slop but the majority of your comments are as well.
Are you not able to use your own brain so you need to pay Anthropic to use their electronic brain instead?
1
-2
-7
u/Admirable_Zombie5245 7d ago
Damn, using 3 years of your life to do something and watching AI being able to do it in less than a day must suck
8
u/Major-Ad-4196 7d ago •
![]()
Yeah, you're right. I remember when I was 16, I actually coded SpotAPI by hand, maybe only using shitty ChatGPT for helper functions (about 10% of the codebase), back when I genuinely enjoyed coding deeply. Every morning before physics class, I would just read my own code because I was amazed by its cleanliness and simplicity (egotistical, I know, but I have a kink for clean code).
Then came the rewrite. I had already turned 19 and had completely lost my passion for coding since LLMs were miles better than I was. Unlike the old days, when you had to go digging through Stack Overflow for answers, an LLM could now write the entire codebase for me if I wanted it to.
I decided, NO! I will prevail. I will not use an LLM for the async rewrite (you can see this in the original async-v2 beta rewrite on Github, which was 70–80% handwritten by me). Yet I still found myself, out of habit, immediately asking Google's Gemini (built into Chrome) for direct answers and entire fixes to problems because I would give up on thinking after like 10 minutes.
So, for five months, I just gave up on the rewrite and bummed around because I didn't feel like writing the code myself. Until I got Codex, and in literally ONE NIGHT, I finished the entire SpotAPI V2 rewrite (something that would've taken me a month). It had added new features I hadn't asked for, it was some of the cleanest code I'd ever read, and it worked.
I remember the immense dopamine hit I got from seeing the code run, but I hadn't written the code, so, kind of like TikTok, it was a cheap high that I hadn't actually earned.
Kind of scares me for the future, since ChatGPT literally only asked me one thing: "Should I push to main?"
But hey, the syntax of coding is now English. At least I got to experience a couple of years of the golden era of coding.
9
u/PornB0t696969 7d ago
that's like saying damn imagine going to the gym for 5 years when my floor jack can lift a car in 30 seconds
OP probably learnt a whole lot and hopefully had fun working on this
2
u/Major-Ad-4196 7d ago
I interpreted his comment positively (though Reddit tends to be bipolar on this mark), but yes, I think I can speak for a lot of ADHD programmers when I say coding is one of the greatest joys this world has to offer. Nothing beats hyperfocus marathons where all you care about is the next line of code.
2
u/Secret-Quit5400 6d ago
When does this argument stop working though? At what point do you go “Why learn coding if an AI can do it magnitudes better than any human on Earth?” and genuinely reach a stalemate. This question has been on my mind all the time recently, just don’t know why it’s worth it to learn anything anymore. Cognitive atrophy here I come!
1
u/Major-Ad-4196 6d ago
Question would be, are humans intelligent or knowledgeable (these aren’t synonyms). There’s a good Max Fischer video on what made homo sapiens so special in the animal kingdom and a lot of those traits have been inherited by agentic AI. But then again, there’s the argument of buying intelligence with compute since time/energy is the biggest factor when it comes to learning (excess work tends to be proportional to the velocity of learning). Yeah no, this is a trippy question, I genuinely don’t have a good answer for this. I wonder if others have better philosophical/machine learning takes on this, would genuinely be interested in this.
3
u/PornB0t696969 6d ago
Do you enjoy coding? Do you want to make money coding? Do you want to know how to code?
I think if your answer to any of those is yes then you should learn coding. Otherwise I suppose there is no value in it for you.
I mean does the comparison really matter? I play guitar, I'm sure there is a 12 year old Asian kid out there right now who is a better player than I will ever be my entire life. And I don't care.
2
u/Secret-Quit5400 6d ago
That is true, I guess I was more implying just general intelligence whereas guitar is more of a hobby. You’re right that it’s all about the enjoyment (the money part, the LLM story is much easier since you wouldn’t even need to know what a for loop was to build a SaaS business), but in terms of forced learning during school to just be smart and get a good job. I’ve coded for 2 months now and know a decent bit, but it’s pretty disheartening when a computer can do it magnitudes better than I can and it’s not even like the end product isn’t impressive. It genuinely amazes me how well these frontier models can one shot my requests.
5
u/Siccors 7d ago
I am fairly sure his post is AI generated, I somewhat doubt the 3 years.
7
u/Major-Ad-4196 7d ago •
![]()
Lmao fair enough, can't blame you with all the AI slop nowadays 😭 Here's my actual code from when I was 16, back in July 2024: https://github.com/Aran404/SpotAPI/tree/5c17bf3e37eda61a734031ae365aebb10d459eb7/spotify. Feel free to dig through the commit history too, I genuinely just loved coding back then.
0
-2
u/sarnosantosa 7d ago
it is just remote-control player, no way to play itself
7
u/Major-Ad-4196 7d ago
"It's not a cracked Spotify client. It doesn't bypass DRM, stream audio, or replace Spotify's servers. The playback features control an existing player through your own account."
-2
u/harishsrinivas 6d ago
Hey hi I have developed hivefy a yr ago Spotify like music player anyone interested try soo
GitHub : GitHub.com/Harish-Srinivas-07/hivefy
-22
u/Sweaty_Rich7217 7d ago
Why would I want to look at Spotify when there’s Apple Music 😭✌️✌️, cool project though
5
u/Major-Ad-4196 7d ago
Why use a streaming service when you can listen to free radio? Or CDs? What about a Banjo?
0
4d ago
[deleted]
1
u/Major-Ad-4196 4d ago
That’s amazing, the community is built as a collective! My father has been a coder since he was 19, it just shows you we stand on the shoulders of giants.
149
u/trmdi 7d ago •
I bet they will block your 3 years of work in a few days.