Ethereum Quickstart

The Ethereum API lets applications connect to an Ethereum node that is part of the Ethereum blockchain. Developers can interact with onchain data and send transactions to the network using the endpoints provided by the API.

Networks

  • Mainnet (HTTPS and WSS)
  • Testnet:
    • Holesky (HTTPS and WSS)
    • Sepolia (HTTPS and WSS)

API Querying

Request example

Use eth_blockNumber to request the latest Ethereum block number from the Ethereum HTTPS endpoint:

$curl https://rpc.ankr.com/eth/<apiKey> \
> -H "Content-Type: application/json" \
> -d '{
> "jsonrpc": "2.0",
> "method": "eth_blockNumber",
> "params": [],
> "id": 1
> }'

Replace <apiKey> with your project API key.

Response example

A successful response returns the latest block number as a hexadecimal quantity:

1{
2 "jsonrpc": "2.0",
3 "id": 1,
4 "result": "0x10d4f"
5}