Executions and Results
Sorting
Our API allows for sorting on all /results
endpoints to organize query results in a specified order. This sorting functionality enables users to retrieve data in a manner that best suits their needs, whether ascending or descending. The feature is designed to work in a similar fashion to a SQL ORDER BY
clause and is available for the following endpoints:
Sorting can be effectively combined with pagination, filtering and sampling to optimize data retrieval.
Sorting Parameters
sort_by
- Type:
string
- Description: Specifies the order in which query results are returned. It directly mirrors the functionality of an SQL
ORDER BY
clause.
- Specify the sorting criteria using the format
<column_name> asc|desc
. For example,block_time desc
. - If a column name contains special characters, enclose it in double quotes, e.g.,
"special,column" asc
. - You can sort by multiple columns by separating them with a comma, exactly like in SQL. For instance,
amount_usd desc, block_time
. - By default, sorting is in ascending order if not explicitly specified. Explicitly include
asc
ordesc
to define the sorting order.