# getSlot
Solana API method that returns the slot that has reached the given or default commitment level (opens new window).
Parameters:
<object>
— (optional) the configuration object containing the following fields:commitment: <string>
— (optional) the commitment.minContextSlot: <number>
— (optional) the minimum slot that the request can be evaluated at.
Returns:
u64
— the current slot.
Example:
- Solana web3.js
- Solana.py
- cURL
import { Connection } from "@solana/web3.js"
const nodeUrl = "CHAINSTACK_NODE_URL"
const connect = new Connection(nodeUrl);
(async () => {
console.log(await connect.getSlot());
})();