Sorting and paging
How to sort report rows with order_by, the default order of each report, and how to get the rows page by page.
Sort with order_by
order_by holds up to 3 column names, separated by commas. Add :asc after a column for the smallest values first, or :desc for the largest first. Without either, the order is asc.
?order_by=visibility:desc
?order_by=week,share_of_voice:descYou can sort by any column the report returns. When 2 rows have the same value, a fixed order decides, so the same request always returns its rows in the same order. A column the report does not return gets status 400 with the error code order_field_invalid.
Default order
| Report | Default order |
|---|---|
| visibility | by the time dimension if you ask for one, then by answers, largest first |
| brands | by the time dimension if you ask for one, then by share_of_voice, largest first |
| citations | by the time dimension if you ask for one, then by citations, largest first |
Get the rows page by page
| Parameter | Default | Allowed values |
|---|---|---|
limit | 1000 | 1-10000 |
offset | 0 | 0-100000 |
meta.total is the number of rows on all pages together, and meta.has_more says whether more rows come after this page. See Pagination.
Example
Your 20 weakest prompts:
curl -G https://api.lumirank.ai/v1/reports/visibility \
-H "Authorization: Bearer $LUMIRANK_API_KEY" \
-d dimensions=prompt -d order_by=visibility:asc -d limit=20