Skip to content

NEAR

Endpointhttps://rpc.lab.au.ro/near
ProtocolJSON-RPC 2.0 over HTTPS (POST)
Networkmainnet
Batch

Supported methods

Live-verified: status, network_info, gas_price, block, validators, query (view_account / view_state / call_function), broadcast_tx_async, broadcast_tx_commit — nearcore's standard RPC.

Quick test

bash
curl -X POST https://rpc.lab.au.ro/near \
  -H "apikey: $YOUR_API_KEY" -H 'Content-Type: application/json' \
  -d '{"jsonrpc":"2.0","method":"status","params":[],"id":1}'
# {"jsonrpc":"2.0","result":{"chain_id":"mainnet","latest_protocol_version":...}}

SDK integration — near-api-js

Modern near-api-js splits providers into @near-js/providers:

js
import { JsonRpcProvider } from '@near-js/providers'

const provider = new JsonRpcProvider({
  url: 'https://rpc.lab.au.ro/near',
  headers: { apikey: process.env.YOUR_API_KEY }
})

const status = await provider.status()
console.log('height:', status.sync_info.latest_block_height)   // 202397854

const block = await provider.block({ finality: 'final' })
console.log('final block:', block.header.height)

(The same { url, headers } connection object works with the legacy near-api-js ≤4 providers.JsonRpcProvider too.)

Recipes

View an account

js
const account = await provider.query({
  request_type: 'view_account', finality: 'final', account_id: 'wrap.near'
})
console.log('balance (yocto):', account.amount)

Call a view function

js
const res = await provider.query({
  request_type: 'call_function', finality: 'final',
  account_id: 'wrap.near', method_name: 'ft_metadata',
  args_base64: Buffer.from('{}').toString('base64')
})
console.log(JSON.parse(Buffer.from(res.result).toString()))

Send a transaction

Sign offline (@near-js/transactions + your KeyPair), then provider.sendTransaction(signedTx) (broadcast_tx_commit waits for execution; broadcast_tx_async returns the hash immediately).

Limitations

  • Non-archival node: queries older than ~2.5 days of blocks return garbage- collected errors; use archival providers for deep history.
  • EXPERIMENTAL_* methods are not guaranteed.