Sui GraphQL
Sui GraphQL API is available on Web3 API platform (opens in a new tab).
The Sui GraphQL RPC provides a flexible query interface for interacting with the Sui blockchain. Unlike JSON-RPC, GraphQL lets you request exactly the data you need in a single call — reducing overfetching and round trips.
With GraphQL, you can compose queries that combine objects, transactions, balances, checkpoints, and more into a single request. It supports pagination, filtering, and nested lookups, making it well suited for frontends, dashboards, and analytics tools.
Endpoint
| Network | Endpoint |
|---|---|
| Mainnet | https://rpc.ankr.com/http/sui_graphql |
For Premium users, append your token to the URL: https://rpc.ankr.com/http/sui_graphql/{your_token}
Request example
Query the latest checkpoint:
curl -X POST https://rpc.ankr.com/http/sui_graphql \
-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.ankr.com/http/sui_graphql \
-H 'Content-Type: application/json' \
-d '{
"query": "{ object(address: \"0x5\") { address version digest owner { __typename } } }"
}'Get address balances
curl -X POST https://rpc.ankr.com/http/sui_graphql \
-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.