Skip to main content

RPC Reference

FastNear RPC gives you direct JSON-RPC access to NEAR nodes for state queries, block and chunk inspection, transaction submission, validator data, and protocol introspection.

Base URLs

Regular RPCs keep the most recent epochs of state and are the default choice for most application traffic:

Mainnet Regular RPC
https://rpc.mainnet.fastnear.com
Testnet Regular RPC
https://rpc.testnet.fastnear.com

Archival RPCs expose the full chain history when you need older blocks, receipts, or historical contract state:

Mainnet Archival RPC
https://archival-rpc.mainnet.fastnear.com
Testnet Archival RPC
https://archival-rpc.testnet.fastnear.com

Common starting points

Need a workflow?

Use RPC Examples for worked examples like exact state checks, block inspection, contract view calls, and send-and-confirm transaction work.

Use RPC when

  • You want protocol-native request and response shapes.
  • You need canonical node-backed behavior for state queries or block lookups.
  • You are submitting transactions or inspecting execution outcomes.
  • You want the lowest-level surface before adding indexed or product-specific views.

Skip RPC when

  • You want wallet-style balances, NFTs, staking positions, or public-key lookups in one call.
  • You need indexed transaction history by account instead of polling and stitching together node responses.
  • You are optimizing for product simplicity over raw protocol control.

In those cases, move to the indexed REST families such as FastNear API, Transactions API, or NEAR Data API.

Auth and limits

  • FastNear API keys are optional; the public endpoints work without one.
  • Higher-limit or standardized authenticated access goes through Auth & Access, where the same key works on both the regular and archival RPC hosts as either an Authorization: Bearer header or an ?apiKey= URL parameter.

Shareable live examples

  • Use Copy example URL on any interactive RPC page to share the selected network, example tab, finality, and filled inputs.
  • Shared example URLs run automatically on load whenever they include operation state.
  • Saved API keys and tokens are never included in those shared docs URLs.

Troubleshooting

My request worked locally but fails in production

Check whether you relied on the docs UI to append an API key for you. Production backends should inject credentials explicitly and never depend on browser storage.

I need older state than the default RPC returns

Switch from the regular RPC endpoint to the archival RPC endpoint.

The same FastNear key and the same header or query-param transport work on both hosts.

I need a simpler response than JSON-RPC gives me

That usually means you want an indexed REST family instead of raw RPC. Use the chooser page to pick the higher-level surface.