Prerequisites
Using any of the GoldRush developer tools requires an API key. If you already have a GoldRush key for any other GoldRush product (Foundational, Streaming, Pipeline, Hyperliquid, x402), you can use it as-is - JSON-RPC uses the same key.
Vibe Coders $10/mo - Built for solo builders and AI-native workflows.
Teams $250/mo - Production-grade with 50 RPS and priority support.
1. Export your API key
export GOLDRUSH_API_KEY = "cqt_..."
Never commit your API key to source control. Use environment variables or a secrets manager.
2. Pick a chain
The endpoint shape is:
https://rpc.goldrushdata.com/v1/{chain}
Replace {chain} with one of the supported chain slugs . For Ethereum mainnet, that’s eth-mainnet; for Solana, that’s solana-mainnet.
3. Make a request
The examples below target an EVM chain. For Solana, jump to step 3 (Solana) .
curl
ethers v6
viem
web3.js
web3.py
curl https://rpc.goldrushdata.com/v1/eth-mainnet \
-H "Authorization: Bearer $GOLDRUSH_API_KEY " \
-H "Content-Type: application/json" \
-d '{
"jsonrpc": "2.0",
"id": 1,
"method": "eth_blockNumber",
"params": []
}'
import { ethers } from "ethers" ;
const url = "https://rpc.goldrushdata.com/v1/eth-mainnet" ;
const fetchReq = new ethers . FetchRequest ( url );
fetchReq . setHeader ( "Authorization" , `Bearer ${ process . env . GOLDRUSH_API_KEY } ` );
const provider = new ethers . JsonRpcProvider ( fetchReq );
const block = await provider . getBlockNumber ();
console . log ( "latest block:" , block );
import { createPublicClient , http } from "viem" ;
import { mainnet } from "viem/chains" ;
const client = createPublicClient ({
chain: mainnet ,
transport: http ( "https://rpc.goldrushdata.com/v1/eth-mainnet" , {
fetchOptions: {
headers: {
Authorization: `Bearer ${ process . env . GOLDRUSH_API_KEY } ` ,
},
},
}),
});
const block = await client . getBlockNumber ();
console . log ( "latest block:" , block );
import { Web3 } from "web3" ;
const provider = new Web3 . providers . HttpProvider (
"https://rpc.goldrushdata.com/v1/eth-mainnet" ,
{
headers: [
{ name: "Authorization" , value: `Bearer ${ process . env . GOLDRUSH_API_KEY } ` },
],
}
);
const web3 = new Web3 ( provider );
const block = await web3 . eth . getBlockNumber ();
console . log ( "latest block:" , block );
from os import environ
from web3 import Web3
w3 = Web3(Web3.HTTPProvider(
"https://rpc.goldrushdata.com/v1/eth-mainnet" ,
request_kwargs = {
"headers" : {
"Authorization" : f "Bearer { environ[ 'GOLDRUSH_API_KEY' ] } " ,
},
},
))
print ( "latest block:" , w3.eth.block_number)
3. Make a request (Solana)
On Solana, the same endpoint shape and header auth apply; only the methods change. Here’s a getSlot call (the Solana equivalent of eth_blockNumber):
curl
@solana/kit
@solana/web3.js
python
curl https://rpc.goldrushdata.com/v1/solana-mainnet \
-H "Authorization: Bearer $GOLDRUSH_API_KEY " \
-H "Content-Type: application/json" \
-d '{
"jsonrpc": "2.0",
"id": 1,
"method": "getSlot",
"params": [{ "commitment": "finalized" }]
}'
import {
createDefaultRpcTransport ,
createSolanaRpcFromTransport ,
} from "@solana/kit" ;
const transport = createDefaultRpcTransport ({
url: "https://rpc.goldrushdata.com/v1/solana-mainnet" ,
headers: { Authorization: `Bearer ${ process . env . GOLDRUSH_API_KEY } ` },
});
const rpc = createSolanaRpcFromTransport ( transport );
const slot = await rpc . getSlot (). send ();
console . log ( "current slot:" , slot );
import { Connection } from "@solana/web3.js" ;
const connection = new Connection (
"https://rpc.goldrushdata.com/v1/solana-mainnet" ,
{
httpHeaders: {
Authorization: `Bearer ${ process . env . GOLDRUSH_API_KEY } ` ,
},
}
);
const slot = await connection . getSlot ( "finalized" );
console . log ( "current slot:" , slot );
import os
import requests
resp = requests.post(
"https://rpc.goldrushdata.com/v1/solana-mainnet" ,
headers = {
"Authorization" : f "Bearer { os.environ[ 'GOLDRUSH_API_KEY' ] } " ,
"Content-Type" : "application/json" ,
},
json = { "jsonrpc" : "2.0" , "id" : 1 , "method" : "getSlot" , "params" : [{ "commitment" : "finalized" }]},
)
print ( "current slot:" , resp.json()[ "result" ])
New to Solana RPC? See Solana concepts for commitment levels, slots vs blocks, lamports, and encodings.
4. Where to next
Authentication details Header reference, error codes, key rotation tips.
Method reference Every method with parameters, returns, and code examples per chain. See the Solana method reference for Solana.
Endpoint details Archive, debug_*, trace_*, SLA.
Migration guides Coming from Infura, Alchemy, or Ankr.