Get started with CDP Node in minutes. This guide shows you how to get your RPC endpoint and make your first blockchain request—both in the browser playground and programmatically in your code.
Prerequisites
That’s it! No complex setup, no infrastructure to manage.
1. Try it in the playground
CDP Node provides RPC endpoints for Base. With Node, you can:- Read blockchain state (blocks, transactions, balances, smart contract data)
- Send transactions to the network
- Monitor events and subscribe to logs
- Call smart contracts on Base
Let's make your first blockchain call using the Node Playground in CDP Portal.Open Node Playground
Navigate to
Node in Portal.
Run the RPC call
The playground has a prefilled
eth_blockNumber call. Click
Run to get the current block number on Base. See results in milliseconds! ⚡
2. Get your RPC endpoint
To use Node in your application, you need an RPC endpoint URL. This is the web address where you send blockchain requests—think of it like an API endpoint, but specifically for blockchain operations.
Select your network
Choose your target network from the dropdown:
- Base Mainnet - For production applications
- Base Sepolia - For development and testing
Copy your endpoint URL
Copy the displayed RPC endpoint URL. It will look like:https://api.developer.coinbase.com/rpc/v1/base/YOUR_CLIENT_API_KEY
The Client API key is automatically included in the URL for authentication.
About Client API KeysYour RPC endpoint URL includes a Client API key, which is designed for client-side use and is safe to include in frontend code. For more details, see CDP API Keys.
3. Make your first request
Now let’s make your first blockchain request programmatically. We’ll query the current block number on Base.
cURL
JavaScript (fetch)
Python
Node.js
curl https://api.developer.coinbase.com/rpc/v1/base/YOUR_CLIENT_API_KEY \
-H "Content-Type: application/json" \
-d '{
"jsonrpc": "2.0",
"id": 1,
"method": "eth_blockNumber"
}'
Response:{
"jsonrpc": "2.0",
"id": 1,
"result": "0x12a4b2c"
}
const rpcUrl = "https://api.developer.coinbase.com/rpc/v1/base/YOUR_CLIENT_API_KEY";
const response = await fetch(rpcUrl, {
method: "POST",
headers: {
"Content-Type": "application/json",
},
body: JSON.stringify({
jsonrpc: "2.0",
id: 1,
method: "eth_blockNumber",
}),
});
const data = await response.json();
console.log("Current block:", parseInt(data.result, 16));
import requests
import json
rpc_url = "https://api.developer.coinbase.com/rpc/v1/base/YOUR_CLIENT_API_KEY"
payload = {
"jsonrpc": "2.0",
"id": 1,
"method": "eth_blockNumber"
}
response = requests.post(rpc_url, json=payload)
result = response.json()
# Convert hex to decimal
block_number = int(result["result"], 16)
print(f"Current block: {block_number}")
const https = require("https");
const rpcUrl = "https://api.developer.coinbase.com/rpc/v1/base/YOUR_CLIENT_API_KEY";
const payload = JSON.stringify({
jsonrpc: "2.0",
id: 1,
method: "eth_blockNumber",
});
const options = {
method: "POST",
headers: {
"Content-Type": "application/json",
},
};
const req = https.request(rpcUrl, options, (res) => {
let data = "";
res.on("data", (chunk) => (data += chunk));
res.on("end", () => {
const result = JSON.parse(data);
console.log("Current block:", parseInt(result.result, 16));
});
});
req.write(payload);
req.end();
Using Ethereum libraries? Node works with any Ethereum-compatible library like ethers.js, viem, web3.js, or web3.py. Just use your RPC endpoint URL as the provider.
What to read next