Loading Library...
Loading Library...
Select a track to start
Manage your programmatic access.
Jump to Integration Guide ↓Use this key to authenticate requests.
Endpoint: http://localhost:3000/api/v1/songs
curl -X GET \ "http://localhost:3000/api/v1/songs" \ -H "x-api-key: YOUR_API_KEY"
Run this in your terminal to fetch the music library JSON.
const res = await fetch(
"/api/v1/songs",
{
headers: {
"x-api-key": "YOUR_API_KEY"
}
}
);
const data = await res.json();Use this snippet to integrate MusicSeva into your own React/Next.js apps.
# Add a song to recommendations by ID
curl -X POST \
"http://localhost:3000/api/v1/recommendations" \
-H "x-api-key: YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{"song_id": 1}'This allows you to programmatically curate the "Recommended" page.
Copy this Kotlin code into your Android WebView setup to automatically capture the API key on login.
// 1. Define the Interface
class WebAppInterface(private val mContext: Context) {
@JavascriptInterface
fun onSessionConfig(json: String) {
val data = JSONObject(json)
val apiKey = data.getString("apiKey")
Log.d("MusicSeva", "✅ API Key Auto-Synced: $apiKey")
// Save to SharedPreferences...
}
}
// 2. Attach to WebView
webView.addJavascriptInterface(WebAppInterface(this), "Android");Click below to make a real request to /api/v1/songs using your active key.
Click the "Generate Token" button above. Your key will look like: ms_sk_abc123...
⚠️ Keep this key secure. Don't share it publicly.
The WebView automatically sends the key to your native app. No manual copying needed.
✅ Auto-sync enabled via AndroidBridge component
Copy your key and use it in HTTP headers:
x-api-key: YOUR_KEY_HERETest the API using any of these methods:
Terminal (curl):
curl -H "x-api-key: YOUR_KEY" http://localhost:3000/api/v1/songsJavaScript (fetch):
fetch('/api/v1/songs', { headers: { 'x-api-key': 'YOUR_KEY' } })Or use the tester above ⬆️
/api/v1/songs- Fetch all songs/api/v1/recommendations- Get recommended songs/api/v1/recommendations- Add song to recommendationsWhen ready to go live:
localhost:3000 with your deployed domainBase URL:
http://localhost:3000/api/v1Auth Header:
x-api-keyResponse Format:
JSONYour Key:
Generate above