---
title: Searching, Paging, and Sorting
slug: docs/paging-and-sorting-in-customer-api
createdAt: 2024-07-19T08:19:07.202Z
---

Amberflo supports efficient searching, paging, and sorting for large datasets.

## Endpoint

[https://app.amberflo.io/customers/paging](https://app.amberflo.io/customers/paging)

## Query string parameters

The following query string parameters are passed to the paging endpoint.

![](https://api.archbee.com/api/optimize/GQ6FhONXoR2DQjp03hOcB/tMr1D-Q9OGDPXVTpgp1vc_image.png)

## Response

A sample response for a search using the keyword inc, sorted by customerName in ascending order with a page size of 5, includes:

- `items`: The list of customer records returned on the current page.
- `metadata`: Contains paging metadata to track the state of the current view.


[/customers/paging?limit=5\&sort=customerName\&search=inc](https://docs.amberflo.io/docs/paging-and-sorting-in-customer-api)

```json
{
    "items": [
        {
            "enabled": true,
            "customerName": "Avengers, Inc.",
          	"customerEmail":"captain@avengers.com",
            "updateTime": 1620412138198,
            "createTime": 1620407940012,
            "id": "00e99cc3-8d07-4946-87fb-fd2fbdc3ada7",
            "customerId": "00e99cc3-8d07-4946-87fb-fd2fbdc3ada7"
        },
        {
            "enabled": true,
            "customerName": "Monsters, Inc.",
          	"customerEmail":"info@monsters.com",
            "updateTime": 1620407897347,
            "createTime": 1620407897347,
            "id": "0208c479-f72a-456e-9334-5affabc11530",
            "customerId": "0208c479-f72a-456e-9334-5affabc11530"
        },
        {
            "enabled": true,
            "customerName": "Oceanic Airlines, Inc.",
          	"customerEmail":"info@oceanic.io",
            "updateTime": 1620407902792,
            "createTime": 1620407902792,
            "id": "04df2aa5-6455-4fd9-b7aa-08d53689379e",
            "customerId": "04df2aa5-6455-4fd9-b7aa-08d53689379e"
        },
        {
            "enabled": true,
            "customerName": "Omni Consumer Products, Inc.",
          	"customerEmail":"info@omni.com",
            "updateTime": 1620407892070,
            "createTime": 1620407892070,
            "id": "073ce3e1-544b-47c2-83a8-dc29c9bd89e2",
            "customerId": "073ce3e1-544b-47c2-83a8-dc29c9bd89e2"
        },
        {
            "enabled": true,
            "customerName": "Stark Industries, Inc.",
          	"customerEmail":"tony.stark@starkindustries.org",
            "updateTime": 1620407934342,
            "createTime": 1620407934342,
            "id": "07908636-7509-4ee0-87c8-5a0273822f74",
            "customerId": "07908636-7509-4ee0-87c8-5a0273822f74"
        }
    ],
   "metadata": {
        "totalRowCount": 1668,
        "filteredRowCount": 20,
        "limit": 5,
        "page": 1,
        "totalFilteredPages": 4,
        "isAscending": true,
        "sort": "customerName",
        "search": "inc"
    }
}
```

**items** include the actual list of customers on the page, and **metadata** includes the paging information as explained in the next section.

## Paging metadata

The `metadata` section in the response provides important information for managing paging. It typically includes:

```json
"metadata": {
    "totalRowCount": 1668,
    "filteredRowCount": 20,
    "limit": 5,
    "page": 1,
    "totalFilteredPages": 4,
    "isAscending": true,
    "sort": "customerName",
    "search": "inc"
}
```

![](https://api.archbee.com/api/optimize/GQ6FhONXoR2DQjp03hOcB/cfQl6c8ZpVxrAaa4_swMR_image.png)

**Useful Queries**

![](https://api.archbee.com/api/optimize/GQ6FhONXoR2DQjp03hOcB/kqrrCFh5qpg2HDK2xT7fD_image.png)

