# sui_multiGetObjects

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

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

Retrieves on-chain metadata and content for multiple object IDs. The request may include display, owner, and type information as specified via options.


Reference: https://www.alchemy.com/docs/chains/sui/sui-api-endpoints/sui-multi-get-objects

## Parameters

| Name | Type | Required | Description |
|------|------|----------|-------------|
| object_ids | string[] | Yes | The IDs of the queried objects. |
| options | object | No | Options for specifying the content to be returned. |

## Result

**result** (object[]): A list of object data returned from the chain.

## Example

### Request

```json
{
  "jsonrpc": "2.0",
  "method": "sui_multiGetObjects",
  "params": [
    [
      "0x77b3482580ee8d5bdc5b824808df54bfec4fc817622e5add0e48f749f01def98",
      "0x9060d87664c26a3f9a509228c21b16dc6797cf787c839a07edc03e6338421091",
      "0xb37379c527753c5c8ab783f697e7b61439368cd75ebe63d633af32ffb4a022d1"
    ],
    {
      "showType": true,
      "showOwner": true,
      "showPreviousTransaction": true,
      "showDisplay": false,
      "showContent": true,
      "showBcs": false,
      "showStorageRebate": true
    }
  ],
  "id": 1
}
```

### Response

```json
{
  "jsonrpc": "2.0",
  "result": [
    {
      "data": {
        "objectId": "0x77b3482580ee8d5bdc5b824808df54bfec4fc817622e5add0e48f749f01def98",
        "version": "1",
        "digest": "2QwXW3qzMEZPAyyP9VHtXbC2tp7iomypQc5XnkyPsu5d",
        "type": "0x2::coin::Coin<0x2::sui::SUI>",
        "owner": {
          "AddressOwner": "0x504d411325e3c7f89d412044fe99007efb0f94f1e64d2e8090c619a39299d87e"
        },
        "previousTransaction": "GcjpL3GJBoiqc7RNwfV1R4411dFPYz4hTNyXQchsq6Sa",
        "storageRebate": "100",
        "content": {
          "dataType": "moveObject",
          "type": "0x2::coin::Coin<0x2::sui::SUI>",
          "hasPublicTransfer": true,
          "fields": {
            "balance": "100000000",
            "id": {
              "id": "0x77b3482580ee8d5bdc5b824808df54bfec4fc817622e5add0e48f749f01def98"
            }
          }
        }
      }
    }
  ],
  "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": "sui_multiGetObjects",
  "params": [
    [
      "0x77b3482580ee8d5bdc5b824808df54bfec4fc817622e5add0e48f749f01def98",
      "0x9060d87664c26a3f9a509228c21b16dc6797cf787c839a07edc03e6338421091",
      "0xb37379c527753c5c8ab783f697e7b61439368cd75ebe63d633af32ffb4a022d1"
    ],
    {
      "showType": true,
      "showOwner": true,
      "showPreviousTransaction": true,
      "showDisplay": false,
      "showContent": true,
      "showBcs": false,
      "showStorageRebate": true
    }
  ]
}'
```

### JavaScript

