Learn how to access Ethereum API.
Step 1: To access the available Ethereum methods, use the following native access endpoints:
- Network: Ethereum Mainnet
- Request Type: POST
https://svc.blockdaemon.com/ethereum/mainnet/native
- Network: Ethereum Goerli
- Request Type: POST
https://svc.blockdaemon.com/ethereum/goerli/native
Network: Ethereum Ropsten
Request Type: POST
https://svc.blockdaemon.com/ethereum/ropsten/native
Step 2: You should authorize your request. Learn more: Authentication Guide
Step 3: Specify an Ethereum method in the request body:
{
"jsonrpc": "2.0",
"id": 1,
"method": "YOUR_METHOD",
"params": []
}
Example Request
Here is a cURL example for using eth_blockNumber to get the current block number in Ethereum Mainnet:
curl -X POST \
https://svc.blockdaemon.com/ethereum/mainnet/native \
-H 'Authorization: Bearer YOUR_API_KEY' \
-H 'Content-Type: application/json' \
-d '{"jsonrpc": "2.0", "id": 1, "method": "eth_blockNumber", "params": []}'
The following is a typical response you will get:
{
"jsonrpc": "2.0",
"id": 1,
"result": "0xe9c344"
}