POST
/
getBlockTime
curl --request POST \
  --url https://mainnet.helius-rpc.com/ \
  --header 'Content-Type: application/json' \
  --data '{
  "jsonrpc": "2.0",
  "id": "1",
  "method": "getBlockTime",
  "params": [
    5
  ]
}'
{
  "jsonrpc": "2.0",
  "id": "<string>",
  "result": 1574721591
}

Authorizations

api-key
string
query
required

Your Helius API key. You can get one for free in the dashboard.

Body

application/json
jsonrpc
enum<string>
default:2.0
required

The JSON-RPC protocol version.

Available options:
2.0
Example:

"2.0"

id
string
default:1
required

A unique identifier for the request.

Example:

"1"

method
enum<string>
default:getBlockTime
required

The name of the RPC method to invoke.

Available options:
getBlockTime
params
integer[]
required

Parameters for the request.

Block slot number to retrieve the corresponding timestamp for.

Response

Successfully retrieved block time.

jsonrpc
enum<string>
Available options:
2.0
id
string
result
integer

Unix timestamp (seconds since the Unix epoch) when this specific Solana block was produced by a validator.

Example:

1574721591