Perform a search and return the matching resources.

Variable Description Data type Default value
$search * The search string in the standard ResourceSpace format, see also special search terms. string  
$restypes A string of resource type IDs to include e.g. "1,2". Leave empty to return resources of all types. string ""
$order_by A string indicating results order. Valid options are relevance, popularity, rating, date, colour, country, title, file_path, resourceid, resourcetype, titleandcountry, random, status. Leave empty for relevance ordering. string "relevance"
$archive The archive status of resources to return. 0=live assets (the default), 1=pending archive, 2=archived, 3=deleted, -1=pending review, -2 = pending submission. integer 0

Maximum number of rows to return. Leave blank to return all rows.

From version 10.3 this also supports passing an offset and limit as two comma separated values e.g. "0,50", with the offset as the first element and the limit (number of rows to return) as the second parameter.1

integer|string -1
$sort Sort order, "asc"=ascending, "desc"=descending (default). string "desc"
$offset Return only a subset of the search results, starting after the given offset. Useful for paging. Default is 0. integer 0


When performing searching that include dates the following formats should be considered

Where "datefieldname" is the name of the date field you wish to search on

If date ranges is being used


If date ranges is not being used


Return values

The resource results in JSON format. The parameters returned will depend on system configuration.

"creation_date":"2016-08-09 14:00:05",
"file_modified":"2016-08-09 14:00:05",
"field12":"2016-08-09 12:59",
"field8":"Example Photo",


1 If the $fetchrows parameter is passed as comma separated list in order to specify an offset and number of rows to return then the results will be returned in structured array form as below:

  • A 'total' element with the total number of rows that would have been returned if no offset or limit had been specified
  • A 'data' element containing the search results as normal