# Sui GraphQL

> Sui GraphQL API is available on [Web3 API platform](https://crypto-chief.com/rpc/sui/).

*Sui GraphQL RPC* provides a flexible, schema-driven query interface for Sui blockchain data. Unlike JSON-RPC — which requires one call per resource type — GraphQL lets you request exactly the fields you need across objects, transactions, balances, and checkpoints in a single round trip. The schema supports filtering, cursor-based pagination, and deeply nested lookups, making it ideal for frontends, dashboards, and analytics tooling.

### Endpoint

| Network | Endpoint                                          |
| ------- | ------------------------------------------------- |
| Mainnet | `https://rpc.crypto-chief.com/sui/{YOUR_API_KEY}` |

For Premium users, append your token to the URL: `https://rpc.crypto-chief.com/sui/{YOUR_API_KEY}/{YOUR_API_KEY}`

***

### Request example

Query the latest checkpoint:

```
curl -X POST https://rpc.crypto-chief.com/sui/{YOUR_API_KEY} \
-H 'Content-Type: application/json' \
-d '{
  "query": "{ checkpoint { sequenceNumber digest timestamp } }"
}'
```

### Response example

```
{
  "data": {
    "checkpoint": {
      "sequenceNumber": 214225619,
      "digest": "GNSviTUX6DXkiCPKYDo1uihJsm5oRcjtvrkT8mVQyay8",
      "timestamp": "2025-03-24T12:00:00Z"
    }
  }
}
```

***

### Query examples

#### Get object by ID

```
curl -X POST https://rpc.crypto-chief.com/sui/{YOUR_API_KEY} \
-H 'Content-Type: application/json' \
-d '{
  "query": "{ object(address: \"0x5\") { address version digest owner { __typename } } }"
}'
```

#### Get address balances

```
curl -X POST https://rpc.crypto-chief.com/sui/{YOUR_API_KEY} \
-H 'Content-Type: application/json' \
-d '{
  "query": "{ address(address: \"0xYOUR_ADDRESS\") { balance { totalBalance coinType { repr } } } }"
}'
```

***

### Key features

* **Composable queries** — request multiple related resources in a single call.
* **Pagination** — default 50 items per page, up to 200 for multi-get operations.
* **Filtering** — narrow results by type, owner, checkpoint range, and more.
* **No overfetching** — get only the fields you need.

### Further reading

* [Sui GraphQL reference](https://docs.sui.io/references/sui-graphql)
* [Sui GraphQL RPC concepts](https://docs.sui.io/concepts/data-access/graphql-rpc)


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs-rpc.crypto-chief.com/chains/sui/sui-graphql.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
