Pagination and sorting
Pagination
Every list query (for example grants or disclosures) accepts page and limit arguments and returns a collection plus metadata.
pagestarts at 1. Omitting it, or passing 0, returns the first page.limitdefaults to 20. The maximum is 500, and larger values return 500 records.
To read every record, request page: 1, then keep requesting metadata.nextPage until hasNextPage is false.
Sorting
List queries accept sortField and sortDirection.
sortFieldtakes a field name in snake_case. Each query supports its own set of fields, listed on thesortFieldargument in the API Reference. Any other value returns an error withextensions.status400 and the list of allowed fields.sortDirectionisASCorDESC.- Most queries default to
created_at, newest first.contactsdefaults tofull_nameA–Z, andorganizationsandproductsdefault tonameA–Z.