Skip to main content

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.

NetworkMainnetTestnet
Arbitrumhttps://arbitrum.hgraph.com/rpc
Avalanchehttps://avalanche.hgraph.com/rpc
Basehttps://base.hgraph.com/rpchttps://base-sepolia.hgraph.com/rpc
Ethereumhttps://ethereum.hgraph.com/rpchttps://ethereum-sepolia.hgraph.com/rpc, https://ethereum-hoodi.hgraph.com/rpc
Fraxtalhttps://fraxtal.hgraph.com/rpc
Hederahttps://hedera.hgraph.com/rpchttps://hedera-testnet.hgraph.com/rpc
Inkhttps://ink.hgraph.com/rpc
Liskhttps://lisk.hgraph.com/rpc
Modehttps://mode.hgraph.com/rpc
Optimismhttps://optimism.hgraph.com/rpc
Polygonhttps://polygon.hgraph.com/rpc
Robinhoodhttps://robinhood.hgraph.com/rpc
Soneiumhttps://soneium.hgraph.com/rpc
Unichainhttps://unichain.hgraph.com/rpc
World Chainhttps://worldchain.hgraph.com/rpc
Zorahttps://zora.hgraph.com/rpc

Note: The legacy Hedera hosts https://mainnet.hedera.api.hgraph.io/rpc and https://testnet.hedera.api.hgraph.io/rpc remain 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 /rpc in 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.