```javascript
const options = {
  method: 'POST',
  headers: {'Content-Type': 'application/json'},
  body: JSON.stringify({
    jsonrpc: '2.0',
    id: 1,
    method: 'sui_multiGetObjects',
    params: [
      [
        '0x77b3482580ee8d5bdc5b824808df54bfec4fc817622e5add0e48f749f01def98',
        '0x9060d87664c26a3f9a509228c21b16dc6797cf787c839a07edc03e6338421091',
        '0xb37379c527753c5c8ab783f697e7b61439368cd75ebe63d633af32ffb4a022d1'
      ],
      {
        showType: true,
        showOwner: true,
        showPreviousTransaction: true,
        showDisplay: false,
        showContent: true,
        showBcs: false,
        showStorageRebate: true
      }
    ]
  })
};

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": "sui_multiGetObjects",
    "params": [
        ["0x77b3482580ee8d5bdc5b824808df54bfec4fc817622e5add0e48f749f01def98", "0x9060d87664c26a3f9a509228c21b16dc6797cf787c839a07edc03e6338421091", "0xb37379c527753c5c8ab783f697e7b61439368cd75ebe63d633af32ffb4a022d1"],
        {
            "showType": True,
            "showOwner": True,
            "showPreviousTransaction": True,
            "showDisplay": False,
            "showContent": True,
            "showBcs": False,
            "showStorageRebate": True
        }
    ]
}
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\": \"sui_multiGetObjects\",\n  \"params\": [\n    [\n      \"0x77b3482580ee8d5bdc5b824808df54bfec4fc817622e5add0e48f749f01def98\",\n      \"0x9060d87664c26a3f9a509228c21b16dc6797cf787c839a07edc03e6338421091\",\n      \"0xb37379c527753c5c8ab783f697e7b61439368cd75ebe63d633af32ffb4a022d1\"\n    ],\n    {\n      \"showType\": true,\n      \"showOwner\": true,\n      \"showPreviousTransaction\": true,\n      \"showDisplay\": false,\n      \"showContent\": true,\n      \"showBcs\": false,\n      \"showStorageRebate\": true\n    }\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\": \"sui_multiGetObjects\",\n  \"params\": [\n    [\n      \"0x77b3482580ee8d5bdc5b824808df54bfec4fc817622e5add0e48f749f01def98\",\n      \"0x9060d87664c26a3f9a509228c21b16dc6797cf787c839a07edc03e6338421091\",\n      \"0xb37379c527753c5c8ab783f697e7b61439368cd75ebe63d633af32ffb4a022d1\"\n    ],\n    {\n      \"showType\": true,\n      \"showOwner\": true,\n      \"showPreviousTransaction\": true,\n      \"showDisplay\": false,\n      \"showContent\": true,\n      \"showBcs\": false,\n      \"showStorageRebate\": true\n    }\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\": \"sui_multiGetObjects\",\n  \"params\": [\n    [\n      \"0x77b3482580ee8d5bdc5b824808df54bfec4fc817622e5add0e48f749f01def98\",\n      \"0x9060d87664c26a3f9a509228c21b16dc6797cf787c839a07edc03e6338421091\",\n      \"0xb37379c527753c5c8ab783f697e7b61439368cd75ebe63d633af32ffb4a022d1\"\n    ],\n    {\n      \"showType\": true,\n      \"showOwner\": true,\n      \"showPreviousTransaction\": true,\n      \"showDisplay\": false,\n      \"showContent\": true,\n      \"showBcs\": false,\n      \"showStorageRebate\": true\n    }\n  ]\n}", false);
var response = await client.PostAsync(request);

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

```


## OpenRPC Method Specification

```yaml
name: sui_multiGetObjects
summary: Return the object data for a list of objects
description: |
  Retrieves on-chain metadata and content for multiple object IDs. The request may include display, owner, and type information as specified via options.
params:
  - name: object_ids
    required: true
    description: The IDs of the queried objects.
    schema:
      type: array
      items:
        type: string
  - name: options
    required: false
    description: Options for specifying the content to be returned.
    schema:
      type: object
      properties:
        showType:
          type: boolean
        showOwner:
          type: boolean
        showPreviousTransaction:
          type: boolean
        showDisplay:
          type: boolean
        showContent:
          type: boolean
        showBcs:
          type: boolean
        showStorageRebate:
          type: boolean
result:
  name: result
  description: A list of object data returned from the chain.
  schema:
    type: array
    items:
      type: object
      properties:
        data:
          type: object
          properties:
            objectId:
              type: string
            version:
              type: string
            digest:
              type: string
            type:
              type: string
            owner:
              type: object
              properties:
                AddressOwner:
                  type: string
            previousTransaction:
              type: string
            storageRebate:
              type: string
            content:
              type: object
              properties:
                dataType:
                  type: string
                type:
                  type: string
                hasPublicTransfer:
                  type: boolean
                fields:
                  type: object
                  properties:
                    balance:
                      type: string
                    id:
                      type: object
                      properties:
                        id:
                          type: string
examples:
  - name: Fetch multiple objects
    params:
      - name: object_ids
        value:
          - '0x77b3482580ee8d5bdc5b824808df54bfec4fc817622e5add0e48f749f01def98'
          - '0x9060d87664c26a3f9a509228c21b16dc6797cf787c839a07edc03e6338421091'
          - '0xb37379c527753c5c8ab783f697e7b61439368cd75ebe63d633af32ffb4a022d1'
      - name: options
        value:
          showType: true
          showOwner: true
          showPreviousTransaction: true
          showDisplay: false
          showContent: true
          showBcs: false
          showStorageRebate: true
    result:
      name: result
      value:
        - data:
            objectId: '0x77b3482580ee8d5bdc5b824808df54bfec4fc817622e5add0e48f749f01def98'
            version: '1'
            digest: 2QwXW3qzMEZPAyyP9VHtXbC2tp7iomypQc5XnkyPsu5d
            type: 0x2::coin::Coin<0x2::sui::SUI>
            owner:
              AddressOwner: '0x504d411325e3c7f89d412044fe99007efb0f94f1e64d2e8090c619a39299d87e'
            previousTransaction: GcjpL3GJBoiqc7RNwfV1R4411dFPYz4hTNyXQchsq6Sa
            storageRebate: '100'
            content:
              dataType: moveObject
              type: 0x2::coin::Coin<0x2::sui::SUI>
              hasPublicTransfer: true
              fields:
                balance: '100000000'
                id:
                  id: '0x77b3482580ee8d5bdc5b824808df54bfec4fc817622e5add0e48f749f01def98'
```
