# sui_tryMultiGetPastObjects

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

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

Returns the object data for each requested version. No guarantee is provided that historical versions will be available due to node-specific pruning behavior.


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

## Parameters

| Name | Type | Required | Description |
|------|------|----------|-------------|
| past_objects | object[] | Yes | A list of objects and versions to retrieve. |
| options | object | No | Options to specify which object fields to include in the response. |

## Result

**result** (object[]): A list of past object results corresponding to the input requests.

## Example

### Request

```json
{
  "jsonrpc": "2.0",
  "method": "sui_tryMultiGetPastObjects",
  "params": [
    [
      {
        "objectId": "0x38b3186a7bb26a1ab2c982a0a9b482aa70f5a010fffc60f20194ef0f597474e8",
        "version": "4"
      },
      {
        "objectId": "0xceaf9ee4582d3a233101e322a22cb2a5bea2e681ea5af4e59bd1abb0bb4fcb27",
        "version": "12"
      }
    ],
    {
      "showType": true,
      "showOwner": true,
      "showPreviousTransaction": true,
      "showDisplay": false,
      "showContent": true,
      "showBcs": false,
      "showStorageRebate": true
    }
  ],
  "id": 1
}
```

### Response

```json
{
  "jsonrpc": "2.0",
  "result": [
    {
      "status": "VersionFound",
      "details": {
        "objectId": "0x38b3186a7bb26a1ab2c982a0a9b482aa70f5a010fffc60f20194ef0f597474e8",
        "version": "4",
        "digest": "hvBGBXvKVhC7XYgVPujuiLjxASR6UGAkSFrCRtVxX1F",
        "type": "0x2::coin::Coin<0x2::sui::SUI>",
        "owner": {
          "AddressOwner": "0x47866ff92885a3c21a7703f564721c198308aa0c71b771ada6b96c16fc9c0fa7"
        },
        "previousTransaction": "6heEteheiLZcS8iVNXsNUnU7oVjzT7UHYzprGcuWQ4gG",
        "storageRebate": "100",
        "content": {
          "dataType": "moveObject",
          "type": "0x2::coin::Coin<0x2::sui::SUI>",
          "hasPublicTransfer": true,
          "fields": {
            "balance": "10000",
            "id": {
              "id": "0x38b3186a7bb26a1ab2c982a0a9b482aa70f5a010fffc60f20194ef0f597474e8"
            }
          }
        }
      }
    },
    {
      "status": "VersionFound",
      "details": {
        "objectId": "0xceaf9ee4582d3a233101e322a22cb2a5bea2e681ea5af4e59bd1abb0bb4fcb27",
        "version": "12",
        "digest": "B5z4YkAgTi78fdxMbxG3fv2V4YBkhpc8PRCPz8MzLtbf",
        "type": "0x2::coin::Coin<0x2::sui::SUI>",
        "owner": {
          "AddressOwner": "0xa6ced287081357950315a8842c3870f2d83f980fe0996a92d351d6749a0a0b47"
        },
        "previousTransaction": "BLN2oUCHmwmaAXXCxbojTcozUqZYfvXx4Bkgi7xcgyVc",
        "storageRebate": "100",
        "content": {
          "dataType": "moveObject",
          "type": "0x2::coin::Coin<0x2::sui::SUI>",
          "hasPublicTransfer": true,
          "fields": {
            "balance": "20000",
            "id": {
              "id": "0x38b3186a7bb26a1ab2c982a0a9b482aa70f5a010fffc60f20194ef0f597474e8"
            }
          }
        }
      }
    }
  ],
  "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_tryMultiGetPastObjects",
  "params": [
    [
      {
        "objectId": "0x38b3186a7bb26a1ab2c982a0a9b482aa70f5a010fffc60f20194ef0f597474e8",
        "version": "4"
      },
      {
        "objectId": "0xceaf9ee4582d3a233101e322a22cb2a5bea2e681ea5af4e59bd1abb0bb4fcb27",
        "version": "12"
      }
    ],
    {
      "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_tryMultiGetPastObjects',
    params: [
      [
        {
          objectId: '0x38b3186a7bb26a1ab2c982a0a9b482aa70f5a010fffc60f20194ef0f597474e8',
          version: '4'
        },
        {
          objectId: '0xceaf9ee4582d3a233101e322a22cb2a5bea2e681ea5af4e59bd1abb0bb4fcb27',
          version: '12'
        }
      ],
      {
        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_tryMultiGetPastObjects",
    "params": [
        [
            {
                "objectId": "0x38b3186a7bb26a1ab2c982a0a9b482aa70f5a010fffc60f20194ef0f597474e8",
                "version": "4"
            },
            {
                "objectId": "0xceaf9ee4582d3a233101e322a22cb2a5bea2e681ea5af4e59bd1abb0bb4fcb27",
                "version": "12"
            }
        ],
        {
            "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_tryMultiGetPastObjects\",\n  \"params\": [\n    [\n      {\n        \"objectId\": \"0x38b3186a7bb26a1ab2c982a0a9b482aa70f5a010fffc60f20194ef0f597474e8\",\n        \"version\": \"4\"\n      },\n      {\n        \"objectId\": \"0xceaf9ee4582d3a233101e322a22cb2a5bea2e681ea5af4e59bd1abb0bb4fcb27\",\n        \"version\": \"12\"\n      }\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_tryMultiGetPastObjects\",\n  \"params\": [\n    [\n      {\n        \"objectId\": \"0x38b3186a7bb26a1ab2c982a0a9b482aa70f5a010fffc60f20194ef0f597474e8\",\n        \"version\": \"4\"\n      },\n      {\n        \"objectId\": \"0xceaf9ee4582d3a233101e322a22cb2a5bea2e681ea5af4e59bd1abb0bb4fcb27\",\n        \"version\": \"12\"\n      }\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_tryMultiGetPastObjects\",\n  \"params\": [\n    [\n      {\n        \"objectId\": \"0x38b3186a7bb26a1ab2c982a0a9b482aa70f5a010fffc60f20194ef0f597474e8\",\n        \"version\": \"4\"\n      },\n      {\n        \"objectId\": \"0xceaf9ee4582d3a233101e322a22cb2a5bea2e681ea5af4e59bd1abb0bb4fcb27\",\n        \"version\": \"12\"\n      }\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_tryMultiGetPastObjects
summary: Get multiple objects at specified past versions
description: |
  Returns the object data for each requested version. No guarantee is provided that historical versions will be available due to node-specific pruning behavior.
params:
  - name: past_objects
    required: true
    description: A list of objects and versions to retrieve.
    schema:
      type: array
      items:
        type: object
        required:
          - objectId
          - version
        properties:
          objectId:
            type: string
            description: The ID of the object.
          version:
            type: string
            description: The version number of the object.
  - name: options
    required: false
    description: Options to specify which object fields to include in the response.
    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 past object results corresponding to the input requests.
  schema:
    type: array
    items:
      type: object
      properties:
        status:
          type: string
          description: Retrieval status, e.g. "VersionFound" or "ObjectNotExists".
        details:
          oneOf:
            - type: string
            - 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: Multi get past object versions
    params:
      - name: past_objects
        value:
          - objectId: '0x38b3186a7bb26a1ab2c982a0a9b482aa70f5a010fffc60f20194ef0f597474e8'
            version: '4'
          - objectId: '0xceaf9ee4582d3a233101e322a22cb2a5bea2e681ea5af4e59bd1abb0bb4fcb27'
            version: '12'
      - name: options
        value:
          showType: true
          showOwner: true
          showPreviousTransaction: true
          showDisplay: false
          showContent: true
          showBcs: false
          showStorageRebate: true
    result:
      name: result
      value:
        - status: VersionFound
          details:
            objectId: '0x38b3186a7bb26a1ab2c982a0a9b482aa70f5a010fffc60f20194ef0f597474e8'
            version: '4'
            digest: hvBGBXvKVhC7XYgVPujuiLjxASR6UGAkSFrCRtVxX1F
            type: 0x2::coin::Coin<0x2::sui::SUI>
            owner:
              AddressOwner: '0x47866ff92885a3c21a7703f564721c198308aa0c71b771ada6b96c16fc9c0fa7'
            previousTransaction: 6heEteheiLZcS8iVNXsNUnU7oVjzT7UHYzprGcuWQ4gG
            storageRebate: '100'
            content:
              dataType: moveObject
              type: 0x2::coin::Coin<0x2::sui::SUI>
              hasPublicTransfer: true
              fields:
                balance: '10000'
                id:
                  id: '0x38b3186a7bb26a1ab2c982a0a9b482aa70f5a010fffc60f20194ef0f597474e8'
        - status: VersionFound
          details:
            objectId: '0xceaf9ee4582d3a233101e322a22cb2a5bea2e681ea5af4e59bd1abb0bb4fcb27'
            version: '12'
            digest: B5z4YkAgTi78fdxMbxG3fv2V4YBkhpc8PRCPz8MzLtbf
            type: 0x2::coin::Coin<0x2::sui::SUI>
            owner:
              AddressOwner: '0xa6ced287081357950315a8842c3870f2d83f980fe0996a92d351d6749a0a0b47'
            previousTransaction: BLN2oUCHmwmaAXXCxbojTcozUqZYfvXx4Bkgi7xcgyVc
            storageRebate: '100'
            content:
              dataType: moveObject
              type: 0x2::coin::Coin<0x2::sui::SUI>
              hasPublicTransfer: true
              fields:
                balance: '20000'
                id:
                  id: '0x38b3186a7bb26a1ab2c982a0a9b482aa70f5a010fffc60f20194ef0f597474e8'
```
