Skip to content

definitelyDefi/music-space-api

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

4 Commits
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

🎧 Music Space API

A FastAPI backend that provides music recommendations based on track or artist using Spotify, Deezer, and Last.fm APIs.

πŸš€ Features

  • /recommendations/by-track?track=...
  • /recommendations/by-artist?artist=...
  • /token route for preview token use
  • Artist enrichment with Wikipedia / Spotify fallback
  • Smart deduplication & metadata merging

🧱 Tech Stack

  • FastAPI
  • httpx (async HTTP client)
  • uvicorn
  • dotenv
  • CORS middleware

πŸ“¦ Install

Create a virtual environment:

python -m venv venv
source venv/bin/activate
pip install -r requirements.txt

Create .env or setup Enviroment variables

SPOTIFY_CLIENT_ID=your_spotify_id
SPOTIFY_CLIENT_SECRET=your_spotify_secret
LASTFM_API_KEY=your_lastfm_api_key

CORS setup (now setup for all urls)

from fastapi.middleware.cors import CORSMiddleware

app.add_middleware(
CORSMiddleware,
allow_origins=["*"], # Change to your frontend URL in production
allow_methods=["*"],
allow_headers=["*"],
)

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages