Skip to navigation

Solana Quickstart

The Solana API lets applications connect to a Solana node that is part of the Solana blockchain. Developers can interact with onchain data using the endpoints provided by the API.

Networks

  • Mainnet (HTTPS and WSS)

API Querying

Request example

Use getBlockHeight to request the latest Solana block height from the Solana HTTPS endpoint:

curl https://rpc.ankr.com/solana/<apiKey> \
-H "Content-Type: application/json" \
-d '{
"jsonrpc": "2.0",
"method": "getBlockHeight",
"params": [],
"id": 1
}'

Response example

A successful response returns the latest block height as an integer:

{
"jsonrpc": "2.0",
"id": 1,
"result": 342093147
}