A lightweight Spotify Public API built using Node.js and Next.js API Routes, deployed on Vercel. This project acts as a wrapper around the Spotify Web API to fetch public Spotify data securely.
Fetch Spotify public data (albums, artists, etc.) Serverless API using Vercel Secure handling of API credentials Easy to deploy and extend Clean and minimal codebase
Node.js Next.js (API Routes) Spotify Web API Vercel (Serverless Deployment)
Copy the example file: Copy code Bash mv .env.example .env.local Edit .env.local and add your Spotify credentials: Copy code Bash nano .env.local Copy code Env SPOTIFY_CLIENT_ID=your_client_id SPOTIFY_CLIENT_SECRET=your_client_secret
Request albums by query: Copy code
https://YOUR-VERCEL-DEPLOYMENT.vercel.app/api/spotify?query=summertime%20sadness
Copy code Json [ { "name": "Summertime Sadness", "artist": "Lana Del Rey", "release_date": "2012-08-01", "total_tracks": 10, "url": "https://open.spotify.com/album/...", "image": "https://i.scdn.co/image/..." } ]
You can test it directly in your code: https://spotify-19rgxpxoq-sumits-projects-ca731561.vercel.app/api/spotify?query=montagem%20miau