Skip to content

Make your first RPC request

Create an RPC API key and read the latest Ethereum block number with curl, viem, ethers, or web3.py.

Confirm that your application can reach GraphOps RPC by reading the latest Ethereum block number. Use curl or your preferred EVM client library.

Expected result: an authenticated eth_blockNumber response containing the current block as a hex quantity.

Prerequisites

  • A GraphOps Platform account.
  • An organization with access to RPC.
  • An Owner or Developer role to create an RPC API key, or a key supplied by your team.
  • Ethereum mainnet endpoint access.

The endpoint path ends in the EVM chain ID. These examples use Ethereum mainnet (1) and the placeholder <GRAPHOPS_API_KEY> for your organization API key. For other endpoints, see Supported networks.

Create an API key

Create an RPC API key

Choose your organization and create the key for RPC.

Store the plaintext key in your secret manager. The platform only shows the plaintext key at creation or rotation time.

Choose an endpoint

Choose the network endpoint. This guide uses Ethereum mainnet:

https://rpc.graphops.xyz/v1/evm/1

Endpoint preview

Replace placeholders with your identifier and API key before making requests.

Mainnet and testnet endpoints use the same authentication model. See Authentication for header and route-token options.

Read the latest block

Run an eth_blockNumber request against the Ethereum mainnet endpoint.

curl "https://rpc.graphops.xyz/v1/evm/1" \
  -H "Authorization: Bearer <GRAPHOPS_API_KEY>" \
  -H "Content-Type: application/json" \
  --data '{
    "jsonrpc": "2.0",
    "id": 1,
    "method": "eth_blockNumber",
    "params": []
  }'
{  "jsonrpc": "2.0",JSON-RPC version  "id": 1,Matches the id you sent  "result": "0x112a880"Latest block: 18,000,000 in decimal}
A successful response returns the latest block number as a hex quantity.

Next steps