Setting the file. One moment.
Subchapter 2.9
references/pagination-and-sort.mdMarkdown2 KBView on GitHub
# First page (default: 100 rows)
curl '.../nces/naep?limit=50'
# Second page
curl '.../nces/naep?limit=50&offset=50'
# Third page
curl '.../nces/naep?limit=50&offset=100'| Parameter | Default | Range | Description |
|---|---|---|---|
limit | 100 | 1-1000 | Max rows per request |
offset | 0 | 0+ | Rows to skip |
The response includes total_rows (unfiltered count) and filtered_rows (count after filters, when filters are applied) so you can calculate total pages.
For stable pagination through large or frequently updated datasets. Pass the next_cursor from a previous response to get the next page.
# First page
curl '.../nces/naep?limit=50&sort=year'
# Response includes: "next_cursor": "eyJ..."
# Next page
curl '.../nces/naep?limit=50&cursor=eyJ...'cursor and offset are mutually exclusive. Using both returns a 400 error.
When there are no more results, next_cursor is null.
Sort by one or more columns. Prefix with - for descending order.
# Ascending by year
curl '.../nces/naep?sort=year'
# Descending by year
curl '.../nces/naep?sort=-year'
# Multi-column: year desc, then score asc
curl '.../nces/naep?sort=-year,score'When no sort is specified:
default_sort: uses the view’s defaultSort column names are validated against the schema. Invalid column names produce an error.