TriportRPC

getSlot

Last updated:

`getSlot` returns the current slot — a single `u64` integer — that has reached the requested commitment level. It is the cheapest method on the Solana RPC surface and carries no parameters in its simplest form, which makes it the go-to **health check / liveness probe** for confirming that your endpoint and API key are working and that the node is keeping up with the cluster.

The value you get back depends on the **commitment** level. With the default (`finalized`) you receive the highest slot the cluster has finalized; with `confirmed` or `processed` you get a higher, more recent slot that has had less time to settle. Use a lower commitment when you want the freshest possible slot number and a higher one when you need certainty that the slot will not be rolled back.

Pair it with `minContextSlot` when you want the call to fail fast unless the node has already progressed to at least a given slot — useful for detecting a lagging backend.

Parameters

getSlot parameters
NameTypeRequiredDescription
configCommitmentConfigNo

Returns

getSlot return value
FieldType
resultobject

Examples

curl https://<your-endpoint>/ \
  -X POST -H 'Content-Type: application/json' \
  -d '{"jsonrpc":"2.0","id":1,"method":"getSlot","params":[]}'
const res = await fetch("https://<your-endpoint>/", {
  method: "POST",
  headers: { "Content-Type": "application/json" },
  body: JSON.stringify({
  "id": 1,
  "method": "getSlot",
  "params": [],
  "jsonrpc": "2.0"
}),
});
const data = await res.json();
import requests
resp = requests.post("https://<your-endpoint>/", json={"id":1,"method":"getSlot","params":[],"jsonrpc":"2.0"})
print(resp.json())
{
  "id": 1,
  "result": 427699341,
  "jsonrpc": "2.0"
}

Usage

  1. Transport: HTTP (JSON-RPC).
  2. Networks: mainnet, devnet, testnet.
  3. Credit cost: 1 per call.

FAQ

What does getSlot do?
Returns the slot that has reached the given (or default) commitment level on Solana.
How many credits does getSlot cost?
getSlot costs 1 credit(s) per call on Triport by default.
Is getSlot available over WebSocket?
getSlot is an HTTP JSON-RPC method.