# suix_getStakesByIds

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

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

Returns information about one or more staking positions specified by their `stakedSuiId`. If a stake has been withdrawn, its status will be `"Unstaked"`.


Reference: https://www.alchemy.com/docs/chains/sui/sui-api-endpoints/suix-get-stakes-by-ids

## Parameters

| Name | Type | Required | Description |
|------|------|----------|-------------|
| staked_sui_ids | string[] | Yes | A list of object IDs representing staked SUI positions. |

## Result

**result** (object): One or more delegated stake entries grouped under their validator and pool.

## Example

### Request

```json
{
  "jsonrpc": "2.0",
  "method": "suix_getStakesByIds",
  "params": [
    [
      "0xa6379c19b3aa9aa878fc1deaf69c1dbb1de4224de8b62de04e4962b593e037e9"
    ]
  ],
  "id": 1
}
```

### Response

```json
{
  "jsonrpc": "2.0",
  "result": {
    "validatorAddress": "0x754eb2eed23e6c6bb32c89fe1f21ab588374445e72e0402aea014b2956105799",
    "stakingPool": "0x63ee67e81398729f87d81d62f399c041b0f8d0938923ea7e3917608ee62df437",
    "stakes": [
      {
        "stakedSuiId": "0x378423de90ed03b694cecf443c72b5387b29a731d26d98108d7abc4902107d7d",
        "stakeRequestEpoch": "62",
        "stakeActiveEpoch": "63",
        "principal": "200000000000",
        "status": "Active",
        "estimatedReward": "520000000"
      },
      {
        "stakedSuiId": "0x6a8e0f8fea6fda5488462e58724c034462b6064a08845e2ae2942fe7c4ee816d",
        "stakeRequestEpoch": "244",
        "stakeActiveEpoch": "245",
        "principal": "200000000000",
        "status": "Unstaked"
      }
    ]
  },
  "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_getStakesByIds",
  "params": [
    [
      "0xa6379c19b3aa9aa878fc1deaf69c1dbb1de4224de8b62de04e4962b593e037e9"
    ]
  ]
}'
```

### JavaScript

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

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_getStakesByIds",
    "params": [["0xa6379c19b3aa9aa878fc1deaf69c1dbb1de4224de8b62de04e4962b593e037e9"]]
}
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_getStakesByIds\",\n  \"params\": [\n    [\n      \"0xa6379c19b3aa9aa878fc1deaf69c1dbb1de4224de8b62de04e4962b593e037e9\"\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\": \"suix_getStakesByIds\",\n  \"params\": [\n    [\n      \"0xa6379c19b3aa9aa878fc1deaf69c1dbb1de4224de8b62de04e4962b593e037e9\"\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\": \"suix_getStakesByIds\",\n  \"params\": [\n    [\n      \"0xa6379c19b3aa9aa878fc1deaf69c1dbb1de4224de8b62de04e4962b593e037e9\"\n    ]\n  ]\n}", false);
var response = await client.PostAsync(request);

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

```


## OpenRPC Method Specification

```yaml
name: suix_getStakesByIds
summary: Governance Read API - Return one or more [DelegatedStake]
description: |
  Returns information about one or more staking positions specified by their `stakedSuiId`. If a stake has been withdrawn, its status will be `"Unstaked"`.
params:
  - name: staked_sui_ids
    required: true
    description: A list of object IDs representing staked SUI positions.
    schema:
      type: array
      items:
        type: string
result:
  name: result
  description: One or more delegated stake entries grouped under their validator and pool.
  schema:
    type: object
    properties:
      validatorAddress:
        type: string
        description: Sui address of the validator associated with the stake.
      stakingPool:
        type: string
        description: Object ID of the staking pool linked to this validator.
      stakes:
        type: array
        description: List of individual delegated stake objects.
        items:
          type: object
          properties:
            stakedSuiId:
              type: string
              description: Object ID representing the staked SUI coin.
            stakeRequestEpoch:
              type: string
              description: Epoch during which the stake was requested.
            stakeActiveEpoch:
              type: string
              description: Epoch when the stake became or will become active.
            principal:
              type: string
              description: Amount of SUI staked.
            status:
              type: string
              description: Stake status - Active, Pending, or Unstaked.
            estimatedReward:
              type: string
              nullable: true
              description: Estimated reward for the stake if applicable.
examples:
  - name: Get stakes by ID
    params:
      - name: staked_sui_ids
        value:
          - '0xa6379c19b3aa9aa878fc1deaf69c1dbb1de4224de8b62de04e4962b593e037e9'
    result:
      name: result
      value:
        validatorAddress: '0x754eb2eed23e6c6bb32c89fe1f21ab588374445e72e0402aea014b2956105799'
        stakingPool: '0x63ee67e81398729f87d81d62f399c041b0f8d0938923ea7e3917608ee62df437'
        stakes:
          - stakedSuiId: '0x378423de90ed03b694cecf443c72b5387b29a731d26d98108d7abc4902107d7d'
            stakeRequestEpoch: '62'
            stakeActiveEpoch: '63'
            principal: '200000000000'
            status: Active
            estimatedReward: '520000000'
          - stakedSuiId: '0x6a8e0f8fea6fda5488462e58724c034462b6064a08845e2ae2942fe7c4ee816d'
            stakeRequestEpoch: '244'
            stakeActiveEpoch: '245'
            principal: '200000000000'
            status: Unstaked
```
