API supports simple full-text search across all objects, available for a logged-in user, as well as fine-grained queries with different filters and criterias.
You may filter results of the request that returns a list of a particular object type (like AnalogSignal or SpikeTrain) by providing several parameters in the GET request, for example:
Request: GET /electrophysiology/event/?owner=alex&label__icontains=stimulus
Request: GET /electrophysiology/segment/?index__in=[7,9,14]
Request: GET /electrophysiology/analogsignal/?t_start__gt=15.55
Request: GET /electrophysiology/analogsignal/?date_created__year=2010
At the moment the query works only in “filter” mode, including in the response only those values, that MATCH the criteria provided in the GET request. We are extending the API to support the “exclude” mode, which will work the opposite way and return the results that do NOT match the provided criteria. This will provide more flexibility in using the query mechanism. This function is coming soon.
A useful case for filtering could be filtering objects by their authorship or permissions. For example, if you need to access only public objects (having safety_level = 1, see useful mappings), use the request like:
Request: GET /metadata/section/?safety_level=1
To quickly get a list of objects, shared by a particular user (who’s account name should be like ‘alex’), try:
Request: GET /electrophysiology/analogsignal/?owner__icontains=alex
DATA API limits the number objects to be retrieved in one request by 100. If there are more than a 100 objects you should request them using offset=<some_number> (offset=200 etc.). You may also limit the number of objects by max_results=<some_number> parameter. The start / end indexes for the selected objects are usually contained in the response as “selected_range”. For example, in case there are more than 500 objects, the following request:
Request: GET /metadata/section/?offset=120&max_results=30
will retrieve 30 objects, indexed from 120 to 149 respectively.
Bugs here!
This feature is being developed.
A full-text search feature is being developed.