# Pagination, Sorting & Data Operators

The API provides pagination and advanced search operators for certain resource operations, mainly search.

**Pagination**

Data resources from a search can be easily paginated and traversed by using these query parameters:

<pre><code><strong>page={Integer number of the page to be returned by the operation}
</strong>per_page={Integer number of objects returned per page}
</code></pre>

{% hint style="info" %}
Default per\_page is 100
{% endhint %}

**Sorting**

Data that is returned by searches can be easily sorted by parameter or randomly using the `sort_by` query parameter like below:

<pre><code><strong>sort_by=proxy_creation_datetime
</strong><strong>sort_by=service_expiry_datetime
</strong><strong>sort_by=random
</strong><strong>sort_by=proxy_id_desc
</strong>sort_by=proxy_id
</code></pre>

{% hint style="success" %}
Sort by supports additional functionality including random and descending/inverse sort. To sort by the descending of a parameter append *desc to the full parameter name in this* format: {parameter name}\_desc
{% endhint %}

**Data Operators**

In search operations, parameters are usually searched according to whether they equal an inputted value, for example, returning all ISP proxies like below:

<pre><code><strong>/1.0/private/user/proxy/search?proxy_type=ISP
</strong></code></pre>

However, some resource characteristics may be more suited to range or similarity searches. The API provides a framework for this using the operators below:

<pre><code><strong>min_
</strong><strong>max_
</strong><strong>like_
</strong></code></pre>

Any datetime, float or integer parameter can be range searched using `min_` and `max_` appended to the parameter key and any string parameter can be similarity searched by appending `like_` to the parameter key.

For example, if you were to want to search for services which have a total cost between 10-20 USD, you could do the operation below:

<pre><code><strong>/1.0/private/user/service/search?min_service_total=10&#x26;max_service_total=20
</strong></code></pre>

Or, if you were to want to search for proxies which had similar IP addresses you could use the operation below:

<pre><code><strong>/1.0/private/user/proxy/search?like_proxy_ip_address=193.3.%
</strong></code></pre>

{% hint style="success" %}
You can use the % sign wildcard within the value when using like\_ to do complex searches.
{% endhint %}

```
{starts_with_value}%
%{ends_with_value}
%{contains_value}%
```


---

# Agent Instructions: 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:

```
GET https://internal.developer.documentation.private.user.pingproxies.com/basic-concepts/getting-started/pagination-sorting-and-data-operators.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
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.
