Time to read: 1 min
GetBlock
GetBlock is a Blockchain-as-a-Service platform providing API access to full blockchain nodes. It allows developers to interact with blockchains using JSON-RPC, REST, and WebSocket protocols.
Why Choose GetBlock?​
- Broad Blockchain Support: Access Ethereum, Bitcoin, Binance Smart Chain, Solana, and more.
- High Availability: Enterprise-grade reliability with 99.95% uptime.
- Scalable Solutions: Pay-as-you-go plans tailored to your project size.
Supported Protocols​
GetBlock supports these protocols for interacting with blockchain nodes:
- JSON-RPC
- REST
- WebSocket
Key Blockchain Networks​
- Ethereum (
eth-mainnet
,eth-goerli
) - Bitcoin (
btc-mainnet
,btc-testnet
) - Binance Smart Chain (
bsc-mainnet
,bsc-testnet
) - Polygon (
matic-mainnet
,matic-testnet
)
Getting Started with GetBlock API​
1. Sign Up and Get an access Token​
- Create an account at GetBlock.io.
- Generate an access token from your dashboard.
2. Configure Your Endpoint​
- Base URL:
Replace
https://{blockchain}.getblock.io/mainnet/YOUR_API_KEY/
{blockchain}
with the desired blockchain name (e.g.,eth
).
Make Your First Call​
- Use a tool like Postman.
- Use the Ethereum endpoint as an example:
https://go.getblock.io/<ACCESS_TOKEN>/
- Send the following JSON request to fetch the current block number:
{
"jsonrpc": "2.0",
"method": "eth_blockNumber",
"params": [],
"id": 1
} - You’ll receive a response like:
{
"jsonrpc": "2.0",
"method": "eth_blockNumber",
"params": [],
"id": 1
}The
result
field contains the current block number in hexadecimal format.
Info
To learn more about the getBlock connection with Rootstock, including code snippets, RPC endpoints, click the button below:
Rootstock getBlock WebsiteAdvanced Features​
Batch Requests​
Send multiple requests in a single API call for efficiency:
[
{ "jsonrpc": "2.0", "method": "eth_blockNumber", "params": [], "id": 1 },
{ "jsonrpc": "2.0", "method": "eth_getBalance", "params": ["0xAddress", "latest"], "id": 2 }
]
Real-Time Updates with WebSocket​
Subscribe to Ethereum new block events:
{
"jsonrpc": "2.0",
"method": "eth_subscribe",
"params": ["newHeads"],
"id": 1
}