Skip to content

Additional Request Properties

Most of the request properties are sequence filters. However, there are some properties that influence the response data in other ways.

Check the Swagger UI for the full specification.

Ordering The Results

You can specify the response fields by which the results should be ordered. LAPIS by default sorts in ascending order.

GET /sample/aggregated?orderBy=responseField1,responseField2

To specify descending order, you need to send a POST request:

POST /sample/aggregated
{
"orderBy": [
"responseField1",
{ "field": "responseField2", "type": "descending" }
]
}

Pagination

LAPIS supports pagination. You can specify the number of results to return and the offset to start from.

GET /sample/aggregated?limit=10&offset=20

Pagination respects the ordering of the results.

Data Format

By default, LAPIS returns the data in JSON format. LAPIS also supports returning the data as CSV or TSV. The format can be specified in the Accept header.

GET /sample/aggregated
Accept: text/csv
POST /sample/aggregated
Accept: text/tab-separated-values

Media Type Selector In Swagger UI

You can specify the parameter headers=false in the accept header to exclude the headers from the CSV or TSV response.

GET /sample/aggregated
Accept: text/csv;headers=false

Downloading The Results From A Browser

You can set downloadAsFile to true. LAPIS will then set the header Content-Disposition: attachment; filename=<data.format>. This will prompt browsers to download the data as file.

GET /sample/aggregated?downloadAsFile=true

You can also specify the file’s basename by setting the downloadFileBasename property.

GET /sample/aggregated?downloadAsFile=true&downloadFileBasename=my_file_basename

This will set the header Content-Disposition: attachment; filename=my_file_basename.<data.format>.

Compression

LAPIS supports gzip and Zstd compression. You can request compressed data by setting the compression property in the request. Refer to the Swagger UI for allowed values.

GET /sample/aggregated?compression=gzip