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:

1{
2 "jsonrpc": "2.0",
3 "id": 1,
4 "result": 342093147
5}