Base RPC URL: keyless access, curl and viem examples
Connect to Base mainnet with a public RPC URL or API key. Use curl and viem examples, check supported methods and limits, and inspect Data API status.
Start with the Base mainnet public RPC URL below to read the chain ID without an API key. Check supported methods and per-IP limits on the Base chain page; use a key for methods outside public.methods that the chain allows.
curl -sS "https://api.blockvectra.com/v1/base_mainnet/public" \
-H "Content-Type: application/json" \
-d '{"jsonrpc":"2.0","id":1,"method":"eth_chainId","params":[]}'Network information and endpoints
Every request to Base identifies its target network explicitly in the URL path using the slug base_mainnet. JSON-RPC supports both path-based key authentication and request header authentication (x-api-key).
| Parameter / Endpoint | Value / Template | Authentication |
|---|---|---|
| Chain ID (EIP-155) | 8453 | — |
| JSON-RPC (path key) | POST https://api.blockvectra.com/v1/base_mainnet/{api_key} | API key in URL path |
| JSON-RPC (header key) | POST https://api.blockvectra.com/v1/base_mainnet | Header x-api-key: {api_key} |
| WebSocket (path key) | wss://api.blockvectra.com/v1/base_mainnet/{api_key} | API key in URL path |
| WebSocket (header key) | wss://api.blockvectra.com/v1/base_mainnet | Header x-api-key: {api_key} or Authorization: Bearer {api_key} |
| WebSocket subscriptions | newHeads, logs | — |
| Data API base | GET https://api.blockvectra.com/v1/data/base_mainnet/… | Header x-api-key: {api_key} |
| Public status | GET https://api.blockvectra.com/v1/status | Unauthenticated (public) |
Direct curl and viem examples
You can make JSON-RPC calls directly using curl or web3 client libraries such as viem. Set your API key in the BLOCKVECTRA_API_KEY environment variable:
Query the EIP-155 chain ID using the x-api-key request header:
curl -s "https://api.blockvectra.com/v1/base_mainnet" \
-H "Content-Type: application/json" \
-H "x-api-key: $BLOCKVECTRA_API_KEY" \
-d '{"jsonrpc":"2.0","id":1,"method":"eth_chainId","params":[]}'Response structure
Responses adhere to the JSON-RPC 2.0 specification:
- Success: Returns an object containing
jsonrpc: "2.0", matching integerid, and hexadecimal-encodedresult(eth_chainIdreturns the hex-encoded chain ID;eth_blockNumberreturns the latest block height). - Disallowed methods: Requesting a method outside the network's allowed methods returns JSON-RPC error code
-32601(method not available, not billed). - Out-of-window queries: Historical state requests earlier than the state retention window return JSON-RPC error code
-32011(not billed). - Missing API key: Omitting the key returns HTTP 401 with JSON-RPC error code
-32024(missing_api_key, not billed). - Invalid parameters: Malformed request parameters return JSON-RPC error code
-32602(not billed).
Capability and method policy
Live values: GET /v1/chains (methods, max_logs_block_range, state_window_blocks).
Network parameters and limits
- eth_getLogs block range: Max 1000 blocks per request
- Historical state window: Recent 10000 blocks (queries beyond return -32011)
- Execution tracing (debug_trace*): Not available
Per-chain allowed methods: Supported Chains
Blockchain Data API
Live values: GET /v1/chains (data).
Blockchain Data API status
Available — Blockchain Data API is available on Base. Browse supported datasets in the datasets directory. Browse datasets directory →
Find direct calls to a contract, then fetch receipts
To list transactions sent directly to your contract in a fixed block range and read their receipts, page through the address transactions endpoint, then call eth_getTransactionReceipt for each returned hash. Both bounds are inclusive, so a 200-block range is TO_BLOCK = FROM_BLOCK + 199.
export CONTRACT=0x... # your contract address
export FROM_BLOCK=... # range start (inclusive)
export TO_BLOCK=... # range end (inclusive)
curl -sS "https://api.blockvectra.com/v1/data/base_mainnet/addresses/$CONTRACT/transactions?from_block=$FROM_BLOCK&to_block=$TO_BLOCK&direction=to&limit=500" \
-H "x-api-key: $BLOCKVECTRA_API_KEY"- Each item in
datahas ahash. If the top-levelnext_cursoris present, repeat the request with the same query plus&cursor=<next_cursor>, passing the cursor back unchanged. Stop whennext_cursoris absent. A page can hold fewer thanlimitrows, or none, whilenext_cursoris still present. - Check
meta.coverageon every page.partialmeans the range was clamped or starts before this dataset's indexed start, so the list does not cover the whole range. An empty list is not proof that the range had no calls. - Fetch each receipt from the same chain with the same key.
hashalready starts with0x; put the complete value fromdataintoTX_HASHunchanged, without adding another0x:
curl -sS "https://api.blockvectra.com/v1/base_mainnet" \
-H "Content-Type: application/json" \
-H "x-api-key: $BLOCKVECTRA_API_KEY" \
-d "{\"jsonrpc\":\"2.0\",\"id\":1,\"method\":\"eth_getTransactionReceipt\",\"params\":[\"$TX_HASH\"]}"Handle errors by layer:
- Data API:
409 not_indexed_yetmeans the range is above the indexed head, so retry later or addclamp=true, which truncatesto_blockdown to the indexed head and returnsmeta.coverage = "partial"(a clamped result no longer covers your original fixed range; iffrom_blockitself is above the indexed head,clamp=truestill returns 409);409 window_too_largemeans the range exceeds 100,000 blocks;422 no_coveragemeans the range is outside the dataset;503 unavailablecarriesRetry-After, so wait at least that many seconds and retry with the same cursor. - JSON-RPC: an HTTP error or an
errorobject in the body is a failed call."result": nullmeans no receipt was returned for that hash, not success; retry later or check the hash. A non-null receipt does not mean the transaction succeeded:status0x1is success and0x0means it reverted.
This lists only top-level transactions whose to is the contract. It does not include events, internal calls or transactions that reach the contract through another contract. Supported methods and ranges come from GET /v1/chains and the actual response. For pagination and event queries, see eth_getLogs vs Token Transfers API.
Getting started and API keys
New accounts get 30,000,000 CU on sign-up — no credit card.- Web console: Sign up via Ethereum wallet signature, and generate an API key in the Console. See the Quickstart guide for setup details.
- Programmatic sign-up: Autonomous AI agents, automated scripts, and CI pipelines can sign in and provision API keys using Ethereum wallet signatures (EIP-191) without a browser. Follow the Programmatic sign-up guide.
- AI agents: Autonomous AI agents can discover Base capabilities using the official Model Context Protocol (MCP) server. See Connecting AI Agents to BlockVectra.
- Upgrading limits: After topping up, the account-wide calls-per-second limit is removed; each key remains subject to Compute Unit (CU) rate and burst limits. For current rates and billing units, see the Pricing page.
Related guides and resources
- Base developer documentation: For network specifications, gas mechanics, and contracts on Base, see the official Base documentation.
- Wallet custom RPC: Configure custom RPC endpoints for Base in MetaMask and Rabby using the Wallet Custom RPC guide.
- Transaction simulation: Test transaction execution and evaluate state changes before broadcasting using
eth_simulateV1in the Simulate Transactions guide.
Next steps
- Browse the datasets directory to see every dataset BlockVectra indexes.
- See the free plan and pricing to check what your account includes.
- Log in to the console to create an API key.
Last updated:
DEX daily prices
Get daily DEX OHLC prices and VWAP for a token with one GET /{chain}/dex/prices request, plus exact fractions in TypeScript and Python and backfills.
HyperEVM backfill and polling
HyperEVM public RPC: the official endpoint allows 100 requests per minute per IP and 50 blocks per eth_getLogs; BlockVectra's keyless endpoint allows 3 requests per second per IP, and eth_getLogs with a key covers up to 1,000 blocks. Split longer windows and save a cursor.