# Get record


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


Gets a value stored in the key-value store under a specific key.

The response body has the same `Content-Encoding` header as it was set in .

If the request does not define the `Accept-Encoding` HTTP header with the right encoding, the record will be decompressed.

Most HTTP clients support decompression by default. After using the HTTP client with decompression support, the `Accept-Encoding` header is set by the client and body is decompressed automatically.

Please note that for security reasons, Apify API can perform small modifications to HTML documents before they are served via this endpoint. To fetch the raw HTML content without any modifications, use the `attachment` query parameter.

## Request

### Path Parameters

* **storeId** string required

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

  **Example:** `WkzbQMuFYuamGv3YF`

  **recordKey** string required

  Key of the record.

  **Example:** `someKey`

### Query Parameters

* **signature** string

  Signature used for the access.

  **Example:** `2wTI46Bg8qWQrV7tavlPI`

  **attachment** boolean

  If `true` or `1`, the response will be served with `Content-Disposition: attachment` header, causing web browsers to offer downloading HTML records instead of displaying them.

  **Example:** `true`

<!-- -->

### Status 200

**Response Headers**




```
{
  "message": "Hello, world!",
  "count": 42
}
```


**Schema**

* **property name\*** any

  The response body contains the value of the record. The content type of the response is determined by the Content-Type header stored with the record.

  **Example:** `{"message":"Hello, world!","count":42}`

### Status 302

**Response Headers**

* **Location**

### 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**

* oneOf

  * KeyValueStoreNotFoundError
  * RecordNotFoundError

  **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)`
