The $order
parameter determines how the results should be sorted, using the values from the specified columns, similar to a SQL ORDER BY
. Sorting can be performed in either ascending or descending order, the default being ascending, but you can also reverse the order with DESC
.
For example, to sort our earthquakes by magnitude
, in descending order:
https://soda.demo.socrata.com/resource/4tka-6guv.json?$order=magnitude DESC
We could sort them in ascending order by replacing DESC
with ASC
, or by simply omitting it.
$order
clause or at a minimum $order=:id
. That will guarantee that the order of your results will be stable as you page through the dataset.