JSON-RPC
Hgraph serves Ethereum-compatible JSON-RPC across a growing set of networks. Every endpoint follows the JSON-RPC 2.0 Specification and implements a subset of the Ethereum JSON-RPC APIs, so the same tooling — wallets, libraries, and frameworks — works across all of them. JSON-RPC access is available on all plans, including the free tier — see pricing for plan details.
API Endpoints
All endpoints expose JSON-RPC at the /rpc path.
| Network | Mainnet | Testnet |
|---|---|---|
| Arbitrum | https://arbitrum.hgraph.com/rpc | — |
| Avalanche | https://avalanche.hgraph.com/rpc | — |
| Base | https://base.hgraph.com/rpc | https://base-sepolia.hgraph.com/rpc |
| Ethereum | https://ethereum.hgraph.com/rpc | https://ethereum-sepolia.hgraph.com/rpc, https://ethereum-hoodi.hgraph.com/rpc |
| Fraxtal | https://fraxtal.hgraph.com/rpc | — |
| Hedera | https://hedera.hgraph.com/rpc | https://hedera-testnet.hgraph.com/rpc |
| Ink | https://ink.hgraph.com/rpc | — |
| Lisk | https://lisk.hgraph.com/rpc | — |
| Mode | https://mode.hgraph.com/rpc | — |
| Optimism | https://optimism.hgraph.com/rpc | — |
| Polygon | https://polygon.hgraph.com/rpc | — |
| Robinhood | https://robinhood.hgraph.com/rpc | — |
| Soneium | https://soneium.hgraph.com/rpc | — |
| Unichain | https://unichain.hgraph.com/rpc | — |
| World Chain | https://worldchain.hgraph.com/rpc | — |
| Zora | https://zora.hgraph.com/rpc | — |
Note: The legacy Hedera hosts
https://mainnet.hedera.api.hgraph.io/rpcandhttps://testnet.hedera.api.hgraph.io/rpcremain available.
Authentication
Every endpoint above requires an API key. Create an account to obtain one — production keys start with pk_prod_. A single key authenticates across every network and every Hgraph API (GraphQL, REST, JSON-RPC).
Provide the key by any of:
- Header:
X-API-KEY: <YOUR_API_KEY> - Bearer:
Authorization: Bearer <YOUR_API_KEY> - Path: insert
/v1/<YOUR_API_KEY>before/rpcin any endpoint above — e.g.https://ethereum.hgraph.com/v1/<YOUR_API_KEY>/rpc
Using a library (ethers.js, viem)
new ethers.JsonRpcProvider(url) takes a bare URL string and cannot set request headers, so use path-based auth — the key is in the URL and nothing else is needed:
import { ethers } from 'ethers';
const provider = new ethers.JsonRpcProvider('https://ethereum.hgraph.com/v1/<YOUR_API_KEY>/rpc');
To send the key as a header instead, pass a FetchRequest rather than a string:
import { ethers } from 'ethers';
const req = new ethers.FetchRequest('https://ethereum.hgraph.com/rpc');
req.setHeader('X-API-KEY', '<YOUR_API_KEY>');
const provider = new ethers.JsonRpcProvider(req);
viem's http() transport accepts headers directly: http('https://ethereum.hgraph.com/rpc', { fetchOptions: { headers: { 'X-API-KEY': '<YOUR_API_KEY>' } } }).
Rate Limits
Rate limits are enforced per API key, by your plan — a single requests-per-second budget shared across all networks and all APIs (GraphQL, REST, JSON-RPC), not a separate allowance per endpoint or chain. See pricing for the requests/sec and monthly limits of each plan.
Making Requests
The request shape is identical across every endpoint — only the host changes (and the chain ID it returns). This example uses path-based authentication against Base mainnet:
curl -X POST \
-H "Content-Type: application/json" \
-d '{"jsonrpc":"2.0","id":"1","method":"eth_chainId","params":[]}' \
https://base.hgraph.com/v1/<YOUR_API_KEY>/rpc
Response (0x2105 is 8453, Base's chain ID):
{
"result": "0x2105",
"jsonrpc": "2.0",
"id": "1"
}
Supported JSON-RPC Methods
Hgraph supports the full Ethereum JSON-RPC API on every EVM chain.
Hedera is served through the Hedera JSON-RPC Relay, which supports a subset of these methods — see its API documentation for specifics.
Support
For any issues or questions, contact support.