# Get list of keys


```
GET 
https://api.apify.com/v2/key-value-stores/:storeId/keys
```


Returns a list of objects describing keys of a given key-value store, as well as some information about the values (e.g. size).

This endpoint is paginated using `exclusiveStartKey` and `limit` parameters

* see [Pagination](https://pr-2390.preview.docs.apify.com/api/v2.md#using-key) for more details.

## Request

### Path Parameters

* **storeId** string required

  Key-value store ID or `username~store-name`.

  **Example:** `WkzbQMuFYuamGv3YF`

### Query Parameters

* **exclusiveStartKey** string

  All keys up to this one (including) are skipped from the result.

  **Example:** `Ihnsp8YrvJ8102Kj`

  **limit** double

  Number of keys to be returned. Maximum value is `1000`.

  **Example:** `100`

  **collection** string

  Limit the results to keys that belong to a specific collection from the key-value store schema. The key-value store need to have a schema defined for this parameter to work.

  **Example:** `postImages`

  **prefix** string

  Limit the results to keys that start with a specific prefix.

  **Example:** `post-images-`

  **signature** string

  Signature used for the access.

  **Example:** `2wTI46Bg8qWQrV7tavlPI`

<!-- -->

### Status 200

**Response Headers**




```
{
  "data": {
    "items": [
      {
        "key": "second-key",
        "size": 36,
        "recordPublicUrl": "https://api.apify.com/v2/key-value-stores/WkzbQMuFYuamGv3YF/records/second-key?signature=abc123"
      },
      {
        "key": "third-key",
        "size": 128,
        "recordPublicUrl": "https://api.apify.com/v2/key-value-stores/WkzbQMuFYuamGv3YF/records/third-key?signature=abc123"
      }
    ],
    "count": 2,
    "limit": 2,
    "exclusiveStartKey": "some-key",
    "isTruncated": true,
    "nextExclusiveStartKey": "third-key"
  }
}
```


**Schema**

* **data** object required

  * **items** object\[] required

    * **key** string required\
      **Example:** `second-key`

    * **size** integer required\
      **Example:** `36`

    * **recordPublicUrl** string\<uri> required

      A public link to access this record directly.

      **Example:** `https://api.apify.com/v2/key-value-stores/WkzbQMuFYuamGv3YF/records/some-key?signature=abc123`

  * **count** integer required\
    **Example:** `2`

  * **limit** integer required\
    **Example:** `2`

  * **exclusiveStartKey** string | null nullable\
    **Example:** `some-key`

  * **isTruncated** boolean required\
    **Example:** `true`

  * **nextExclusiveStartKey** string | null nullable\
    **Example:** `third-key`

### Status 400

Bad request - invalid input parameters or request body.


```
{
  "error": {
    "type": "invalid-input",
    "message": "Invalid input: The request body contains invalid data."
  }
}
```


**Schema**

* **error** object required

  * **type** string required\
    **Example:** `run-failed`
  * **message** string required\
    **Example:** `Actor run did not succeed (run ID: 55uatRrZib4xbZs, status: FAILED)`

### Status 401

Unauthorized - authentication required or invalid token.


```
{
  "error": {
    "type": "token-not-valid",
    "message": "Authentication token is not valid."
  }
}
```


**Schema**

* **error** object required

  * **type** string required\
    **Example:** `run-failed`
  * **message** string required\
    **Example:** `Actor run did not succeed (run ID: 55uatRrZib4xbZs, status: FAILED)`

### Status 403

Forbidden - insufficient permissions to perform this action.


```
{
  "error": {
    "type": "permission-denied",
    "message": "You do not have permission to perform this action."
  }
}
```


**Schema**

* **error** object required

  * **type** string required\
    **Example:** `run-failed`
  * **message** string required\
    **Example:** `Actor run did not succeed (run ID: 55uatRrZib4xbZs, status: FAILED)`

### Status 404

Not found - the requested resource was not found.


```
{
  "error": {
    "type": "record-not-found",
    "message": "Key-value Store was not found"
  }
}
```


**Schema**

* **error** object

  * **type** string

    **Possible values:** \[`record-not-found`]

  * **message** string\
    **Example:** `Key-value Store was not found`

### Status 405

Method not allowed.


```
{
  "error": {
    "type": "method-not-allowed",
    "message": "This API end-point can only be accessed using the following HTTP methods: OPTIONS,GET"
  }
}
```


**Schema**

* **error** object required

  * **type** string required\
    **Example:** `run-failed`
  * **message** string required\
    **Example:** `Actor run did not succeed (run ID: 55uatRrZib4xbZs, status: FAILED)`

### Status 429

Too many requests - rate limit exceeded.


```
{
  "error": {
    "type": "rate-limit-exceeded",
    "message": "You have exceeded the rate limit. Please try again later."
  }
}
```


**Schema**

* **error** object required

  * **type** string required\
    **Example:** `run-failed`
  * **message** string required\
    **Example:** `Actor run did not succeed (run ID: 55uatRrZib4xbZs, status: FAILED)`
