# GET\_ACCOUNT\_SNAPSHOT

## Overview

*This method returns a snapshot of specific account data for a program based on a slot & writeVersion*

{% openapi src="<https://2513171703-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FE1gzfwcjB542lI2VR9XI%2Fuploads%2FYJf9cG1onnfKwlnxnRMr%2FCarpool_dev-GET_ACCOUNT_SNAPSHOT-0.1-resolved.json?alt=media&token=cb6f028a-2bb6-4be8-8571-f024ab307eb8>" path="/query/solana" method="post" %}
[Carpool\_dev-GET\_ACCOUNT\_SNAPSHOT-0.1-resolved.json](https://2513171703-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FE1gzfwcjB542lI2VR9XI%2Fuploads%2FYJf9cG1onnfKwlnxnRMr%2FCarpool_dev-GET_ACCOUNT_SNAPSHOT-0.1-resolved.json?alt=media\&token=cb6f028a-2bb6-4be8-8571-f024ab307eb8)
{% endopenapi %}

## Example

**Program** - *Candy Machine*

**Description** *- Return a snapshot of the CandyMachine account: Avax...wh8K at slot* 204584643 and writeVersion 773978115822. Return all fields in the post body.

#### Javascript

```javascript
var myHeaders = new Headers();
myHeaders.append("x-api-key", "<API_KEY>");
myHeaders.append("Content-Type", "application/json");

var raw = JSON.stringify({
  "type": "GET_ACCOUNT_SNAPSHOT",
  "query": {
    "programId": "CndyV3LdqHUfDLmE5naZjVN8rBZz4tqhdefbAnjHG3JR",
    "accountName": "CandyMachine",
    "accountPubKey": "AvAx5oEWscpGudFSrWKPqsGypfeKGM1DriUXSRc7wh8K",
    "slot": 204584643,
    "writeVersion": 773978115822,
    "fields": []
  }
});

var requestOptions = {
  method: 'POST',
  headers: myHeaders,
  body: raw,
  redirect: 'follow'
};

fetch("https://mainnet.carpool.dev/query/solana", requestOptions)
  .then(response => response.text())
  .then(result => console.log(result))
  .catch(error => console.log('error', error));
```

#### cURL

```
curl --location 'https://mainnet.carpool.dev/query/solana' \
--header 'x-api-key: <API_KEY>' \
--header 'Content-Type: application/json' \
--data '{
  "type": "GET_ACCOUNT_SNAPSHOT",
  "query": {
    "programId": "CndyV3LdqHUfDLmE5naZjVN8rBZz4tqhdefbAnjHG3JR",
    "accountName": "CandyMachine",
    "accountPubKey": "AvAx5oEWscpGudFSrWKPqsGypfeKGM1DriUXSRc7wh8K",
    "slot": 204584643,
    "writeVersion": 773978115822,
    "fields": []
  }
}'
```
