Solana Integration Guide
Choose your preferred method of integration below. We provide examples for direct RPC calls, Yellowstone gRPC usage, Solana Web3.js integration, CLI commands, and API usage.
Connect to our free RPC endpoint:https://solana-rpc.parafi.tech
cURL
Use these commands directly in your terminal to test RPC calls with curl
:
// Get Epoch Info
curl https://solana-rpc.parafi.tech \
-X POST \
-H "Content-Type: application/json" \
-d '{"jsonrpc":"2.0","id":1,"method":"getEpochInfo"}'
// Get Account Info
curl https://solana-rpc.parafi.tech \
-X POST \
-H "Content-Type: application/json" \
-d '{"jsonrpc":"2.0","id":1,"method":"getAccountInfo","params":["YOUR_ACCOUNT_ADDRESS", {"encoding": "jsonParsed"}]}'
JavaScript/Node.js
Use the fetch
API or any HTTP client to make RPC calls:
const getBalance = async (address) => {
const response = await fetch('https://solana-rpc.parafi.tech', {
method: 'POST',
headers: { 'Content-Type': 'application/json' },
body: JSON.stringify({
jsonrpc: '2.0',
id: 1,
method: 'getBalance',
params: [address]
})
});
const data = await response.json();
return data.result;
};
Python
Use the requests
library to interact with the RPC endpoint:
import requests
def get_balance(address):
response = requests.post(
'https://solana-rpc.parafi.tech',
json={
"jsonrpc": "2.0",
"id": 1,
"method": "getBalance",
"params": [address]
}
)
return response.json()['result']