# limit Parameter

> Cap the number of rows of an answer with the limit parameter of API Maker - the page size of a list, and a safety net on tables which grow.

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

`limit` caps the number of rows in the answer. Without it, get all and the query APIs return every row which matches, so give a `limit` as soon as a table can grow.

**Query param**

```text
GET /api/schema/admin/mysql8/inventory/customers?limit=2&sort=customer_id
```

**Body of the query APIs**

```json
{ "find": {}, "limit": 2, "sort": "customer_id" }
```

**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" }
    ]
}
```

- A whole number greater than zero.
- With `skip`, it pages : `skip=(page - 1) * limit`.
- With `getTotalCount=true`, the answer also says how many rows match in total.
- Inside a `deep` item, `limit` applies to the related rows of each parent : the 5 latest orders of every customer, for example.
- The streams ([get all by stream](https://docs.apimaker.dev/v1/docs/apis-all/schema-apis/auto-generated-schema-based-get-all-by-stream-api.html), query by stream) send big results without a limit and without holding them in memory.

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