尚未收集仓库信息。
尚未检测到更新。GitHub 发布版本后会显示在这里。
制作者的介绍仅有上面的一句话。 更多详情请阅读仓库 README。 仓库 README ↗
正在加载完整 README。
查看完整 README ↗Two things Spotify doesn't give you:
A dependency-free Python API on Vercel serverless functions, plus a single-page demo.
Spotify's Web API no longer exposes audio features (Nov 2024) or playlist items for apps you don't own (Feb 2026 Development Mode changes), so:
Full reference: docs/API.md.
Both endpoints are GET, return JSON, send CORS headers, and are cached at Vercel's CDN for 6 hours. Errors return { "error": "..." } with status 400/404/422/502.
GET /api/analyze?url=<playlist or album link>{
"playlist": { "id": "…", "type": "playlist", "name": "Today's Top Hits", "owner": "Spotify", "image": "https://…", "url": "https://open.spotify.com/playlist/…" },
"trackCount": 50,
"analyzedCount": 24,
"mood": "Happy & Energetic",
"features": [{ "key": "danceability", "label": "Danceable", "value": 0.635 }, "…"],
"tempo": 125,
"loudness": -7.142,
"highlights": { "happiest": { "id": "…", "title": "…", "artist": "…", "value": 0.96 }, "saddest": {}, "mostEnergetic": {}, "mostDanceable": {} },
"tracks": [{ "id": "…", "title": "…", "artist": "…", "danceability": 0.5, "energy": 0.5, "…": 0 }]
}
GET /api/similar?url=<track link>&limit=10 (limit 1–25){
"seed": { "id": "…", "title": "Knights of Cydonia", "artist": "Muse", "image": "https://…", "url": "…", "features": { "energy": 0.96, "…": 0 } },
"labels": { "energy": "Energy Level", "…": "…" },
"tracks": [{ "id": "…", "title": "Drain You", "artist": "Nirvana", "url": "…", "similarity": 96, "features": { "…": 0 } }]
}
npm i -g vercel
vercel # preview
vercel --prod # production
Optional environment variable:
| Name | Example | Default |
|---|---|---|
ALLOWED_ORIGINS | https://naufaldi.vercel.app,http://localhost:3000 | * (any origin) |
analyzedCount can be lower than trackCount. Very new releases are the most likely to be missing.python test_api.py # offline logic checks
vercel dev # run the API + demo locally