API Reference
Introduction
The AllChains Node Service API allows you to interact with multiple blockchain networks through a unified RESTful API. This reference guide details all available endpoints, parameters, and response formats.
Authentication
All API requests require authentication using an API key. Include your API key in the X-API-KEY
header with each request.
// Example authentication header
X-API-KEY: your-api-key-here
You can obtain your API key from your account dashboard after registration.
Base URL
All API requests should be made to the following base URL:
https://api.allchains.cloud
Endpoints
The following endpoints are available for interacting with blockchain networks:
GETGet Block
/v1/{chain}/block/{block_identifier}
Get block details by block number or block hash.
Parameters
Name | Type | Required | Description |
---|---|---|---|
chain | string | Yes | Chain symbol (eth, btc, etc) |
block_identifier | string | Yes | Block number or block hash |
Example Response
{ "code": 1, "msg": "success", "data": { "hash": "0x...", "number": 17000000, "timestamp": 1676394889, "transactions": [...], "miner": "0x...", "difficulty": "0x...", "totalDifficulty": "0x...", "size": 12345, "gasUsed": 12345678, "gasLimit": 30000000 } }
GETGet Transaction
/v1/{chain}/tx/{tx_hash}
Get transaction details by transaction hash.
Parameters
Name | Type | Required | Description |
---|---|---|---|
chain | string | Yes | Chain symbol (eth, btc, etc) |
tx_hash | string | Yes | Transaction hash |
Example Response
{ "code": 1, "msg": "success", "data": { "hash": "0x...", "blockHash": "0x...", "blockNumber": 17000000, "from": "0x...", "to": "0x...", "value": "0x...", "gas": 21000, "gasPrice": "0x...", "input": "0x...", "nonce": 123, "timestamp": 1676394889 } }
GETGet Address Balance
/v1/{chain}/address/{address}/balance
Get the balance of an address.
Parameters
Name | Type | Required | Description |
---|---|---|---|
chain | string | Yes | Chain symbol (eth, btc, etc) |
address | string | Yes | Blockchain address |
Example Response
{ "code": 1, "msg": "success", "data": { "address": "0x...", "balance": "1000000000000000000" } }
GETGet Gas Price
/v1/{chain}/gas-price
Get the current gas price. Only applicable to EVM-compatible chains.
Parameters
Name | Type | Required | Description |
---|---|---|---|
chain | string | Yes | Chain symbol (eth, bsc, etc) |
Example Response
{ "code": 1, "msg": "success", "data": { "gasPrice": "0x...", "baseFee": "0x...", "priorityFee": { "slow": "0x...", "standard": "0x...", "fast": "0x..." } } }
POSTCall Contract
/v1/{chain}/contract/call
Call a smart contract method (read-only).
Parameters
Name | Type | Required | Description |
---|---|---|---|
chain | string | Yes | Chain symbol (eth, bsc, etc) |
Request Body
{ "to": "0x...", "data": "0x...", "block": "latest" }
Example Response
{ "code": 1, "msg": "success", "data": { "result": "0x..." } }
Error Codes
The API returns standard HTTP status codes and a JSON response body with error details when an error occurs.
Code | Description |
---|---|
200 | Success. The response body will contain the requested data. |
400 | Bad Request. The request was invalid or cannot be processed. |
401 | Unauthorized. Authentication failed or API key is missing. |
403 | Forbidden. The API key doesn't have permissions for the requested resource. |
404 | Not Found. The requested resource doesn't exist. |
429 | Too Many Requests. Rate limit has been exceeded. |
500 | Internal Server Error. An unexpected error occurred on the server. |
Rate Limits
API requests are subject to rate limiting based on your subscription plan. The current rate limits are:
Plan | Daily Limit | Requests per Second |
---|---|---|
Free | 50 calls | 5 RPS |
Basic | 10,000 calls | 20 RPS |
Professional | 100,000 calls | 50 RPS |
Enterprise | Unlimited | Custom |
If you exceed your rate limit, the API will return a 429 Too Many Requests response. Consider upgrading your plan if you consistently hit these limits.