Make your First RPC Request

Conduit RPC endpoints follow the Ethereum JSON-RPC spec. You send a POST request with a JSON body describing the method you want to call, and the node returns the result.

Anatomy of a request

Every request body has four fields:

FieldDescriptionExample
jsonrpcProtocol version always remains "2.0""2.0"
methodThe JSON-RPC method to call"eth_blockNumber"
paramsArguments for the method. Use [] if the method takes no arguments[] or ["0xabc...", "latest"]
idAn identifier you assign, echoed back in the response"1"

To call a different method, replace the method value with any supported JSON-RPC method and update params accordingly. See the examples below.

Steps

1

Write a request

The example below fetches the latest block number. It takes no arguments, so params is an empty array.

You’ll need your network’s RPC URL and API key from the Conduit App. Append them to the request URL as shown above.

Request
$curl -s https://[YOUR_RPC_URL]/[YOUR_API_KEY] -X POST \
>-H 'Content-Type: application/json' \
>-d '{"jsonrpc":"2.0","id":"1","method":"eth_blockNumber","params":[]}'
Response
${"jsonrpc":"2.0","result":"0x430905","id":"1"}

The result is the block number in hex. 0x430905 = block 4,394,245.

2

Add RPC URL and API key

Replace [YOUR_RPC_URL] and [YOUR_API_KEY] with your values. Supported networks and their RPC URLs can be found in the Conduit app, under the Endpoints tab of your API key page.

If you can’t find the RPC URL you’re looking for, contact the chain owner.

3

Send the request

Run the command in your terminal. You should see a JSON response with a result field. If you see an error, double-check your RPC URL and API key.

More examples

The examples below show common methods across curl, JavaScript, Python, and Go. Replace [YOUR_RPC_URL] and [YOUR_API_KEY] with your values.

If you are using a web3 library like viem, ethers.js, or web3.py, see Using Web3 Libraries.

eth_blockNumber

Get the latest block number.

$curl -s https://[YOUR_RPC_URL]/[YOUR_API_KEY] -X POST \
>-H 'Content-Type: application/json' \
>-d '{"jsonrpc":"2.0","id":"1","method":"eth_blockNumber","params":[]}'

eth_getBalance

Get the ETH balance of an address. params takes an address and a block tag ("latest", "earliest", or a hex block number).

$curl -s https://[YOUR_RPC_URL]/[YOUR_API_KEY] -X POST \
>-H 'Content-Type: application/json' \
>-d '{"jsonrpc":"2.0","id":"1","method":"eth_getBalance","params":["0xYOUR_ADDRESS","latest"]}'

eth_call

Call a contract function without sending a transaction.

$curl -s https://[YOUR_RPC_URL]/[YOUR_API_KEY] -X POST \
>-H 'Content-Type: application/json' \
>-d '{"jsonrpc":"2.0","id":"1","method":"eth_call","params":[{"to":"0xCONTRACT_ADDRESS","data":"0xCALLDATA"},"latest"]}'

eth_getLogs

Fetch logs matching a filter. See Throughput for block range and event count limits.

$curl -s https://[YOUR_RPC_URL]/[YOUR_API_KEY] -X POST \
>-H 'Content-Type: application/json' \
>-d '{"jsonrpc":"2.0","id":"1","method":"eth_getLogs","params":[{"fromBlock":"0x0","toBlock":"latest","address":"0xCONTRACT_ADDRESS"}]}'