FluxRPC Quickstart: Query Solana in 5 Minutes

Published: (February 1, 2026 at 04:57 AM EST)
3 min read
Source: Dev.to

Source: Dev.to

Cover image for FluxRPC Quickstart: Query Solana in 5 Minutes

Shivam Soni

You want to read data from Solana. This guide gets you there in 5 minutes.

TL;DR

TypeScript

import { Connection, PublicKey, LAMPORTS_PER_SOL } from '@solana/web3.js';

const connection = new Connection('https://eu.fluxrpc.com?key=YOUR_API_KEY', 'confirmed');
const balance = await connection.getBalance(new PublicKey('YOUR_WALLET_ADDRESS'));
console.log(balance / LAMPORTS_PER_SOL, 'SOL');

cURL

curl -s -X POST https://eu.fluxrpc.com?key=YOUR_API_KEY \
  -H "Content-Type: application/json" \
  -d '{"jsonrpc":"2.0","id":1,"method":"getBalance","params":["YOUR_WALLET_ADDRESS"]}' | jq

Sample output

{
  "jsonrpc": "2.0",
  "result": {
    "context": { "slot": 123456789 },
    "value": 35737443
  },
  "id": 1
}

Get your API key → dashboard.fluxbeam.xyz

Prerequisites

  • Node.js 18+
  • FluxRPC API key (free, takes ~30 seconds to generate)

Step 1 — Get Your API Key

  1. Go to dashboard.fluxbeam.xyz
  2. Sign in (Google, GitHub, or Solana wallet)
  3. Click Create API Key
  4. Copy the key

Step 2 — Create the Project

mkdir fluxrpc-quickstart && cd fluxrpc-quickstart
npm init -y
npm install @solana/web3.js tsx

Step 3 — Write the Code

Create index.ts:

import { Connection, PublicKey, LAMPORTS_PER_SOL } from '@solana/web3.js';

const API_KEY: string = 'your-api-key-here';
const RPC_URL: string = `https://eu.fluxrpc.com?key=${API_KEY}`;

const WALLET: string = 'YOUR_WALLET_ADDRESS';

async function main(): Promise {
  const connection = new Connection(RPC_URL, 'confirmed');
  const publicKey = new PublicKey(WALLET);

  const start = Date.now();
  const lamports = await connection.getBalance(publicKey);
  const ms = Date.now() - start;

  console.log(`Wallet:  ${WALLET}`);
  console.log(`Balance: ${lamports / LAMPORTS_PER_SOL} SOL`);
  console.log(`Latency: ${ms}ms`);
}

main();

Replace your-api-key-here with the key you generated.

Step 4 — Run

npx tsx index.ts

Sample output

Wallet:  Wallet Address
Balance: 0.035737443 SOL
Latency: 142ms

You just read from Solana mainnet.

What Just Happened

ComponentPurpose
ConnectionOpens a connection to FluxRPC. The second argument 'confirmed' sets the commitment level (how finalized the data must be).
PublicKeyParses the wallet address string into a Solana‑compatible format.
getBalanceReturns the wallet balance in lamports (1 SOL = 10⁹ lamports).

This pattern repeats for all RPC calls: connect → query → handle response.

Why FluxRPC?

Fresh Data

Most providers cache responses. FluxRPC returns the latest confirmed (HEAD slot) state—no stale reads.

No Rate Limits

Pay for bandwidth, not request count.

  • $0.06 per GB
  • A getBalance call is ~0.5 KB → 2 million calls ≈ $0.06

Free tier: 10 GB.

Built for Load

Consistent performance even when Solana is congested.

Sub‑Millisecond Latency (Lantern)

Lantern caches account state locally.

  • Response time: 0.1–0.25 ms
  • Throughput: 10k+ req/sec

More Methods

getLatestBlockhash

const { blockhash, lastValidBlockHeight } = await connection.getLatestBlockhash();
console.log('Blockhash:', blockhash);

getAccountInfo

import type { AccountInfo } from '@solana/web3.js';

const account: AccountInfo | null = await connection.getAccountInfo(publicKey);

if (account) {
  console.log('Owner:', account.owner.toBase58());
  console.log('Lamports:', account.lamports);
  console.log('Executable:', account.executable);
  console.log('Data length:', account.data.length);
}

Reference

Endpoints

RegionURL
EUhttps://eu.fluxrpc.com?key=API_KEY
UShttps://us.fluxrpc.com?key=API_KEY

Choose the closest region; the wrong region adds ~100 ms latency.

Commitment Levels

LevelMeaning
processedNode has seen it
confirmedSupermajority voted
finalizedWon’t be rolled back

Common Errors

ErrorFix
Invalid public key inputVerify the wallet address is a valid Base58 string
Failed to fetchCheck API key and endpoint URL
403 ForbiddenRegenerate API key from the dashboard
TypeError: fetch failedUpgrade to Node.js 18+

Example error handling

try {
  const balance = await connection.getBalance(publicKey);
} catch (error) {
  console.error('RPC error:', error);
}

Happy building with FluxRPC!

Exit fullscreen mode

Next Steps

  • Transactions — Build and send SOL transfers
  • WebSockets — Subscribe to account changes

Docs: fluxrpc.com

Stuck?
Discord — we respond fast.
Twitter

Back to Blog

Related posts

Read more »