> For the complete documentation index, see [llms.txt](https://api-docs.rightsline.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://api-docs.rightsline.com/search/pagination/making-paginated-search-requests.md).

# Making paginated search requests

In order to retrieve all objects from a search request, we recommend the following approach:

1. Send a search request where `start = 0`, and `rows = 100`.
2. The search result will contain a property called `numFound`.  If `start` + `rows`  < `numFound`, then there are additional records to retrieve.  If this is the case, increment the start parameter by the value of the rows parameter.  For instance, if `numFound = 200`, then add 100 to 0 and assign this value to `start`  and make an additional search request, this time with `start = 100` and `rows = 100`.&#x20;
3. Repeat step 2 until `start` + `rows` >= `numFound`.  When this is the case, you have retrieved all relevant records for your search request.

#### .NET C# Example

```csharp
public IEnumerable<Entity> SendPaginatedSearchRequest(SearchRequest request)
{
    var entities = new List<Entity>();
    bool isAdditionalRecords = true;
    
    while(isAdditionalRecords)
    {
        var result = SendSearchRequest(request);
        entities.AddRange(result.Entities);
        
        if (request.Start + request.Rows < result.NumFound)
        {
            // Additional records to retrieve. Increment start by rows.
            request.Start += request.Rows;
        }
        else
        {
            // All records have been retrieved.
            isAdditionalRecords = false;
        }
    }
    return entities;
}
```


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://api-docs.rightsline.com/search/pagination/making-paginated-search-requests.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
