HTTP JSON-RPC API
nodewell provides standard Ethereum JSON-RPC API over HTTPS.
Endpoint
https://eth.nodewell.io/v1/YOUR_API_KEYRequest Format
All requests must be POST with Content-Type: application/json.
json
{
"jsonrpc": "2.0",
"method": "eth_blockNumber",
"params": [],
"id": 1
}Response Format
json
{
"jsonrpc": "2.0",
"id": 1,
"result": "0x134a1b0"
}Examples
cURL
bash
curl -X POST https://eth.nodewell.io/v1/YOUR_API_KEY \
-H "Content-Type: application/json" \
-d '{"jsonrpc":"2.0","method":"eth_blockNumber","params":[],"id":1}'JavaScript (fetch)
javascript
const response = await fetch('https://eth.nodewell.io/v1/YOUR_API_KEY', {
method: 'POST',
headers: { 'Content-Type': 'application/json' },
body: JSON.stringify({
jsonrpc: '2.0',
method: 'eth_getBalance',
params: ['0x742d35Cc6634C0532925a3b844Bc9e7595f0bEb2', 'latest'],
id: 1
})
});
const { result } = await response.json();
console.log('Balance (wei):', BigInt(result).toString());Python
python
import requests
response = requests.post(
'https://eth.nodewell.io/v1/YOUR_API_KEY',
json={
'jsonrpc': '2.0',
'method': 'eth_blockNumber',
'params': [],
'id': 1
}
)
block_number = int(response.json()['result'], 16)
print(f'Block: {block_number}')Error Handling
Errors are returned in the response:
json
{
"jsonrpc": "2.0",
"id": 1,
"error": {
"code": -32600,
"message": "Invalid Request"
}
}See Error Codes for a complete list.