# /v1/accounts/{address}/resource/{resource_type}

> For the complete documentation index, see [llms.txt](/docs/llms.txt).

GET https://aptos-mainnet.g.alchemy.com/v2/docs-demo/v1/accounts/{address}/resource/{resource_type}

Retrieves an individual resource from a given account and at a specific ledger version.
If the ledger version is not specified, the latest ledger version is used.


Reference: https://www.alchemy.com/docs/chains/aptos/aptos-api-endpoints/aptos-api-endpoints/v-1-accounts-address-resource-resource-type

## Path Parameters

| Name | Type | Required | Description |
|------|------|----------|-------------|
| address | string | Yes | Address of account with or without a 0x prefix. |
| resource_type | string | Yes | Name of the Move struct resource to retrieve (e.g. 0x1::account::Account). |

## Query Parameters

| Name | Type | Required | Description |
|------|------|----------|-------------|
| ledger_version | string | No | Ledger version to get the state of the account. |

## Code Examples

### cURL

```bash
curl --request GET \
  --url https://aptos-mainnet.g.alchemy.com/v2/docs-demo/v1/accounts/0x1d8727df513fa2a8785d0834e40b34223daff1affc079574082baadb74b66ee4/resource/0x1::account::Account
```

### JavaScript

```javascript
const options = {method: 'GET'};

fetch('https://aptos-mainnet.g.alchemy.com/v2/docs-demo/v1/accounts/0x1d8727df513fa2a8785d0834e40b34223daff1affc079574082baadb74b66ee4/resource/0x1::account::Account', options)
  .then(res => res.json())
  .then(res => console.log(res))
  .catch(err => console.error(err));
```

### Python

```python
import requests

url = "https://aptos-mainnet.g.alchemy.com/v2/docs-demo/v1/accounts/0x1d8727df513fa2a8785d0834e40b34223daff1affc079574082baadb74b66ee4/resource/0x1::account::Account"

response = requests.get(url)

print(response.text)
```

### Go

```go
package main

import (
	"fmt"
	"net/http"
	"io"
)

func main() {

	url := "https://aptos-mainnet.g.alchemy.com/v2/docs-demo/v1/accounts/0x1d8727df513fa2a8785d0834e40b34223daff1affc079574082baadb74b66ee4/resource/0x1::account::Account"

	req, _ := http.NewRequest("GET", url, nil)

	res, _ := http.DefaultClient.Do(req)

	defer res.Body.Close()
	body, _ := io.ReadAll(res.Body)

	fmt.Println(string(body))

}
```

### Java

```java
HttpResponse<String> response = Unirest.get("https://aptos-mainnet.g.alchemy.com/v2/docs-demo/v1/accounts/0x1d8727df513fa2a8785d0834e40b34223daff1affc079574082baadb74b66ee4/resource/0x1::account::Account")
  .asString();
```

### C#

```csharp
using RestSharp;


var options = new RestClientOptions("https://aptos-mainnet.g.alchemy.com/v2/docs-demo/v1/accounts/0x1d8727df513fa2a8785d0834e40b34223daff1affc079574082baadb74b66ee4/resource/0x1::account::Account");
var client = new RestClient(options);
var request = new RestRequest("");
var response = await client.GetAsync(request);

Console.WriteLine("{0}", response.Content);

```


## Operation Specification

```yaml
path: /v1/accounts/{address}/resource/{resource_type}
method: GET
operation:
  summary: /v1/accounts/{address}/resource/{resource_type}
  description: |
    Retrieves an individual resource from a given account and at a specific ledger version.
    If the ledger version is not specified, the latest ledger version is used.
  tags:
    - Aptos API Endpoints
  security:
    - apiKey: []
  parameters:
    - name: address
      in: path
      required: true
      schema:
        type: string
        example: '0x1d8727df513fa2a8785d0834e40b34223daff1affc079574082baadb74b66ee4'
      description: Address of account with or without a 0x prefix.
    - name: resource_type
      in: path
      required: true
      schema:
        type: string
        example: 0x1::account::Account
      description: Name of the Move struct resource to retrieve (e.g. 0x1::account::Account).
    - name: ledger_version
      in: query
      required: false
      schema:
        type: string
      description: Ledger version to get the state of the account.
  responses:
    '200':
      description: The resource data for the specified type.
      content:
        application/json:
          schema:
            type: object
            properties:
              type:
                type: string
                description: String representation of a MoveStructTag (e.g. 0x1::account::Account).
              data:
                type: object
                additionalProperties: true
                description: JSON representation of Move struct data within the resource.
          examples:
            response:
              summary: Example of a single resource (Account)
              value:
                type: 0x1::account::Account
                data:
                  authentication_key: '0x1d8727df513fa2a8785d0834e40b34223daff1affc079574082baadb74b66ee4'
                  coin_register_events:
                    counter: '1'
                    guid:
                      id:
                        addr: '0x1d8727df513fa2a8785d0834e40b34223daff1affc079574082baadb74b66ee4'
                        creation_num: '0'
                  guid_creation_num: '4'
                  key_rotation_events:
                    counter: '0'
                    guid:
                      id:
                        addr: '0x1d8727df513fa2a8785d0834e40b34223daff1affc079574082baadb74b66ee4'
                        creation_num: '1'
                  rotation_capability_offer:
                    for:
                      vec: []
                  sequence_number: '83912'
                  signer_capability_offer:
                    for:
                      vec: []
```
