The API search action is a direct link into the same search you use on the site, if you’re not already familiar with how filters and advanced search work on the site, please check that out. Because the filter system is so “close to the metal”, we highly recommend using advanced search to do things like searching by genre or any other simple filter. As in, instead of sending in a filter array with the genre id you parsed from a previous request, just send in the search string as “genre:rock”.
|s||no||The search string.|
|show||no||How many records to show, defaults to your site’s value. Max 1000|
|pg||no||Page number, default is 0.|
|filters||no||Filter array (deprecated, see below)|
|orderby||no||What field to order by|
|dir||no||What direction to order the “order by” field|
|combineMasters||no||Whether or not to group master and alt tracks together or return them all separately|
|b||no||Used to filter by Album ID|
|raw||no||Includes a new property on each track
As I alluded to above, we’ve changed the way we’re recommending you handle this from previous documentation. In the old way of filtering, you had to build a filter array from the ids in the
filters property of the the response object. This makes a lot more sense when you’re actually on SourceAudio, since you’re filtering the results you already have, but it can get a bit complicated to use through the API.
You should instead filter by just doing advanced searches through the search string
s. You can build them yourself on the site by clicking the “hamburger” menu on the right side of the search bar, and then just pass it into the search API and you’ll get the same results.
This feature is also available on the site, but has been extra useful to our API clients. You can search for any track by its filename, as long as you include an ending. What ending you include is not important. Just use
.mp3 to keep it simple. If you have unique filenames (and I hope you do), then you can use this to quickly find your tracks by your own external system.
dir parameters work much like you’d expect, except that the field names do not match the names in the standard fieldset. The most commonly sorted fields are
title, but if you want to sort by something else, I recommend you do a search on the site and inspect
o parameter that’s sent in the AJAX call. We support a lot of fields, and it changes a lot per site, so I’d rather leave this answer incomplete and teach you how to fish than give you a list that might not be right.