> For the complete documentation index, see [llms.txt](https://api.clearinghouse.net/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://api.clearinghouse.net/api-reference-v2/new-features/pagination.md).

# Pagination

All API v2.0 list endpoints return paginated responses by default. This improves performance and ensures that large datasets can be retrieved efficiently.

***

## How Pagination Works

Every list endpoint responds with a standardized JSON structure that includes:

* `count`: the total number of matching records
* `next`: the URL to fetch the next page (or `null` if there is no next page)
* `previous`: the URL to fetch the previous page (or `null` if you are on the first page)
* `results`: an array containing the records in the current page

***

## Example Paginated Response of a Case Query:

```json
{
  "count": 473,
  "next": "https://clearinghouse.net/api/v2/case/?case_type=5039&page=3",
  "previous": "https://clearinghouse.net/api/v2/case/?case_type=5039&page=1",
  "results": [
    {
      "id": 15150,
      "name": "Pottinger v. City of Miami",
      "case_documents_url": "https://clearinghouse.net/api/v2/documents/?case=15150", // URL to retrieve documents related to this case.
      "case_dockets_url": "https://clearinghouse.net/api/v2/dockets/?case=15150", // URL to retrieve dockets related to this case.
      "case_resources_url": "https://clearinghouse.net/api/v2/resources/?case=15150", // URL to retrieve resources related to this case.
      "...": "..."
    },
    ...
    // More cases here
  ]
}

```
