API Reference

Base URL

https://rpc.swiftnodes.io

HTTP RPC Endpoint

POST /rpc/{chain}?key={API_KEY}
Content-Type: application/json

{
  "jsonrpc": "2.0",
  "method": "eth_blockNumber",
  "params": [],
  "id": 1
}

Path Parameters

ParameterTypeDescription
chainstringChain slug (e.g. eth, bsc, base, solana)

Authentication

MethodExample
Query parameter?key=sn_aBcDeF...
Headerx-api-key: sn_aBcDeF...

Archive nodes (archive=1)

By default, requests are load-balanced across all healthy nodes for a chain — most of which are pruned (they keep recent state, not the full history). If you need historical state — e.g. eth_getBalance, eth_call, or eth_getStorageAt at an old block — add archive=1 to route your request only to archive (unpruned) nodes:

# HTTP — archive-only routing
POST https://rpc.swiftnodes.io/rpc/eth?key={API_KEY}&archive=1

# WebSocket — archive-only routing
wss://rpc.swiftnodes.io/ws/eth?key={API_KEY}&archive=1
  • EVM chains only. Using archive=1 on a non-EVM chain returns an error.
  • If no archive node is available for that chain, the request returns 502 — No archive node available for this chain, rather than silently serving pruned data.
  • Without archive=1, a historical-state call may land on a pruned node and fail with missing trie node / historical state not available. Add the flag when you specifically need old state.
  • You don’t need it for current-state or recent queries — omit it and you get the full, faster load-balanced pool.

MEV-protected transactions (protect=1)

A transaction broadcast to the public mempool can be seen — and sandwiched or front-run — by MEV bots before it mines. Add protect=1 and your eth_sendRawTransaction is routed to a private transaction relay (currently MEV Blocker on Ethereum mainnet) instead of the public mempool. Only sends are affected — every read method on the same connection routes normally, so you can use one URL for everything:

POST https://rpc.swiftnodes.io/rpc/eth?key={API_KEY}&protect=1
  • Ethereum mainnet only for now. Chains without a configured relay return 400 — MEV-protected sends are not available for this chain.
  • Your transaction skips the public mempool, so sandwich and front-running bots never see it. MEV Blocker additionally rebates backrun value to the transaction sender when searchers capture it.
  • Inclusion can take slightly longer than a public broadcast; the relay falls back to public broadcast if the transaction isn’t included within its window. Poll eth_getTransactionReceipt as usual.
  • Protected sends are relayed exactly once — no retry, no failover — so a transaction can never be double-submitted. Batch requests are not supported with protect=1.
  • Read more: What is MEV?

Response Format

Success

{
  "jsonrpc": "2.0",
  "id": 1,
  "result": "0x134a3c7"
}

Error

{
  "jsonrpc": "2.0",
  "id": 1,
  "error": {
    "code": -32600,
    "message": "Invalid Request"
  }
}

HTTP Status Codes

CodeDescription
200Success (check JSON-RPC response for errors)
401Missing or invalid API key
404Unknown chain slug
429Rate limited — retry after 1 second
502Backend node error — upstream RPC unreachable

Common EVM Methods

MethodDescription
eth_blockNumberLatest block number
eth_getBalanceAccount balance
eth_getTransactionByHashTransaction details
eth_getTransactionReceiptTransaction receipt
eth_callExecute call without transaction
eth_estimateGasEstimate gas for transaction
eth_sendRawTransactionSubmit signed transaction
eth_getLogsQuery event logs
eth_getBlockByNumberBlock details by number
eth_chainIdChain identifier

SwiftNodes proxies all standard JSON-RPC methods supported by the underlying chain node. Any method the chain supports will work.