Skip to content

Search

Find the perfect track in your library using text search, filters, or natural language queries. The search API automatically uses AI-powered semantic search when text search returns no exact matches.

Search Tracks

GET /api/v1/search

Search your tracks with optional filters. Returns full track metadata including genres, moods, instruments, and more.

Terminal window
curl "https://api.songpot.space/api/v1/search?q=upbeat&min_bpm=120&max_bpm=140&moods=Energetic&genres=Pop" \
-H "X-API-Key: YOUR_API_KEY"

Query Parameters

ParameterTypeDescription
qstringText to search for in name and description. Automatically falls back to semantic (AI) search if no exact matches.
min_bpmnumberMinimum BPM
max_bpmnumberMaximum BPM
keystringMusical keys, comma-separated (e.g., cMajor,aMinor)
genresstringGenres, comma-separated (e.g., Pop,Electronic)
moodsstringMoods, comma-separated (e.g., Energetic,Happy)
instrumentsstringInstruments, comma-separated (e.g., Piano,Guitar)
vocal_genderstringVocal gender (Male, Female, Mixed, None)
limitnumberNumber of results (default: 20, max: 100)

Filter Logic

  • Multiple values within a filter: Use commas to select multiple values. Tracks matching any of the values are returned (OR logic).
  • Multiple filters: Different filters are combined with AND logic.

Example: genres=Pop,Electronic&moods=Energetic,Happy returns tracks that are (Pop OR Electronic) AND (Energetic OR Happy).

Response

{
"total": 15,
"tracks": [
{
"id": "abc123",
"name": "Upbeat Pop",
"duration": 185.4,
"bpm": 128.0,
"key": "cMajor",
"vocal_gender": "Female",
"genres": ["Pop", "Electronic", "Synth Pop"],
"moods": ["Energetic", "Happy"],
"instruments": ["Synths", "Drums", "Vocals"],
"description": "Upbeat electronic pop track with female vocals"
}
],
"search_method": "text"
}

Search Methods

The search_method field indicates how results were found:

MethodDescription
textResults from exact text and filter matching
semanticResults from AI-powered semantic search (automatic fallback when text search returns no results)

Search Examples

Filter by Multiple Genres

Terminal window
curl "https://api.songpot.space/api/v1/search?genres=Pop,Electronic,Hip-Hop" \
-H "X-API-Key: YOUR_API_KEY"

Filter by BPM Range and Mood

Terminal window
curl "https://api.songpot.space/api/v1/search?min_bpm=80&max_bpm=100&moods=Calm,Chilled" \
-H "X-API-Key: YOUR_API_KEY"

Combine Text Query with Filters

Terminal window
curl "https://api.songpot.space/api/v1/search?q=summer&genres=Pop&instruments=Guitar,Piano" \
-H "X-API-Key: YOUR_API_KEY"

Browse All Tracks

To browse all your tracks without filters:

Terminal window
curl "https://api.songpot.space/api/v1/search?limit=50" \
-H "X-API-Key: YOUR_API_KEY"