# suix_getDynamicFields

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

POST https://sui-mainnet.g.alchemy.com/v2/{apiKey}

Returns a paginated list of dynamic field objects owned by a specified parent object ID. Dynamic fields allow objects to store flexible, extensible key-value mappings.


Reference: https://www.alchemy.com/docs/chains/sui/sui-api-endpoints/suix-get-dynamic-fields

## Parameters

| Name | Type | Required | Description |
|------|------|----------|-------------|
| parent_object_id | string | Yes | The ID of the parent object that owns the dynamic fields. |
| cursor | string | No | An optional paging cursor (ObjectID). If provided, returns items after this ID. |
| limit | integer | No | Maximum number of items per page. |

## Result

**result** (object): A page of dynamic fields owned by the object.

## Example

### Request

```json
{
  "jsonrpc": "2.0",
  "method": "suix_getDynamicFields",
  "params": [
    "0xb3ba434a82d446c530044680cc4679eb59252e50e4435eddf7f6b959f39a4f7d",
    "0xba483c73a9b79bcc592cc5f163465ff1bc5c5d2e",
    2
  ],
  "id": 1
}
```

### Response

```json
{
  "jsonrpc": "2.0",
  "result": {
    "data": [],
    "nextCursor": "0x000000000000000000000000ba483c73a9b79bcc592cc5f163465ff1bc5c5d2e",
    "hasNextPage": false
  },
  "id": 1
}
```

## Code Examples

### cURL

```bash
curl --request POST \
  --url https://sui-mainnet.g.alchemy.com/v2/docs-demo \
  --header 'Content-Type: application/json' \
  --data '{
  "jsonrpc": "2.0",
  "id": 1,
  "method": "suix_getDynamicFields",
  "params": [
    "0xb3ba434a82d446c530044680cc4679eb59252e50e4435eddf7f6b959f39a4f7d",
    "0xba483c73a9b79bcc592cc5f163465ff1bc5c5d2e",
    2
  ]
}'
```

### JavaScript

```javascript
const options = {
  method: 'POST',
  headers: {'Content-Type': 'application/json'},
  body: JSON.stringify({
    jsonrpc: '2.0',
    id: 1,
    method: 'suix_getDynamicFields',
    params: [
      '0xb3ba434a82d446c530044680cc4679eb59252e50e4435eddf7f6b959f39a4f7d',
      '0xba483c73a9b79bcc592cc5f163465ff1bc5c5d2e',
      2
    ]
  })
};

fetch('https://sui-mainnet.g.alchemy.com/v2/docs-demo', options)
  .then(res => res.json())
  .then(res => console.log(res))
  .catch(err => console.error(err));
```

### Python

```python
import requests

url = "https://sui-mainnet.g.alchemy.com/v2/docs-demo"

payload = {
    "jsonrpc": "2.0",
    "id": 1,
    "method": "suix_getDynamicFields",
    "params": ["0xb3ba434a82d446c530044680cc4679eb59252e50e4435eddf7f6b959f39a4f7d", "0xba483c73a9b79bcc592cc5f163465ff1bc5c5d2e", 2]
}
headers = {"Content-Type": "application/json"}

response = requests.post(url, json=payload, headers=headers)

print(response.text)
```

### Go

```go
package main

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

func main() {

	url := "https://sui-mainnet.g.alchemy.com/v2/docs-demo"

	payload := strings.NewReader("{\n  \"jsonrpc\": \"2.0\",\n  \"id\": 1,\n  \"method\": \"suix_getDynamicFields\",\n  \"params\": [\n    \"0xb3ba434a82d446c530044680cc4679eb59252e50e4435eddf7f6b959f39a4f7d\",\n    \"0xba483c73a9b79bcc592cc5f163465ff1bc5c5d2e\",\n    2\n  ]\n}")

	req, _ := http.NewRequest("POST", url, payload)

	req.Header.Add("Content-Type", "application/json")

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

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

	fmt.Println(string(body))

}
```

### Java

```java
HttpResponse<String> response = Unirest.post("https://sui-mainnet.g.alchemy.com/v2/docs-demo")
  .header("Content-Type", "application/json")
  .body("{\n  \"jsonrpc\": \"2.0\",\n  \"id\": 1,\n  \"method\": \"suix_getDynamicFields\",\n  \"params\": [\n    \"0xb3ba434a82d446c530044680cc4679eb59252e50e4435eddf7f6b959f39a4f7d\",\n    \"0xba483c73a9b79bcc592cc5f163465ff1bc5c5d2e\",\n    2\n  ]\n}")
  .asString();
```

### C#

```csharp
using RestSharp;


var options = new RestClientOptions("https://sui-mainnet.g.alchemy.com/v2/docs-demo");
var client = new RestClient(options);
var request = new RestRequest("");
request.AddJsonBody("{\n  \"jsonrpc\": \"2.0\",\n  \"id\": 1,\n  \"method\": \"suix_getDynamicFields\",\n  \"params\": [\n    \"0xb3ba434a82d446c530044680cc4679eb59252e50e4435eddf7f6b959f39a4f7d\",\n    \"0xba483c73a9b79bcc592cc5f163465ff1bc5c5d2e\",\n    2\n  ]\n}", false);
var response = await client.PostAsync(request);

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

```


## OpenRPC Method Specification

```yaml
name: suix_getDynamicFields
summary: Get dynamic fields of an object
description: |
  Returns a paginated list of dynamic field objects owned by a specified parent object ID. Dynamic fields allow objects to store flexible, extensible key-value mappings.
params:
  - name: parent_object_id
    required: true
    description: The ID of the parent object that owns the dynamic fields.
    schema:
      type: string
      description: A 32-byte hexadecimal Sui address (e.g., 0x...).
  - name: cursor
    required: false
    description: An optional paging cursor (ObjectID). If provided, returns items after this ID.
    schema:
      type: string
  - name: limit
    required: false
    description: Maximum number of items per page.
    schema:
      type: integer
result:
  name: result
  description: A page of dynamic fields owned by the object.
  schema:
    type: object
    required:
      - data
      - nextCursor
      - hasNextPage
    properties:
      data:
        type: array
        description: A list of results.
        items:
          type: object
      nextCursor:
        description: Cursor for fetching the next page.
        type: string
        nullable: true
      hasNextPage:
        type: boolean
examples:
  - name: Get dynamic fields by parent ID
    params:
      - name: parent_object_id
        value: '0xb3ba434a82d446c530044680cc4679eb59252e50e4435eddf7f6b959f39a4f7d'
      - name: cursor
        value: '0xba483c73a9b79bcc592cc5f163465ff1bc5c5d2e'
      - name: limit
        value: 2
    result:
      name: result
      value:
        data: []
        nextCursor: '0x000000000000000000000000ba483c73a9b79bcc592cc5f163465ff1bc5c5d2e'
        hasNextPage: false
```
