Ethereum

Ethereum

cURL

curl is the quickest way to poke Ethereum mainnet without pulling in a library. It's handy for a fast sanity check that your key works, for reproducing a bug report with the exact bytes that hit the node, and for wiring RPC calls into a shell script or CI step. The JSON-RPC protocol runs over a single verb: every call is an HTTP POST carrying Content-Type: application/json, with the method and params in the body. Your key lives in the URL path, so the endpoint is https://ethereum.therpc.io/YOUR_API_KEY and there's nothing else to configure.

The key in the path is the default, but you can also pass it as Authorization: Bearer YOUR_API_KEY if you'd rather keep it out of the URL and out of access logs. Either way, the request itself stays the same: a POST with Content-Type: application/json. A GET or a missing content type will be rejected before it reaches Ethereum.

Basic Usage

curl -X POST \
-H "Content-Type: application/json" \
--data '{"jsonrpc":"2.0","method":"eth_blockNumber","params":[],"id":1}' \
https://ethereum.therpc.io/YOUR_API_KEY

Authentication

curl -X POST \
-H "Content-Type: application/json" \
-H "Authorization: Bearer YOUR_API_KEY" \
--data '{"jsonrpc":"2.0","method":"eth_blockNumber","params":[],"id":1}' \
https://ethereum.therpc.io/YOUR_API_KEY

Common Operations

curl -X POST \
-H "Content-Type: application/json" \
--data '{"jsonrpc":"2.0","method":"eth_getBalance","params":["0x742d35Cc6634C0532925a3b844Bc454e4438f44e","latest"],"id":1}' \
https://ethereum.therpc.io/YOUR_API_KEY
curl -X POST \
-H "Content-Type: application/json" \
--data '{"jsonrpc":"2.0","method":"eth_getTransactionByHash","params":["0x88df016429689c079f3b2f6ad39fa052532c56795b733da78a91ebe6a713944b"],"id":1}' \
https://ethereum.therpc.io/YOUR_API_KEY

Ready to call this in production?

Free tier covers personal projects. Pay-as-you-go scales without a card.