# getTotalCount Parameter

> Get the number of rows matching a filter next to the page you asked for with getTotalCount=true in API Maker - the total a pager needs, in the same call.

Source: https://docs.apimaker.dev/v1/docs/apis-all/query-params/getTotalCount.html

`getTotalCount=true` adds `totalCount` to the answer : the number of rows matching the filter, before `skip` and `limit`. One call gives the page and the total.

**Query param**

```text
GET /api/schema/admin/mysql8/inventory/customers?find={isActive:1}&skip=0&limit=2&getTotalCount=true
```

**Body of the query APIs**

```json
{ "find": { "isActive": 1 }, "skip": 0, "limit": 2, "getTotalCount": true }
```

**Answer**

```json
{
    "success": true,
    "statusCode": 200,
    "data": [
        { "customer_id": 1, "first_name": "Bob", "last_name": "Lin" },
        { "customer_id": 2, "first_name": "Alice", "last_name": "Page" }
    ],
    "totalCount": 5
}
```

- `false` or absent : no `totalCount` and no count query.
- It works on get all, get all by stream, query and query by stream. The [count](https://docs.apimaker.dev/v1/docs/apis-all/schema-apis/auto-generated-schema-based-count-api.html) API gives the number alone.
- `totalCount` also appears in the answer of a stream, after the rows.
- The count runs as a second query on the database ; on a very big table with a complex filter it costs as much as the query itself.

- [upsert →](https://docs.apimaker.dev/v1/docs/apis-all/query-params/upsert.html)
- [skip](https://docs.apimaker.dev/v1/docs/apis-all/query-params/skip.html)
