# suix_getCommitteeInfo

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

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

Retrieves the list of validator public keys and their voting power for the specified epoch. If no epoch is specified, the latest available epoch is used by default.


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

## Parameters

| Name | Type | Required | Description |
|------|------|----------|-------------|
| epoch | string | No | Epoch number to retrieve committee info for. Defaults to the latest epoch if not provided. |

## Result

**result** (object): Committee information for the specified or latest epoch.

## Example

### Response

```json
{
  "jsonrpc": "2.0",
  "result": {
    "epoch": "734",
    "validators": [
      [
        "jc/20VUECmVvSBmxMRG1LFdGqGunLzlfuv4uw4R9HoFA5iSnUf32tfIFC8cgXPnTAATJCwx0Cv/TJs5nPMKyOi0k1T4q/rKG38Zo/UBgCJ1tKxe3md02+Q0zLlSnozjU",
        "305"
      ],
      [
        "mfJe9h+AMrkUY2RgmCxcxvE07x3a52ZX8sv+wev8jQlzdAgN9vzw3Li8Sw2OCvXYDrv/K0xZn1T0LWMS38MUJ2B4wcw0fru+xRmL4lhRPzhrkw0CwnSagD4jMJVevRoQ",
        "37"
      ]
    ]
  },
  "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_getCommitteeInfo",
  "params": [
    "string"
  ]
}'
```

### JavaScript

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

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

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

```


## OpenRPC Method Specification

```yaml
name: suix_getCommitteeInfo
summary: Return the committee information for a specific epoch
description: |
  Retrieves the list of validator public keys and their voting power for the specified epoch. If no epoch is specified, the latest available epoch is used by default.
params:
  - name: epoch
    required: false
    description: Epoch number to retrieve committee info for. Defaults to the latest epoch if not provided.
    schema:
      type: string
result:
  name: result
  description: Committee information for the specified or latest epoch.
  schema:
    type: object
    properties:
      epoch:
        type: string
        description: The epoch number this committee is for.
      validators:
        type: array
        description: |
          A list of validator entries. Each entry is a 2-item array: [base64-encoded public key, voting power as string].
        items:
          type: array
          items:
            - type: string
              description: Base64-encoded public key of the validator.
            - type: string
              description: Voting power assigned to the validator.
examples:
  - name: Get latest committee info
    params: []
    result:
      name: result
      value:
        epoch: '734'
        validators:
          - - jc/20VUECmVvSBmxMRG1LFdGqGunLzlfuv4uw4R9HoFA5iSnUf32tfIFC8cgXPnTAATJCwx0Cv/TJs5nPMKyOi0k1T4q/rKG38Zo/UBgCJ1tKxe3md02+Q0zLlSnozjU
            - '305'
          - - mfJe9h+AMrkUY2RgmCxcxvE07x3a52ZX8sv+wev8jQlzdAgN9vzw3Li8Sw2OCvXYDrv/K0xZn1T0LWMS38MUJ2B4wcw0fru+xRmL4lhRPzhrkw0CwnSagD4jMJVevRoQ
            - '37'
```
