OP Mainnet RPC

JSON-RPC 2.0 for OP Mainnet over HTTPS and WebSocket. Same token, credits and plan limits as every other chain.

Contents
Chains, regions and plans open one by one when enough teams ask for them. These docs describe exactly how they work. What is open

Endpoints

HTTPShttps://rpc.blockmetric.io/optimism/YOUR_TOKENAvailable when your plan opens.
WebSocketwss://rpc.blockmetric.io/optimism/YOUR_TOKENAvailable when your plan opens.
Header authhttps://rpc.blockmetric.io/optimismwith Authorization: Bearer bmr_… Available when your plan opens.
Healthhttps://rpc.blockmetric.io/optimism/healthPublic, no token, once this chain opens. Available when your plan opens.
Chain id
10 (0xa)
Native token
ETH
Network
Mainnet
eth_getLogs span
10,000 blocks
WebSocket
Yes, eth_subscribe

First request

Set BLOCKMETRIC_RPC_TOKEN to your token, then:

curl -s https://rpc.blockmetric.io/optimism/$BLOCKMETRIC_RPC_TOKEN \
  -H "Content-Type: application/json" \
  -d '{"jsonrpc":"2.0","id":1,"method":"eth_blockNumber","params":[]}'

Batch and header authentication

curl -s https://rpc.blockmetric.io/optimism/$BLOCKMETRIC_RPC_TOKEN \
  -H "Content-Type: application/json" \
  -d '[
    {"jsonrpc":"2.0","id":1,"method":"eth_chainId","params":[]},
    {"jsonrpc":"2.0","id":2,"method":"eth_blockNumber","params":[]},
    {"jsonrpc":"2.0","id":3,"method":"eth_getBalance","params":["0x0000000000000000000000000000000000000000","latest"]}
  ]'

Wallets and developer tools

export ETH_RPC_URL="https://rpc.blockmetric.io/optimism/$BLOCKMETRIC_RPC_TOKEN"
cast chain-id
cast block-number

Subscriptions

New heads and logs over WebSocket. Reconnects and gaps: WebSockets guide.

import { createPublicClient, webSocket } from 'viem'
import { optimism } from 'viem/chains'

const url = `wss://rpc.blockmetric.io/optimism/${process.env.BLOCKMETRIC_RPC_TOKEN}`
const client = createPublicClient({ chain: optimism, transport: webSocket(url, { reconnect: true }) })

// One eth_subscribe("newHeads") under the hood; viem resubscribes after a reconnect.
const stop = client.watchBlocks({ onBlock: (block) => console.log(block.number, block.hash) })

Methods and weights

1 credit = 1 request, the same on every chain. A method that is not listed answers method_not_found or method_not_allowed (errors).

Answered by the gateway Weight 0

eth_chainId and net_version come straight from the gateway: no node call, no credits.

  • eth_chainId
  • net_version

Standard reads Weight 1

  • web3_clientVersion
  • web3_sha3
  • net_listening
  • net_peerCount
  • eth_blockNumber
  • eth_syncing
  • eth_protocolVersion
  • eth_gasPrice
  • eth_maxPriorityFeePerGas
  • eth_feeHistory
  • eth_blobBaseFee
  • eth_getBalance
  • eth_getCode
  • eth_getStorageAt
  • eth_getTransactionCount
  • eth_getProof
  • eth_call
  • eth_estimateGas
  • eth_createAccessList
  • eth_simulateV1
  • eth_getBlockByHash
  • eth_getBlockByNumber
  • eth_getBlockTransactionCountByHash
  • eth_getBlockTransactionCountByNumber
  • eth_getUncleByBlockHashAndIndex
  • eth_getUncleByBlockNumberAndIndex
  • eth_getUncleCountByBlockHash
  • eth_getUncleCountByBlockNumber
  • eth_getTransactionByHash
  • eth_getTransactionByBlockHashAndIndex
  • eth_getTransactionByBlockNumberAndIndex
  • eth_getTransactionReceipt

Heavy reads Weight 2

Full-transaction blocks (eth_getBlockByNumber or eth_getBlockByHash with true) also count as heavy.

  • eth_getLogs
  • eth_getBlockReceipts
  • trace_transaction
  • trace_get

Trace and debug Weight 5

Paid plans only (Starter and up). On Free these calls answer plan_required.

  • trace_block
  • trace_call
  • trace_callMany
  • trace_filter
  • trace_rawTransaction
  • trace_replayBlockTransactions
  • trace_replayTransaction
  • debug_traceTransaction
  • debug_traceCall
  • debug_traceBlockByNumber
  • debug_traceBlockByHash
  • debug_getRawBlock
  • debug_getRawHeader
  • debug_getRawReceipts
  • debug_getRawTransaction

Transaction submission Weight 1

Not enabled yet: Blockmetric RPC is read-only during the beta (tx_submit_disabled).

  • eth_sendRawTransaction
  • eth_sendRawTransactionConditional
  • eth_sendRawTransactionSync

Subscriptions (WebSocket only) Weight 1 per call, notifications 1 per started 4 KB

newHeads and logs. newPendingTransactions (mempool) is not offered.

  • eth_subscribe
  • eth_unsubscribe

Independent infrastructure, not affiliated with OP Mainnet. Answers come from the chain’s nodes as they are, without guarantee.

Code snippets in these docs are licensed under MIT-0: copy them into your own code without attribution. Use of Blockmetric RPC is governed by the terms. Independent infrastructure, not affiliated with the chains or their foundations.

LiveHyperliquid markets 12sOperationalHyperliquid positions & whales 4sOperationalLiquidation heatmap & levels 9sOperationalLighter markets & liquidations 6sOperationalLighter positions & heatmap 8sOperationalLighter RH positions & heatmap 5sOperationalBinance markets 23sOperationalBybit markets 1mOperationalBinance liquidations 33sOperationalBybit liquidations 33sOperationaldYdX positions & heatmap 10sOperationalGMX positions & heatmap 4sOperationalLong/short & open interest history 47sOperationalOrder books & trade flow 7sOperationalOn-chain transfers 8sOperationalSecurity monitor 30sOperationalBlockmetric Sentiment 12mOperationalOfficial news 1mOperationalAlert delivery 4sOperational10:09:22 UTCData: Blockmetric Research · Binance · Bybit