Overview
________ ___ ___ ________ ___ ________ ___ ___ ________ |\ ____\ |\ \|\ \ |\ __ \ |\ \ |\ ___ \ |\ \ |\ \ |\ ___ \ \ \ \___| \ \ \\\ \\ \ \|\ \\ \ \\ \ \\ \ \\ \ \\_\ \\ \____ \ \ \ \ \ \ __ \\ \ __ \\ \ \\ \ \\ \ \\ \______ \\|____|\ \ \ \ \____ \ \ \ \ \\ \ \ \ \\ \ \\ \ \\ \ \\|_____|\ \ __\_\ \ \ \_______\\ \__\ \__\\ \__\ \__\\ \__\\ \__\\ \__\ \ \__\ |\_______\ \|_______| \|__|\|__| \|__|\|__| \|__| \|__| \|__| \|__| \|_______|
Scroll down for code samples, example requests and responses. Select a language for code samples from the tabs above or the mobile navigation menu.
Kickstart your next crypto project - extended trezor/blockbook API with 10+ blockchains available instantly and 50+ possible on request running on the finest hardware in Germany’s best datacenters at Hetzner
Websocket only via api.chain49.com endpoint possible (RapidAPI does not support it yet)
Service status: status.chain49.com
OpenAPI schema viewer: docs.chain49.com/schema/
OpenAPI schema (direct link): docs.chain49.com/schema/openapi.yaml
Postman collection: docs.chain49.com/schema/collection.json
Just import and set the apiKey
variable in the environment or directly in the collection and you can start making requests
Contact us: [email protected]
Our website: chain49.com
Getting Started 🚀
We recommend the API playground on RapidAPI.com for trying out our API right in the browser: API Playground - rapidapi.com/…/chain49
Or you can use one of these free keys for the direct endpoint with our Postman collection:
ddd26fae5410401ebbb134a603bd6ae6
3459b62416c6481f9dc224f1c1c52e3e
534c67cd847a4d0ebf1909dfe501ac35
edc1304ae6b64ac992017cdfcb1fe155
9d741c5bffc244a1a4faf244d0f94ac6
Key limits: 1 request/second, 1000 requests per day
First thing you need to do in order to use our service is getting an API key which can be achieved in two ways:
- Get a free key on RapidAPI
- Get a free or paid key directly from us (recommended)
Congratulations!
Now that you have your key, you can start making requests in the API playground or you can jump straight in to coding your blockchain software with our backend 🚀
Connect via RapidAPI
Use this URL to connect to the RapidAPI endpoint with specified headers:
https://chain49.p.rapidapi.com
X-RapidAPI-Key: 'REPLACE_WITH_YOUR_API_KEY'
X-RapidAPI-Host: 'chain49.p.rapidapi.com'
If you got your key on RapidAPI then the correct URL endpoint is: https://chain49.p.rapidapi.com
Note: RapidAPI does not support WebSocket (yet) so if that is a requirement for you then you need a direct key.
To authenticate a request, you need to provide 2 values as HTTP headers:
X-RapidAPI-Key and X-RapidAPI-Host
X-RapidAPI-Host is always ‘chain49.p.rapidapi.com’ for every user and only used by RapidAPI to identify the requested API.
X-RapidAPI-Key is your unique identifier for rate limiting and authentication. This key can be retrieved from RapidAPI
Connect to direct endpoint
Use this URL to connect directly to our API with the specified headers:
https://api.chain49.com
X-API-Key: 'REPLACE_WITH_YOUR_API_KEY'
If you got your key directly from our client area then the correct URL endpoint is: https://api.chain49.com
To authenticate a request, you need to provide your key as HTTP header: X-API-Key
X-API-Key is your unique identifier for rate limiting and authentication. The key is shown on the product page in the client area.
Alternative Auth Methods (works only on direct endpoint)
You can pass your key in the URL in multiple ways:
https://[email protected]/ethereum/...
https://api.chain49.com/ethereum/...?api_key=YOUR_API_KEY
To enable usage of the API with clients that don’t support modifying the request headers to supply the API key, we enabled authentication via URL as fallback for maximum compatibility with existing Blockbook clients like bitaccess/blockbook-client or @trezor/blockchain-link.
Blockbook normally only runs on a single blockchain, so in order to use these clients you always have to specify the blockchain you want in the backend node URL like this:
https://[email protected]/bitcoin
There is another special auth method only for Websocket:
https://api.chain49.com/YOUR_API_KEY/ethereum/websocket
This method is required for WS clients that do not send Basic Auth or Query Params even if you specify them (like the native Browser implementation in our WS Playground)
Many WebSocket clients do not give you the option to add additional HTTP headers for authentication so specifiying the key in the URL is a workaround for this.
Making requests
# For RapidAPI users:
# Replace "api.chain49.com" with "chain49.p.rapidapi.com" in the code examples
# The "/api" part of the URL can be omitted (still there for legacy clients):
'/ethereum/api/v2/sendtx' == '/ethereum/v2/sendtx'
# Example requests
# Get a block from the Bitcoin blockchain (with 10 txs per page)
GET https://api.chain49.com/bitcoin/v2/block/16512?pageSize=10
# Broadcast transaction to the Litecoin blockchain
POST https://api.chain49.com/litecoin/api/v2/sendtx/
Always use HTTPS when making requests! Making an HTTP request will redirect you to HTTPS but your API key made it to us unencrypted which is not good.
Our API uses a modified and extended version of trezor/blockbook and is compatible with existing clients. You can access a specific blockchain by providing its name as a URL parameter as shown here on the right.
This enables the use of existing API clients made for Blockbook that also work with our API, like: github.com/bitaccess/blockbook-client
Common principles used in API V2:
- All crypto amounts are transferred as strings, in the lowest denomination (satoshis, wei, …), without decimal point
- Empty fields are omitted. Empty field is a string of value null or “”, a number of value 0, an object of value null or an array without elements. The reason for this is that the interface serves many different coins which use only subset of the fields. Sometimes this principle can lead to slightly confusing results, for example when transaction version is 0, the field version is omitted.
- Optional URL parameters can be specified in the query string like this:
/bitcoin/v2/address/[ADDRESS]?details=txs&page=2
Status
List available blockchains
Code samples
# wget, httpie or any other HTTP client works too
curl -X GET https://api.chain49.com/ \
-H 'Accept: application/json' \
-H 'X-API-Key: YOUR_API_KEY'
const headers = {
'Accept':'application/json',
'X-API-Key':'YOUR_API_KEY'
};
fetch('https://api.chain49.com/',
{
method: 'GET',
headers: headers,
})
.then(function(res) {
return res.json();
}).then(function(body) {
console.log(body);
});
import requests
headers = {
'Accept': 'application/json',
'X-API-Key': 'YOUR_API_KEY'
}
r = requests.get('https://api.chain49.com/', headers = headers)
print(r.json())
require 'rest-client'
require 'json'
headers = {
'Accept' => 'application/json',
'X-API-Key' => 'YOUR_API_KEY'
}
result = RestClient.get 'https://api.chain49.com/',
params: {
}, headers: headers
p JSON.parse(result)
package main
import (
"bytes"
"net/http"
)
func main() {
headers := map[string][]string{
"Accept": []string{"application/json"},
"X-API-Key": []string{"YOUR_API_KEY"},
}
data := bytes.NewBuffer([]byte{jsonReq})
req, err := http.NewRequest("GET", "https://api.chain49.com/", data)
req.Header = headers
client := &http.Client{}
resp, err := client.Do(req)
// ...
}
<?php
require 'vendor/autoload.php';
$headers = array(
'Accept' => 'application/json',
'X-API-Key' => 'YOUR_API_KEY',
);
$client = new \GuzzleHttp\Client();
// Define array of request body.
$request_body = array();
try {
$response = $client->request('GET','https://api.chain49.com/', array(
'headers' => $headers,
'json' => $request_body,
)
);
print_r($response->getBody()->getContents());
}
catch (\GuzzleHttp\Exception\BadResponseException $e) {
// handle exception or api errors.
print_r($e->getMessage());
}
// ...
GET /
Get a list of available blockchains via REST API or JSON-RPC interface
Example responses
Example 1
{
"api.chain49.com/": [
"bitcoin",
"bitcoin-testnet",
"bitcoin-signet",
"bcash",
"bcash-testnet",
"litecoin-testnet",
"litecoin",
"zcash",
"zcash-testnet",
"bsc",
"dogecoin",
"dogecoin-testnet",
"ethereum"
],
"rpc.chain49.com/": [
"bitcoin",
"bitcoin-testnet",
"bitcoin-signet",
"bcash",
"bcash-testnet",
"litecoin-testnet",
"litecoin",
"zcash",
"bsc",
"dogecoin",
"dogecoin-testnet",
"ethereum"
]
}
Responses
Status | Meaning | Description | Schema |
---|---|---|---|
200 | OK | OK | Inline |
Response Schema
Status Code 200
Name | Type | Description |
---|---|---|
api.chain49.com | [string] | - |
rpc.chain49.com | [string] | - |
Blockchain Info Summary
Code samples
# wget, httpie or any other HTTP client works too
curl -X GET https://api.chain49.com/bitcoin \
-H 'Accept: application/json' \
-H 'X-API-Key: YOUR_API_KEY'
const headers = {
'Accept':'application/json',
'X-API-Key':'YOUR_API_KEY'
};
fetch('https://api.chain49.com/bitcoin',
{
method: 'GET',
headers: headers,
})
.then(function(res) {
return res.json();
}).then(function(body) {
console.log(body);
});
import requests
headers = {
'Accept': 'application/json',
'X-API-Key': 'YOUR_API_KEY'
}
r = requests.get('https://api.chain49.com/bitcoin', headers = headers)
print(r.json())
require 'rest-client'
require 'json'
headers = {
'Accept' => 'application/json',
'X-API-Key' => 'YOUR_API_KEY'
}
result = RestClient.get 'https://api.chain49.com/bitcoin',
params: {
}, headers: headers
p JSON.parse(result)
package main
import (
"bytes"
"net/http"
)
func main() {
headers := map[string][]string{
"Accept": []string{"application/json"},
"X-API-Key": []string{"YOUR_API_KEY"},
}
data := bytes.NewBuffer([]byte{jsonReq})
req, err := http.NewRequest("GET", "https://api.chain49.com/bitcoin", data)
req.Header = headers
client := &http.Client{}
resp, err := client.Do(req)
// ...
}
<?php
require 'vendor/autoload.php';
$headers = array(
'Accept' => 'application/json',
'X-API-Key' => 'YOUR_API_KEY',
);
$client = new \GuzzleHttp\Client();
// Define array of request body.
$request_body = array();
try {
$response = $client->request('GET','https://api.chain49.com/bitcoin', array(
'headers' => $headers,
'json' => $request_body,
)
);
print_r($response->getBody()->getContents());
}
catch (\GuzzleHttp\Exception\BadResponseException $e) {
// handle exception or api errors.
print_r($e->getMessage());
}
// ...
GET /{blockchain}
Get basic summary of info relating to the currently selected blockchain
Parameters
Name | Description | Example |
---|---|---|
blockchain | Blockchain name | bitcoin |
Example responses
Example 1
{
"blockbook": {
"coin": "Bitcoin",
"host": "s4",
"version": "0.4.0",
"gitCommit": "83fe6672",
"buildTime": "2023-02-27T02:40:48+00:00",
"syncMode": true,
"initialSync": false,
"inSync": true,
"bestHeight": 784299,
"lastBlockTime": "2023-04-07T02:55:40.032567054Z",
"inSyncMempool": true,
"lastMempoolTime": "2023-04-07T03:04:36.260327616Z",
"mempoolSize": 30785,
"decimals": 8,
"dbSize": 399834379691,
"hasFiatRates": true,
"currentFiatRatesTime": "2023-04-07T03:00:04.080770962Z",
"historicalFiatRatesTime": "2023-04-07T00:00:00Z",
"about": "Blockbook blockchain indexer for https://chain49.com/ - based on trezor/blockbook"
},
"backend": {
"chain": "main",
"blocks": 784299,
"headers": 784299,
"bestBlockHash": "00000000000000000000df1072b381603f20d3e6877cf4689c743e90d2dde719",
"difficulty": "47887764338536.25",
"sizeOnDisk": 534828732178,
"version": "240001",
"subversion": "/Satoshi:24.0.1/",
"protocolVersion": "70016"
}
}
Responses
Status | Meaning | Description | Schema |
---|---|---|---|
200 | OK | OK | Inline |
Response Schema
Status Code 200
Name | Type | Description |
---|---|---|
blockbook | object | - |
coin | string | - |
host | string | - |
version | string | - |
gitCommit | string | - |
buildTime | string | - |
syncMode | boolean | - |
initialSync | boolean | - |
inSync | boolean | - |
bestHeight | integer | - |
lastBlockTime | string | - |
inSyncMempool | boolean | - |
lastMempoolTime | string | - |
mempoolSize | integer | - |
decimals | integer | - |
dbSize | integer | - |
hasFiatRates | boolean | - |
currentFiatRatesTime | string | - |
historicalFiatRatesTime | string | - |
about | string | - |
backend | object | - |
chain | string | - |
blocks | integer | - |
headers | integer | - |
bestBlockHash | string | - |
difficulty | string | - |
sizeOnDisk | integer | - |
version | string | - |
subversion | string | - |
protocolVersion | string | - |
Blocks
Get Block V2
Code samples
# wget, httpie or any other HTTP client works too
curl -X GET https://api.chain49.com/bitcoin/v2/block/00000000000000000035835503f43c878ebb643f3b40bdfd0dfda760da74e73c \
-H 'Accept: application/json' \
-H 'X-API-Key: YOUR_API_KEY'
const headers = {
'Accept':'application/json',
'X-API-Key':'YOUR_API_KEY'
};
fetch('https://api.chain49.com/bitcoin/v2/block/00000000000000000035835503f43c878ebb643f3b40bdfd0dfda760da74e73c',
{
method: 'GET',
headers: headers,
})
.then(function(res) {
return res.json();
}).then(function(body) {
console.log(body);
});
import requests
headers = {
'Accept': 'application/json',
'X-API-Key': 'YOUR_API_KEY'
}
r = requests.get('https://api.chain49.com/bitcoin/v2/block/00000000000000000035835503f43c878ebb643f3b40bdfd0dfda760da74e73c', headers = headers)
print(r.json())
require 'rest-client'
require 'json'
headers = {
'Accept' => 'application/json',
'X-API-Key' => 'YOUR_API_KEY'
}
result = RestClient.get 'https://api.chain49.com/bitcoin/v2/block/00000000000000000035835503f43c878ebb643f3b40bdfd0dfda760da74e73c',
params: {
}, headers: headers
p JSON.parse(result)
package main
import (
"bytes"
"net/http"
)
func main() {
headers := map[string][]string{
"Accept": []string{"application/json"},
"X-API-Key": []string{"YOUR_API_KEY"},
}
data := bytes.NewBuffer([]byte{jsonReq})
req, err := http.NewRequest("GET", "https://api.chain49.com/bitcoin/v2/block/00000000000000000035835503f43c878ebb643f3b40bdfd0dfda760da74e73c", data)
req.Header = headers
client := &http.Client{}
resp, err := client.Do(req)
// ...
}
<?php
require 'vendor/autoload.php';
$headers = array(
'Accept' => 'application/json',
'X-API-Key' => 'YOUR_API_KEY',
);
$client = new \GuzzleHttp\Client();
// Define array of request body.
$request_body = array();
try {
$response = $client->request('GET','https://api.chain49.com/bitcoin/v2/block/00000000000000000035835503f43c878ebb643f3b40bdfd0dfda760da74e73c', array(
'headers' => $headers,
'json' => $request_body,
)
);
print_r($response->getBody()->getContents());
}
catch (\GuzzleHttp\Exception\BadResponseException $e) {
// handle exception or api errors.
print_r($e->getMessage());
}
// ...
GET /{blockchain}/v2/block/{blockHashOrHeight}
Returns information about block with transactions, subject to paging.
Note: Blockbook always follows the main chain of the backend it is attached to. If there is a rollback-reorg in the backend, Blockbook will also do rollback. When you ask for block by height, you will always get the main chain block. If you ask for block by hash, you may get the block from another fork but it is not guaranteed (backend may not keep it)
Parameters
Name | Description | Example |
---|---|---|
page | OPTIONAL specifies page of returned transactions, starting from 1. If out of range, Blockbook returns the closest possible page. |
1 |
pageSize | OPTIONAL number of transactions returned by call (default and maximum 1000) |
1000 |
blockchain | Blockchain name | bitcoin |
blockHashOrHeight | Block hash or height | 00000000000000000035835503f43c878ebb643f3b40bdfd0dfda760da74e73c |
Example responses
Example 1
{
"page": 1,
"totalPages": 1,
"itemsOnPage": 1000,
"hash": "00000000839a8e6886ab5951d76f411475428afc90947ee320161bbf18eb6048",
"previousBlockHash": "000000000019d6689c085ae165831e934ff763ae46a2a6c172b3f1b60a8ce26f",
"nextBlockHash": "000000006a625f06636b8bb6ac7b960a8d03705d1ace08b1a19da3fdcc99ddbd",
"height": 1,
"confirmations": 784303,
"size": 215,
"time": 1231469665,
"version": 1,
"merkleRoot": "0e3e2357e806b6cdb1f70b54c3a3a17b6714ee1f0e68bebb44a74b1efd512098",
"nonce": "2573394689",
"bits": "1d00ffff",
"difficulty": "1",
"txCount": 1,
"txs": [
{
"txid": "0e3e2357e806b6cdb1f70b54c3a3a17b6714ee1f0e68bebb44a74b1efd512098",
"vin": [
{
"n": 0,
"isAddress": false,
"value": "0"
}
],
"vout": [
{
"value": "5000000000",
"n": 0,
"addresses": [
"12c6DSiU4Rq3P4ZxziKxzrL5LmMBrzjrJX"
],
"isAddress": true
}
],
"blockHash": "00000000839a8e6886ab5951d76f411475428afc90947ee320161bbf18eb6048",
"blockHeight": 1,
"confirmations": 784303,
"blockTime": 1231469665,
"value": "5000000000",
"valueIn": "0",
"fees": "0"
}
]
}
Responses
Status | Meaning | Description | Schema |
---|---|---|---|
200 | OK | OK | Inline |
Response Schema
Status Code 200
Name | Type | Description |
---|---|---|
page | integer | - |
totalPages | integer | - |
itemsOnPage | integer | - |
hash | string | - |
previousBlockHash | string | - |
nextBlockHash | string | - |
height | integer | - |
confirmations | integer | - |
size | integer | - |
time | integer | - |
version | integer | - |
merkleRoot | string | - |
nonce | string | - |
bits | string | - |
difficulty | string | - |
txCount | integer | - |
txs | [object] | - |
txid | string | - |
vin | [object] | - |
n | integer | - |
isAddress | boolean | - |
value | string | - |
vout | [object] | - |
value | string | - |
n | integer | - |
addresses | [string] | - |
isAddress | boolean | - |
blockHash | string | - |
blockHeight | integer | - |
confirmations | integer | - |
blockTime | integer | - |
value | string | - |
valueIn | string | - |
fees | string | - |
Get block hash V2
Code samples
# wget, httpie or any other HTTP client works too
curl -X GET https://api.chain49.com/bitcoin/v2/block-index/15 \
-H 'Accept: application/json' \
-H 'X-API-Key: YOUR_API_KEY'
const headers = {
'Accept':'application/json',
'X-API-Key':'YOUR_API_KEY'
};
fetch('https://api.chain49.com/bitcoin/v2/block-index/15',
{
method: 'GET',
headers: headers,
})
.then(function(res) {
return res.json();
}).then(function(body) {
console.log(body);
});
import requests
headers = {
'Accept': 'application/json',
'X-API-Key': 'YOUR_API_KEY'
}
r = requests.get('https://api.chain49.com/bitcoin/v2/block-index/15', headers = headers)
print(r.json())
require 'rest-client'
require 'json'
headers = {
'Accept' => 'application/json',
'X-API-Key' => 'YOUR_API_KEY'
}
result = RestClient.get 'https://api.chain49.com/bitcoin/v2/block-index/15',
params: {
}, headers: headers
p JSON.parse(result)
package main
import (
"bytes"
"net/http"
)
func main() {
headers := map[string][]string{
"Accept": []string{"application/json"},
"X-API-Key": []string{"YOUR_API_KEY"},
}
data := bytes.NewBuffer([]byte{jsonReq})
req, err := http.NewRequest("GET", "https://api.chain49.com/bitcoin/v2/block-index/15", data)
req.Header = headers
client := &http.Client{}
resp, err := client.Do(req)
// ...
}
<?php
require 'vendor/autoload.php';
$headers = array(
'Accept' => 'application/json',
'X-API-Key' => 'YOUR_API_KEY',
);
$client = new \GuzzleHttp\Client();
// Define array of request body.
$request_body = array();
try {
$response = $client->request('GET','https://api.chain49.com/bitcoin/v2/block-index/15', array(
'headers' => $headers,
'json' => $request_body,
)
);
print_r($response->getBody()->getContents());
}
catch (\GuzzleHttp\Exception\BadResponseException $e) {
// handle exception or api errors.
print_r($e->getMessage());
}
// ...
GET /{blockchain}/v2/block-index/{blockHeight}
Get block hash by its height
Note: Blockbook always follows the main chain of the backend it is attached to.
Parameters
Name | Description | Example |
---|---|---|
blockchain | Blockchain name | bitcoin |
blockHeight | Block height/index | 15 |
Example responses
Example 1
{
"blockHash": "ed8f3af8c10ca70a136901c6dd3adf037f0aea8a93fbe9e80939214034300f1e"
}
Responses
Status | Meaning | Description | Schema |
---|---|---|---|
200 | OK | OK | Inline |
Response Schema
Status Code 200
Name | Type | Description |
---|---|---|
blockHash | string | - |
Get raw block data V2
Code samples
# wget, httpie or any other HTTP client works too
curl -X GET https://api.chain49.com/bitcoin/v2/rawblock/00000000000000000035835503f43c878ebb643f3b40bdfd0dfda760da74e73c \
-H 'Accept: application/json' \
-H 'X-API-Key: YOUR_API_KEY'
const headers = {
'Accept':'application/json',
'X-API-Key':'YOUR_API_KEY'
};
fetch('https://api.chain49.com/bitcoin/v2/rawblock/00000000000000000035835503f43c878ebb643f3b40bdfd0dfda760da74e73c',
{
method: 'GET',
headers: headers,
})
.then(function(res) {
return res.json();
}).then(function(body) {
console.log(body);
});
import requests
headers = {
'Accept': 'application/json',
'X-API-Key': 'YOUR_API_KEY'
}
r = requests.get('https://api.chain49.com/bitcoin/v2/rawblock/00000000000000000035835503f43c878ebb643f3b40bdfd0dfda760da74e73c', headers = headers)
print(r.json())
require 'rest-client'
require 'json'
headers = {
'Accept' => 'application/json',
'X-API-Key' => 'YOUR_API_KEY'
}
result = RestClient.get 'https://api.chain49.com/bitcoin/v2/rawblock/00000000000000000035835503f43c878ebb643f3b40bdfd0dfda760da74e73c',
params: {
}, headers: headers
p JSON.parse(result)
package main
import (
"bytes"
"net/http"
)
func main() {
headers := map[string][]string{
"Accept": []string{"application/json"},
"X-API-Key": []string{"YOUR_API_KEY"},
}
data := bytes.NewBuffer([]byte{jsonReq})
req, err := http.NewRequest("GET", "https://api.chain49.com/bitcoin/v2/rawblock/00000000000000000035835503f43c878ebb643f3b40bdfd0dfda760da74e73c", data)
req.Header = headers
client := &http.Client{}
resp, err := client.Do(req)
// ...
}
<?php
require 'vendor/autoload.php';
$headers = array(
'Accept' => 'application/json',
'X-API-Key' => 'YOUR_API_KEY',
);
$client = new \GuzzleHttp\Client();
// Define array of request body.
$request_body = array();
try {
$response = $client->request('GET','https://api.chain49.com/bitcoin/v2/rawblock/00000000000000000035835503f43c878ebb643f3b40bdfd0dfda760da74e73c', array(
'headers' => $headers,
'json' => $request_body,
)
);
print_r($response->getBody()->getContents());
}
catch (\GuzzleHttp\Exception\BadResponseException $e) {
// handle exception or api errors.
print_r($e->getMessage());
}
// ...
GET /{blockchain}/v2/rawblock/{blockHashOrHeight}
Returns the raw hex-encoded block data for a given block hash or height
Parameters
Name | Description | Example |
---|---|---|
blockchain | Blockchain name | bitcoin |
blockHashOrHeight | Block hash or height | 00000000000000000035835503f43c878ebb643f3b40bdfd0dfda760da74e73c |
Example responses
Bitcoin block #1
{
"hex": "010000006fe28c0ab6f1b372c1a6a246ae63f74f931e8365e15a089c68d6190000000000982051fd1e4ba744bbbe680e1fee14677ba1a3c3540bf7b1cdb606e857233e0e61bc6649ffff001d01e362990101000000010000000000000000000000000000000000000000000000000000000000000000ffffffff0704ffff001d0104ffffffff0100f2052a0100000043410496b538e853519c726a2c91e61ec11600ae1390813a627c66fb8be7947be63c52da7589379515d4e0a604f8141781e62294721166bf621e73a82cbf2342c858eeac00000000"
}
Responses
Status | Meaning | Description | Schema |
---|---|---|---|
200 | OK | OK | Inline |
Response Schema
Status Code 200
Name | Type | Description |
---|---|---|
hex | string | - |
Transactions
Get transaction V2
Code samples
# wget, httpie or any other HTTP client works too
curl -X GET https://api.chain49.com/bitcoin/v2/tx/cd8ec77174e426070d0a50779232bba7312b712e2c6843d82d963d7076c61366 \
-H 'Accept: application/json' \
-H 'X-API-Key: YOUR_API_KEY'
const headers = {
'Accept':'application/json',
'X-API-Key':'YOUR_API_KEY'
};
fetch('https://api.chain49.com/bitcoin/v2/tx/cd8ec77174e426070d0a50779232bba7312b712e2c6843d82d963d7076c61366',
{
method: 'GET',
headers: headers,
})
.then(function(res) {
return res.json();
}).then(function(body) {
console.log(body);
});
import requests
headers = {
'Accept': 'application/json',
'X-API-Key': 'YOUR_API_KEY'
}
r = requests.get('https://api.chain49.com/bitcoin/v2/tx/cd8ec77174e426070d0a50779232bba7312b712e2c6843d82d963d7076c61366', headers = headers)
print(r.json())
require 'rest-client'
require 'json'
headers = {
'Accept' => 'application/json',
'X-API-Key' => 'YOUR_API_KEY'
}
result = RestClient.get 'https://api.chain49.com/bitcoin/v2/tx/cd8ec77174e426070d0a50779232bba7312b712e2c6843d82d963d7076c61366',
params: {
}, headers: headers
p JSON.parse(result)
package main
import (
"bytes"
"net/http"
)
func main() {
headers := map[string][]string{
"Accept": []string{"application/json"},
"X-API-Key": []string{"YOUR_API_KEY"},
}
data := bytes.NewBuffer([]byte{jsonReq})
req, err := http.NewRequest("GET", "https://api.chain49.com/bitcoin/v2/tx/cd8ec77174e426070d0a50779232bba7312b712e2c6843d82d963d7076c61366", data)
req.Header = headers
client := &http.Client{}
resp, err := client.Do(req)
// ...
}
<?php
require 'vendor/autoload.php';
$headers = array(
'Accept' => 'application/json',
'X-API-Key' => 'YOUR_API_KEY',
);
$client = new \GuzzleHttp\Client();
// Define array of request body.
$request_body = array();
try {
$response = $client->request('GET','https://api.chain49.com/bitcoin/v2/tx/cd8ec77174e426070d0a50779232bba7312b712e2c6843d82d963d7076c61366', array(
'headers' => $headers,
'json' => $request_body,
)
);
print_r($response->getBody()->getContents());
}
catch (\GuzzleHttp\Exception\BadResponseException $e) {
// handle exception or api errors.
print_r($e->getMessage());
}
// ...
GET /{blockchain}/v2/tx/{txId}
Get transaction returns “normalized” data about transaction, which has the same general structure for all supported coins. It does not return coin specific fields (for example information about Zcash shielded addresses).
A note about the blockTime field: for already mined transaction (confirmations > 0), the field blockTime contains time of the block for transactions in mempool (confirmations == 0), the field contains time when the running instance of Blockbook was first time notified about the transaction. This time may be different in different instances of Blockbook.
Parameters
Name | Description | Example |
---|---|---|
blockchain | Blockchain name | bitcoin |
txId | Transaction ID | cd8ec77174e426070d0a50779232bba7312b712e2c6843d82d963d7076c61366 |
Example responses
Bitcoin-like (confirmed tx)
{
"txid": "9e2bc8fbd40af17a6564831f84aef0cab2046d4bad19e91c09d21bff2c851851",
"version": 1,
"vin": [
{
"txid": "f124e6999bf67e710b9e8a8ac4dbb08a64aa9c264120cf98793455e36a531615",
"vout": 2,
"sequence": 4294967295,
"n": 0,
"addresses": [
"DDhUv8JZGmSxKYV95NLnbRTUKni9cDZD3S"
],
"isAddress": true,
"value": "55795108999999",
"hex": "473...2c7ec77bb982"
}
],
"vout": [
{
"value": "55585679000000",
"n": 0,
"hex": "76a914feaca9d9fa7120c7c587c00c639bb18d40faadd388ac",
"addresses": [
"DUMh1rPrXTrCN2Z9EHsLPg7b78rACHB2h7"
],
"isAddress": true
},
{
"value": "209329999999",
"n": 1,
"hex": "76a914ea8984be785868391d92f49c14933f47c152ea0a88ac",
"addresses": [
"DSXDQ6rnwLX47WFRnemctoXPHA9pLMxqXn"
],
"isAddress": true
}
],
"blockHash": "78d1f3de899a10dd2e580704226ebf9508e95e1706f177fc9c31c47f245d2502",
"blockHeight": 2647927,
"confirmations": 1,
"blockTime": 1553088212,
"size": 234,
"vsize": 153,
"value": "55795008999999",
"valueIn": "55795108999999",
"fees": "100000000",
"hex": "0100000...0011000"
}
Bitcoin-like (unconfirmed tx)
{
"txid": "cd8ec77174e426070d0a50779232bba7312b712e2c6843d82d963d7076c61366",
"version": 2,
"vin": [
{
"txid": "47687cc4abb58d815168686465a38113a0608b2568a6d6480129d197e653f6dc",
"sequence": 4294967295,
"n": 0,
"addresses": [
"bc1qka0gpenex558g8gpxmpx247mwhw695k6a7yhs4"
],
"isAddress": true,
"value": "1983687"
}
],
"vout": [
{
"value": "3106",
"n": 0,
"hex": "0020d7da4868055fde790a8581637ab81c216e17a3f8a099283da6c4a27419ffa539",
"addresses": [
"bc1q6ldys6q9tl08jz59s93h4wquy9hp0glc5zvjs0dxcj38gx0l55uspu8x86"
],
"isAddress": true
},
{
"value": "1979101",
"n": 1,
"hex": "0014381be30ca46ddf378ef69ebc4a601bd6ff30b754",
"addresses": [
"bc1q8qd7xr9ydh0n0rhkn67y5cqm6mlnpd65dcyeeg"
],
"isAddress": true
}
],
"blockHeight": -1,
"confirmations": 0,
"confirmationETABlocks": 3,
"confirmationETASeconds": 2055,
"blockTime": 1675270935,
"size": 234,
"vsize": 153,
"value": "1982207",
"valueIn": "1983687",
"fees": "1480",
"hex": "020000000001...b18f00000000"
}
Ethereum-like (confirmed)
{
"txid": "0xa6c8ae1f91918d09cf2bd67bbac4c168849e672fd81316fa1d26bb9b4fc0f790",
"vin": [
{
"n": 0,
"addresses": [
"0xd446089cf19C3D3Eb1743BeF3A852293Fd2C7775"
],
"isAddress": true
}
],
"vout": [
{
"value": "5615959129349132871",
"n": 0,
"addresses": [
"0xC36442b4a4522E871399CD717aBDD847Ab11FE88"
],
"isAddress": true
}
],
"blockHash": "0x10ea8cfecda89d6d864c1d919911f819c9febc2b455b48c9918cee3c6cdc4adb",
"blockHeight": 16529834,
"confirmations": 3,
"blockTime": 1675204631,
"value": "5615959129349132871",
"fees": "19141662404282012",
"tokenTransfers": [
{
"type": "ERC20",
"from": "0xd446089cf19C3D3Eb1743BeF3A852293Fd2C7775",
"to": "0x3B685307C8611AFb2A9E83EBc8743dc20480716E",
"contract": "0x4E15361FD6b4BB609Fa63C81A2be19d873717870",
"name": "Fantom Token",
"symbol": "FTM",
"decimals": 18,
"value": "15362368338194882707417"
},
{
"type": "ERC20",
"from": "0xC36442b4a4522E871399CD717aBDD847Ab11FE88",
"to": "0x3B685307C8611AFb2A9E83EBc8743dc20480716E",
"contract": "0xC02aaA39b223FE8D0A0e5C4F27eAD9083C756Cc2",
"name": "Wrapped Ether",
"symbol": "WETH",
"decimals": 18,
"value": "5615959129349132871"
},
{
"type": "ERC721",
"from": "0x0000000000000000000000000000000000000000",
"to": "0xd446089cf19C3D3Eb1743BeF3A852293Fd2C7775",
"contract": "0xC36442b4a4522E871399CD717aBDD847Ab11FE88",
"name": "Uniswap V3 Positions NFT-V1",
"symbol": "UNI-V3-POS",
"decimals": 18,
"value": "428189"
}
],
"ethereumSpecific": {
"status": 1,
"nonce": 505,
"gasLimit": 550941,
"gasUsed": 434686,
"gasPrice": "44035608242",
"data": "0xac9650d800000000000000000000",
"parsedData": {
"methodId": "0xfa2b068f",
"name": "Mint",
"function": "mint(address, uint256, uint32, bytes32[], address)",
"params": [
{
"type": "address",
"values": [
"0xa5fD1Da088598e88ba731B0E29AECF0BC2A31F82"
]
},
{
"type": "uint256",
"values": [
"688173296"
]
},
{
"type": "uint32",
"values": [
"0"
]
}
]
},
"internalTransfers": [
{
"type": 0,
"from": "0xC36442b4a4522E871399CD717aBDD847Ab11FE88",
"to": "0xC02aaA39b223FE8D0A0e5C4F27eAD9083C756Cc2",
"value": "5615959129349132871"
}
]
},
"addressAliases": {
"0xC02aaA39b223FE8D0A0e5C4F27eAD9083C756Cc2": {
"Type": "Contract",
"Alias": "Wrapped Ether"
},
"0xC36442b4a4522E871399CD717aBDD847Ab11FE88": {
"Type": "Contract",
"Alias": "Uniswap V3 Positions NFT-V1"
}
}
}
Responses
Status | Meaning | Description | Schema |
---|---|---|---|
200 | OK | OK | Inline |
Response Schema
Status Code 200
Name | Type | Description |
---|---|---|
txid | string | - |
version | integer | - |
vin | [object] | - |
txid | string | - |
vout | integer | - |
sequence | integer | - |
n | integer | - |
addresses | [string] | - |
isAddress | boolean | - |
value | string | - |
hex | string | - |
vout | [object] | - |
value | string | - |
n | integer | - |
hex | string | - |
addresses | [string] | - |
isAddress | boolean | - |
blockHash | string | - |
blockHeight | integer | - |
confirmations | integer | - |
blockTime | integer | - |
size | integer | - |
vsize | integer | - |
value | string | - |
valueIn | string | - |
fees | string | - |
hex | string | - |
Get transaction (as is from Backend) V2
Code samples
# wget, httpie or any other HTTP client works too
curl -X GET https://api.chain49.com/bitcoin/v2/tx-specific/cd8ec77174e426070d0a50779232bba7312b712e2c6843d82d963d7076c61366 \
-H 'Accept: application/json' \
-H 'X-API-Key: YOUR_API_KEY'
const headers = {
'Accept':'application/json',
'X-API-Key':'YOUR_API_KEY'
};
fetch('https://api.chain49.com/bitcoin/v2/tx-specific/cd8ec77174e426070d0a50779232bba7312b712e2c6843d82d963d7076c61366',
{
method: 'GET',
headers: headers,
})
.then(function(res) {
return res.json();
}).then(function(body) {
console.log(body);
});
import requests
headers = {
'Accept': 'application/json',
'X-API-Key': 'YOUR_API_KEY'
}
r = requests.get('https://api.chain49.com/bitcoin/v2/tx-specific/cd8ec77174e426070d0a50779232bba7312b712e2c6843d82d963d7076c61366', headers = headers)
print(r.json())
require 'rest-client'
require 'json'
headers = {
'Accept' => 'application/json',
'X-API-Key' => 'YOUR_API_KEY'
}
result = RestClient.get 'https://api.chain49.com/bitcoin/v2/tx-specific/cd8ec77174e426070d0a50779232bba7312b712e2c6843d82d963d7076c61366',
params: {
}, headers: headers
p JSON.parse(result)
package main
import (
"bytes"
"net/http"
)
func main() {
headers := map[string][]string{
"Accept": []string{"application/json"},
"X-API-Key": []string{"YOUR_API_KEY"},
}
data := bytes.NewBuffer([]byte{jsonReq})
req, err := http.NewRequest("GET", "https://api.chain49.com/bitcoin/v2/tx-specific/cd8ec77174e426070d0a50779232bba7312b712e2c6843d82d963d7076c61366", data)
req.Header = headers
client := &http.Client{}
resp, err := client.Do(req)
// ...
}
<?php
require 'vendor/autoload.php';
$headers = array(
'Accept' => 'application/json',
'X-API-Key' => 'YOUR_API_KEY',
);
$client = new \GuzzleHttp\Client();
// Define array of request body.
$request_body = array();
try {
$response = $client->request('GET','https://api.chain49.com/bitcoin/v2/tx-specific/cd8ec77174e426070d0a50779232bba7312b712e2c6843d82d963d7076c61366', array(
'headers' => $headers,
'json' => $request_body,
)
);
print_r($response->getBody()->getContents());
}
catch (\GuzzleHttp\Exception\BadResponseException $e) {
// handle exception or api errors.
print_r($e->getMessage());
}
// ...
GET /{blockchain}/v2/tx-specific/{txId}
Returns transaction data in the exact format as returned by backend, including all coin specific fields
Parameters
Name | Description | Example |
---|---|---|
blockchain | Blockchain name | bitcoin |
txId | Transaction ID | cd8ec77174e426070d0a50779232bba7312b712e2c6843d82d963d7076c61366 |
Example responses
zCash
{
"hex": "040000808...8e6e73cb009",
"txid": "7a0a0ff6f67bac2a856c7296382b69151949878de6fb0d01a8efa197182b2913",
"overwintered": true,
"version": 4,
"versiongroupid": "892f2085",
"locktime": 0,
"expiryheight": 495680,
"vin": [],
"vout": [],
"vjoinsplit": [],
"valueBalance": 0,
"vShieldedSpend": [
{
"cv": "50258bfa65caa9f42f4448b9194840c7da73afc8159faf7358140bfd0f237962",
"anchor": "6beb3b64ecb30033a9032e1a65a68899917625d1fdd2540e70f19f3078f5dd9b",
"nullifier": "08e5717f6606af7c2b01206ff833eaa6383bb49c7451534b2e16d588956fd10a",
"rk": "36841a9be87a7022445b77f433cdd0355bbed498656ab399aede1e5285e9e4a2",
"proof": "aecf824dbae8eea863ec6...73878c37391f01df520aa",
"spendAuthSig": "65b9477cb1ec5da...1178fe402e5702c646945197108339609"
},
{
"cv": "a5aab3721e33d6d6360eabd21cbd07524495f202149abdc3eb30f245d503678c",
"anchor": "6beb3b64ecb30033a9032e1a65a68899917625d1fdd2540e70f19f3078f5dd9b",
"nullifier": "60e790d6d0e12e777fb2b18bc97cf42a92b1e47460e1bd0b0ffd294c23232cc9",
"rk": "2d741695e76351597712b4a04d2a4e108a116f376283d2d104219b86e2930117",
"proof": "a0c2a6fdcbba966b9894...3a9c3118b76c8e2352d524cbb44c02decaeda7",
"spendAuthSig": "feea902e01eac9ebd...b43b4af6b607ce5b0b38f708"
}
],
"vShieldedOutput": [
{
"cv": "23db384cde862f20238a1004e57ba18f114acabc7fd2ac029757f82af5bd4cab",
"cmu": "3ff5a5ff521fabefb5287fef4feb2642d69ead5fe18e6ac717cfd76a8d4088bc",
"ephemeralKey": "057ff6e059967784fa6ac34ad9ecfd9c0c0aba743b7cd444a65ecc32192d5870",
"encCiphertext": "a533d3b99b...a0204",
"outCiphertext": "4baabc15199504b1...c1ad6a",
"proof": "aa1fb2706cba5...1ec7e81f5deea90d4f57713f3b4fc8d636908235fa378ebf1"
}
],
"bindingSig": "bc018af8808387...5130bb382ad8e6e73cb009",
"blockhash": "0000000001c4aa394e796dd1b82e358f114535204f6f5b6cf4ad58dc439c47af",
"confirmations": 5222,
"time": 1552301566,
"blocktime": 1552301566
}
Responses
Status | Meaning | Description | Schema |
---|---|---|---|
200 | OK | OK | Inline |
Response Schema
Send transaction (in URL) V2
Code samples
# wget, httpie or any other HTTP client works too
curl -X GET https://api.chain49.com/bitcoin/v2/sendtx/01000000017f9a22c9cbf54bd902400df746f138f37bcf5b4d93eb755820e974ba43ed5f42040000006a4730440220037f4ed5427cde81d55b9b6a2fd08c8a25090c2c2fff3a75c1a57625ca8a7118022076c702fe55969fa08137f71afd4851c48e31082dd3c40c919c92cdbc826758d30121029f6da5623c9f9b68a9baf9c1bc7511df88fa34c6c2f71f7c62f2f03ff48dca80feffffff019c9700000000000017a9146144d57c8aff48492c9dfb914e120b20bad72d6f8773d00700 \
-H 'Accept: application/json' \
-H 'X-API-Key: YOUR_API_KEY'
const headers = {
'Accept':'application/json',
'X-API-Key':'YOUR_API_KEY'
};
fetch('https://api.chain49.com/bitcoin/v2/sendtx/01000000017f9a22c9cbf54bd902400df746f138f37bcf5b4d93eb755820e974ba43ed5f42040000006a4730440220037f4ed5427cde81d55b9b6a2fd08c8a25090c2c2fff3a75c1a57625ca8a7118022076c702fe55969fa08137f71afd4851c48e31082dd3c40c919c92cdbc826758d30121029f6da5623c9f9b68a9baf9c1bc7511df88fa34c6c2f71f7c62f2f03ff48dca80feffffff019c9700000000000017a9146144d57c8aff48492c9dfb914e120b20bad72d6f8773d00700',
{
method: 'GET',
headers: headers,
})
.then(function(res) {
return res.json();
}).then(function(body) {
console.log(body);
});
import requests
headers = {
'Accept': 'application/json',
'X-API-Key': 'YOUR_API_KEY'
}
r = requests.get('https://api.chain49.com/bitcoin/v2/sendtx/01000000017f9a22c9cbf54bd902400df746f138f37bcf5b4d93eb755820e974ba43ed5f42040000006a4730440220037f4ed5427cde81d55b9b6a2fd08c8a25090c2c2fff3a75c1a57625ca8a7118022076c702fe55969fa08137f71afd4851c48e31082dd3c40c919c92cdbc826758d30121029f6da5623c9f9b68a9baf9c1bc7511df88fa34c6c2f71f7c62f2f03ff48dca80feffffff019c9700000000000017a9146144d57c8aff48492c9dfb914e120b20bad72d6f8773d00700', headers = headers)
print(r.json())
require 'rest-client'
require 'json'
headers = {
'Accept' => 'application/json',
'X-API-Key' => 'YOUR_API_KEY'
}
result = RestClient.get 'https://api.chain49.com/bitcoin/v2/sendtx/01000000017f9a22c9cbf54bd902400df746f138f37bcf5b4d93eb755820e974ba43ed5f42040000006a4730440220037f4ed5427cde81d55b9b6a2fd08c8a25090c2c2fff3a75c1a57625ca8a7118022076c702fe55969fa08137f71afd4851c48e31082dd3c40c919c92cdbc826758d30121029f6da5623c9f9b68a9baf9c1bc7511df88fa34c6c2f71f7c62f2f03ff48dca80feffffff019c9700000000000017a9146144d57c8aff48492c9dfb914e120b20bad72d6f8773d00700',
params: {
}, headers: headers
p JSON.parse(result)
package main
import (
"bytes"
"net/http"
)
func main() {
headers := map[string][]string{
"Accept": []string{"application/json"},
"X-API-Key": []string{"YOUR_API_KEY"},
}
data := bytes.NewBuffer([]byte{jsonReq})
req, err := http.NewRequest("GET", "https://api.chain49.com/bitcoin/v2/sendtx/01000000017f9a22c9cbf54bd902400df746f138f37bcf5b4d93eb755820e974ba43ed5f42040000006a4730440220037f4ed5427cde81d55b9b6a2fd08c8a25090c2c2fff3a75c1a57625ca8a7118022076c702fe55969fa08137f71afd4851c48e31082dd3c40c919c92cdbc826758d30121029f6da5623c9f9b68a9baf9c1bc7511df88fa34c6c2f71f7c62f2f03ff48dca80feffffff019c9700000000000017a9146144d57c8aff48492c9dfb914e120b20bad72d6f8773d00700", data)
req.Header = headers
client := &http.Client{}
resp, err := client.Do(req)
// ...
}
<?php
require 'vendor/autoload.php';
$headers = array(
'Accept' => 'application/json',
'X-API-Key' => 'YOUR_API_KEY',
);
$client = new \GuzzleHttp\Client();
// Define array of request body.
$request_body = array();
try {
$response = $client->request('GET','https://api.chain49.com/bitcoin/v2/sendtx/01000000017f9a22c9cbf54bd902400df746f138f37bcf5b4d93eb755820e974ba43ed5f42040000006a4730440220037f4ed5427cde81d55b9b6a2fd08c8a25090c2c2fff3a75c1a57625ca8a7118022076c702fe55969fa08137f71afd4851c48e31082dd3c40c919c92cdbc826758d30121029f6da5623c9f9b68a9baf9c1bc7511df88fa34c6c2f71f7c62f2f03ff48dca80feffffff019c9700000000000017a9146144d57c8aff48492c9dfb914e120b20bad72d6f8773d00700', array(
'headers' => $headers,
'json' => $request_body,
)
);
print_r($response->getBody()->getContents());
}
catch (\GuzzleHttp\Exception\BadResponseException $e) {
// handle exception or api errors.
print_r($e->getMessage());
}
// ...
GET /{blockchain}/v2/sendtx/{hex}
Sends new transaction to backend
It is recommended to use POST for sending transactions as there is a limit on how much data can be sent in the URL itself.
Parameters
Name | Description | Example |
---|---|---|
blockchain | Blockchain name | bitcoin |
hex | Transaction hex data | 01000000017f9a22c9cbf54bd902400df746f138f37bcf5b4d93eb755820e974ba43ed5f42040000006a4730440220037f4ed5427cde81d55b9b6a2fd08c8a25090c2c2fff3a75c1a57625ca8a7118022076c702fe55969fa08137f71afd4851c48e31082dd3c40c919c92cdbc826758d30121029f6da5623c9f9b68a9baf9c1bc7511df88fa34c6c2f71f7c62f2f03ff48dca80feffffff019c9700000000000017a9146144d57c8aff48492c9dfb914e120b20bad72d6f8773d00700 |
Example responses
Example 1
{
"result": "7c3be24063f268aaa1ed81b64776798f56088757641a34fb156c4f51ed2e9d25"
}
Responses
Status | Meaning | Description | Schema |
---|---|---|---|
200 | OK | OK | Inline |
Response Schema
Status Code 200
Name | Type | Description |
---|---|---|
result | string | - |
Send transaction (POST) V2
Code samples
# wget, httpie or any other HTTP client works too
curl -X POST https://api.chain49.com/bitcoin/v2/sendtx \
-H 'Content-Type: text/plain' \
-H 'Accept: application/json' \
-H 'X-API-Key: YOUR_API_KEY'
const inputBody = '{}';
const headers = {
'Content-Type':'text/plain',
'Accept':'application/json',
'X-API-Key':'YOUR_API_KEY'
};
fetch('https://api.chain49.com/bitcoin/v2/sendtx',
{
method: 'POST',
headers: headers,
body: inputBody
})
.then(function(res) {
return res.json();
}).then(function(body) {
console.log(body);
});
import requests
headers = {
'Content-Type': 'text/plain',
'Accept': 'application/json',
'X-API-Key': 'YOUR_API_KEY'
}
r = requests.post('https://api.chain49.com/bitcoin/v2/sendtx', headers = headers)
print(r.json())
require 'rest-client'
require 'json'
headers = {
'Content-Type' => 'text/plain',
'Accept' => 'application/json',
'X-API-Key' => 'YOUR_API_KEY'
}
result = RestClient.post 'https://api.chain49.com/bitcoin/v2/sendtx',
params: {
}, headers: headers
p JSON.parse(result)
package main
import (
"bytes"
"net/http"
)
func main() {
headers := map[string][]string{
"Content-Type": []string{"text/plain"},
"Accept": []string{"application/json"},
"X-API-Key": []string{"YOUR_API_KEY"},
}
data := bytes.NewBuffer([]byte{jsonReq})
req, err := http.NewRequest("POST", "https://api.chain49.com/bitcoin/v2/sendtx", data)
req.Header = headers
client := &http.Client{}
resp, err := client.Do(req)
// ...
}
<?php
require 'vendor/autoload.php';
$headers = array(
'Content-Type' => 'text/plain',
'Accept' => 'application/json',
'X-API-Key' => 'YOUR_API_KEY',
);
$client = new \GuzzleHttp\Client();
// Define array of request body.
$request_body = array();
try {
$response = $client->request('POST','https://api.chain49.com/bitcoin/v2/sendtx', array(
'headers' => $headers,
'json' => $request_body,
)
);
print_r($response->getBody()->getContents());
}
catch (\GuzzleHttp\Exception\BadResponseException $e) {
// handle exception or api errors.
print_r($e->getMessage());
}
// ...
POST /{blockchain}/v2/sendtx
Sends new transaction to backend for broadcasting
Body parameter
{}
Parameters
Name | Description | Example |
---|---|---|
blockchain | Blockchain name | bitcoin |
Example responses
Example 1
{
"result": "7c3be24063f268aaa1ed81b64776798f56088757641a34fb156c4f51ed2e9d25"
}
Responses
Status | Meaning | Description | Schema |
---|---|---|---|
200 | OK | OK | Inline |
Response Schema
Status Code 200
Name | Type | Description |
---|---|---|
result | string | - |
Get Mempool V2
Code samples
# wget, httpie or any other HTTP client works too
curl -X GET https://api.chain49.com/bitcoin/v2/mempool \
-H 'Accept: application/json' \
-H 'X-API-Key: YOUR_API_KEY'
const headers = {
'Accept':'application/json',
'X-API-Key':'YOUR_API_KEY'
};
fetch('https://api.chain49.com/bitcoin/v2/mempool',
{
method: 'GET',
headers: headers,
})
.then(function(res) {
return res.json();
}).then(function(body) {
console.log(body);
});
import requests
headers = {
'Accept': 'application/json',
'X-API-Key': 'YOUR_API_KEY'
}
r = requests.get('https://api.chain49.com/bitcoin/v2/mempool', headers = headers)
print(r.json())
require 'rest-client'
require 'json'
headers = {
'Accept' => 'application/json',
'X-API-Key' => 'YOUR_API_KEY'
}
result = RestClient.get 'https://api.chain49.com/bitcoin/v2/mempool',
params: {
}, headers: headers
p JSON.parse(result)
package main
import (
"bytes"
"net/http"
)
func main() {
headers := map[string][]string{
"Accept": []string{"application/json"},
"X-API-Key": []string{"YOUR_API_KEY"},
}
data := bytes.NewBuffer([]byte{jsonReq})
req, err := http.NewRequest("GET", "https://api.chain49.com/bitcoin/v2/mempool", data)
req.Header = headers
client := &http.Client{}
resp, err := client.Do(req)
// ...
}
<?php
require 'vendor/autoload.php';
$headers = array(
'Accept' => 'application/json',
'X-API-Key' => 'YOUR_API_KEY',
);
$client = new \GuzzleHttp\Client();
// Define array of request body.
$request_body = array();
try {
$response = $client->request('GET','https://api.chain49.com/bitcoin/v2/mempool', array(
'headers' => $headers,
'json' => $request_body,
)
);
print_r($response->getBody()->getContents());
}
catch (\GuzzleHttp\Exception\BadResponseException $e) {
// handle exception or api errors.
print_r($e->getMessage());
}
// ...
GET /{blockchain}/v2/mempool
Get a list of transaction IDs currently in the mempool of the node (meaning unconfirmed transactions not included in any block yet)
Note: this route was implemented by us and is therefore not yet supported by existing blockbook clients.
Parameters
Name | Description | Example |
---|---|---|
page | OPTIONAL specifies page of returned transactions, starting from 1. If out of range, Blockbook returns the closest possible page. |
1 |
pageSize | OPTIONAL number of transactions returned by call (default and maximum 1000) |
1000 |
blockchain | Blockchain name | bitcoin |
Example responses
Ethereum (pageSize=10 for brevity)
{
"page": 1,
"totalPages": 28869,
"itemsOnPage": 10,
"mempool": [
{
"time": 1681670945,
"txid": "0xb0f39fdbe618247b5e7f0fc8045365ed6c67633f4327583c7769135c085c498a"
},
{
"time": 1681670945,
"txid": "0x54df29b59e9ca7ecb4c7bb53fe93b1333364d397d219f4e9dde3835104fc7c89"
},
{
"time": 1681670945,
"txid": "0x506e48f10f308631c50046cfca58fbcd3def12f1dc7abfee2a36eb66756e8605"
},
{
"time": 1681670945,
"txid": "0x2d9c3c0798e02a23ff6b7571e7cae18d324a5d8d83251c7efe522eedac99bce0"
},
{
"time": 1681670945,
"txid": "0x25aa7407fe5cc58cb49773de6381e2fc7159d029f2e8fb2e058135c881cebf28"
},
{
"time": 1681670945,
"txid": "0x1928d4550bf4a82730456f1417fb86eefcf0d2aec7f3538b313c17eccc72f806"
},
{
"time": 1681670945,
"txid": "0x029530caef9b333c26b2ece29fe60c2ba8c8f1c268bf3f35334fbbd4b5da250a"
},
{
"time": 1681670944,
"txid": "0xb3c4e4a13fe1ecbd058dd1635f5cad61d5a6e3cef39d535a5752c11135bc4e39"
},
{
"time": 1681670944,
"txid": "0x8cc611bbbc0a5d148ec65302f44e40df6feef137de3e7fe87161d916df0060bc"
},
{
"time": 1681670944,
"txid": "0x18c67887f9b877c9bcd3f41499e3d8b4407d2d1197ce1a74b8e1cd0ef8a415f8"
}
],
"mempoolSize": 288688
}
Responses
Status | Meaning | Description | Schema |
---|---|---|---|
200 | OK | OK | Inline |
Response Schema
Status Code 200
Name | Type | Description |
---|---|---|
page | integer | - |
totalPages | integer | - |
itemsOnPage | integer | - |
mempool | [object] | - |
time | integer | - |
txid | string | - |
mempoolSize | integer | - |
Addresses
Get address V2
Code samples
# wget, httpie or any other HTTP client works too
curl -X GET https://api.chain49.com/bitcoin/v2/address/321x69Cb9HZLWwAWGiUBT1U81r1zPLnEjL \
-H 'Accept: application/json' \
-H 'X-API-Key: YOUR_API_KEY'
const headers = {
'Accept':'application/json',
'X-API-Key':'YOUR_API_KEY'
};
fetch('https://api.chain49.com/bitcoin/v2/address/321x69Cb9HZLWwAWGiUBT1U81r1zPLnEjL',
{
method: 'GET',
headers: headers,
})
.then(function(res) {
return res.json();
}).then(function(body) {
console.log(body);
});
import requests
headers = {
'Accept': 'application/json',
'X-API-Key': 'YOUR_API_KEY'
}
r = requests.get('https://api.chain49.com/bitcoin/v2/address/321x69Cb9HZLWwAWGiUBT1U81r1zPLnEjL', headers = headers)
print(r.json())
require 'rest-client'
require 'json'
headers = {
'Accept' => 'application/json',
'X-API-Key' => 'YOUR_API_KEY'
}
result = RestClient.get 'https://api.chain49.com/bitcoin/v2/address/321x69Cb9HZLWwAWGiUBT1U81r1zPLnEjL',
params: {
}, headers: headers
p JSON.parse(result)
package main
import (
"bytes"
"net/http"
)
func main() {
headers := map[string][]string{
"Accept": []string{"application/json"},
"X-API-Key": []string{"YOUR_API_KEY"},
}
data := bytes.NewBuffer([]byte{jsonReq})
req, err := http.NewRequest("GET", "https://api.chain49.com/bitcoin/v2/address/321x69Cb9HZLWwAWGiUBT1U81r1zPLnEjL", data)
req.Header = headers
client := &http.Client{}
resp, err := client.Do(req)
// ...
}
<?php
require 'vendor/autoload.php';
$headers = array(
'Accept' => 'application/json',
'X-API-Key' => 'YOUR_API_KEY',
);
$client = new \GuzzleHttp\Client();
// Define array of request body.
$request_body = array();
try {
$response = $client->request('GET','https://api.chain49.com/bitcoin/v2/address/321x69Cb9HZLWwAWGiUBT1U81r1zPLnEjL', array(
'headers' => $headers,
'json' => $request_body,
)
);
print_r($response->getBody()->getContents());
}
catch (\GuzzleHttp\Exception\BadResponseException $e) {
// handle exception or api errors.
print_r($e->getMessage());
}
// ...
GET /{blockchain}/v2/address/{address}
Returns balances and transactions of an address. The returned transactions are sorted by block height, newest blocks first.
The details query parameter can specify the level of details returned by the request (default: “txids”). Possible values are:
basic: return only xpub balances, without any derived addresses and transactions
tokens: basic + tokens (addresses) derived from the xpub, subject to tokens parameter
tokenBalances: basic + tokens (addresses) derived from the xpub with balances, subject to tokens parameter
txids: tokenBalances + list of txids, subject to from, to filter and paging
txs: tokenBalances + list of transaction with details, subject to from, to filter and paging
Parameters
Name | Description | Example |
---|---|---|
page | OPTIONAL specifies page of returned transactions, starting from 1. If out of range, Blockbook returns the closest possible page. |
1 |
pageSize | OPTIONAL number of transactions returned by call (default and maximum 1000) |
1000 |
fromBlock | OPTIONAL filter of the returned transactions from block height to block height (default no filter) |
10 |
toBlock | OPTIONAL filter of the returned transactions from block height to block height (default no filter) |
100 |
details | OPTIONAL specifies level of details returned by request |
basic |
contract | OPTIONAL return only transactions which affect specified contract (applicable only to coins which support contracts) |
0xdAC17F958D2ee523a2206206994597C13D831ec7 |
secondary | OPTIONAL specifies secondary (fiat) currency in which the token and total balances are returned in addition to crypto values |
usd |
blockchain | Blockchain name | bitcoin |
address | Wallet address | 321x69Cb9HZLWwAWGiUBT1U81r1zPLnEjL |
Enumerated Values
Parameter | Value |
---|---|
details | basic |
details | tokens |
details | tokenBalances |
details | txids |
details | txslight |
details | txs |
Example responses
Bitcoin-like, details set to “txids”
{
"page": 1,
"totalPages": 1,
"itemsOnPage": 1000,
"address": "D5Z7XrtJNg7hAtznSDMXvfiFmMYphwuWz7",
"balance": "2432468097999991",
"totalReceived": "3992283916999979",
"totalSent": "1559815818999988",
"unconfirmedBalance": "0",
"unconfirmedTxs": 0,
"txs": 3,
"txids": [
"461dd46d5d6f56d765f82e60e6bf0727a3a1d1cb8c4144373d805b152a21d308",
"bdb5b47603c5d174eae3384c368068c8e9d2183b398ed0e31d125defa4447a10",
"5c1d2686d70d82bd8e84b5d3dc4bd0e8485e28cdc865336db6a5e40b2098277d"
]
}
Ethereum-like (details set to “tokenBalances”, secondary set to “usd”)
{
"address": "0x2df3951b2037bA620C20Ed0B73CCF45Ea473e83B",
"balance": "21004631949601199",
"unconfirmedBalance": "0",
"unconfirmedTxs": 0,
"txs": 5,
"nonTokenTxs": 3,
"nonce": "1",
"tokens": [
{
"type": "ERC20",
"name": "Tether USD",
"contract": "0xdAC17F958D2ee523a2206206994597C13D831ec7",
"transfers": 3,
"symbol": "USDT",
"decimals": 6,
"balance": "4913000000",
"baseValue": 3.104622978658881,
"secondaryValue": 4914.214559070491
}
],
"secondaryValue": 33.247601671503574,
"tokensBaseValue": 3.104622978658881,
"tokensSecondaryValue": 4914.214559070491,
"totalBaseValue": 3.125627610608482,
"totalSecondaryValue": 4947.462160741995
}
Responses
Status | Meaning | Description | Schema |
---|---|---|---|
200 | OK | OK | Inline |
Response Schema
Get xpub V2
Code samples
# wget, httpie or any other HTTP client works too
curl -X GET https://api.chain49.com/bitcoin/v2/xpub/tpubDC88gkaZi5HvJGxGDNLADkvtdpni3mLmx6vr2KnXmWMG8zfkBRggsxHVBkUpgcwPe2KKpkyvTJCdXHb1UHEWE64vczyyPQfHr1skBcsRedN \
-H 'Accept: application/json' \
-H 'X-API-Key: YOUR_API_KEY'
const headers = {
'Accept':'application/json',
'X-API-Key':'YOUR_API_KEY'
};
fetch('https://api.chain49.com/bitcoin/v2/xpub/tpubDC88gkaZi5HvJGxGDNLADkvtdpni3mLmx6vr2KnXmWMG8zfkBRggsxHVBkUpgcwPe2KKpkyvTJCdXHb1UHEWE64vczyyPQfHr1skBcsRedN',
{
method: 'GET',
headers: headers,
})
.then(function(res) {
return res.json();
}).then(function(body) {
console.log(body);
});
import requests
headers = {
'Accept': 'application/json',
'X-API-Key': 'YOUR_API_KEY'
}
r = requests.get('https://api.chain49.com/bitcoin/v2/xpub/tpubDC88gkaZi5HvJGxGDNLADkvtdpni3mLmx6vr2KnXmWMG8zfkBRggsxHVBkUpgcwPe2KKpkyvTJCdXHb1UHEWE64vczyyPQfHr1skBcsRedN', headers = headers)
print(r.json())
require 'rest-client'
require 'json'
headers = {
'Accept' => 'application/json',
'X-API-Key' => 'YOUR_API_KEY'
}
result = RestClient.get 'https://api.chain49.com/bitcoin/v2/xpub/tpubDC88gkaZi5HvJGxGDNLADkvtdpni3mLmx6vr2KnXmWMG8zfkBRggsxHVBkUpgcwPe2KKpkyvTJCdXHb1UHEWE64vczyyPQfHr1skBcsRedN',
params: {
}, headers: headers
p JSON.parse(result)
package main
import (
"bytes"
"net/http"
)
func main() {
headers := map[string][]string{
"Accept": []string{"application/json"},
"X-API-Key": []string{"YOUR_API_KEY"},
}
data := bytes.NewBuffer([]byte{jsonReq})
req, err := http.NewRequest("GET", "https://api.chain49.com/bitcoin/v2/xpub/tpubDC88gkaZi5HvJGxGDNLADkvtdpni3mLmx6vr2KnXmWMG8zfkBRggsxHVBkUpgcwPe2KKpkyvTJCdXHb1UHEWE64vczyyPQfHr1skBcsRedN", data)
req.Header = headers
client := &http.Client{}
resp, err := client.Do(req)
// ...
}
<?php
require 'vendor/autoload.php';
$headers = array(
'Accept' => 'application/json',
'X-API-Key' => 'YOUR_API_KEY',
);
$client = new \GuzzleHttp\Client();
// Define array of request body.
$request_body = array();
try {
$response = $client->request('GET','https://api.chain49.com/bitcoin/v2/xpub/tpubDC88gkaZi5HvJGxGDNLADkvtdpni3mLmx6vr2KnXmWMG8zfkBRggsxHVBkUpgcwPe2KKpkyvTJCdXHb1UHEWE64vczyyPQfHr1skBcsRedN', array(
'headers' => $headers,
'json' => $request_body,
)
);
print_r($response->getBody()->getContents());
}
catch (\GuzzleHttp\Exception\BadResponseException $e) {
// handle exception or api errors.
print_r($e->getMessage());
}
// ...
GET /{blockchain}/v2/xpub/{xpub}
Returns balances and transactions of an xpub or output descriptor, applicable only for Bitcoin-type coins.
Blockbook supports BIP44, BIP49, BIP84 and BIP86 (Taproot) derivation schemes, using either xpubs or output descriptors (see https://github.com/bitcoin/bitcoin/blob/master/doc/descriptors.md)
Note: usedTokens always returns total number of used addresses of xpub.
Detailed documentation found here: https://github.com/trezor/blockbook/blob/master/docs/api.md#get-xpub
Parameters
Name | Description | Example |
---|---|---|
page | OPTIONAL specifies page of returned transactions, starting from 1. If out of range, Blockbook returns the closest possible page. |
1 |
pageSize | OPTIONAL number of transactions returned by call (default and maximum 1000) |
1000 |
fromBlock | OPTIONAL filter of the returned transactions from block height to block height (default no filter) |
10 |
toBlock | OPTIONAL filter of the returned transactions from block height to block height (default no filter) |
100 |
details | OPTIONAL specifies level of details returned by request |
basic |
tokens | OPTIONAL specifies what tokens (xpub addresses) are returned by the request (default nonzero) |
used |
secondary | OPTIONAL specifies secondary (fiat) currency in which the token and total balances are returned in addition to crypto values |
usd |
blockchain | Blockchain name | bitcoin |
xpub | xpub or output descriptor, applicable only for Bitcoin-type coins | tpubDC88gkaZi5HvJGxGDNLADkvtdpni3mLmx6vr2KnXmWMG8zfkBRggsxHVBkUpgcwPe2KKpkyvTJCdXHb1UHEWE64vczyyPQfHr1skBcsRedN |
Enumerated Values
Parameter | Value |
---|---|
details | basic |
details | tokens |
details | tokenBalances |
details | txids |
details | txslight |
details | txs |
tokens | nonzero |
tokens | used |
tokens | derived |
Example responses
Example 1
{
"page": 1,
"totalPages": 1,
"itemsOnPage": 1000,
"address": "dgub8sbe5Mi8LA4dXB9zPfLZW8arm...9Vjp2HHx91xdDEmWYpmD49fpoUYF",
"balance": "90000000",
"totalReceived": "3093381250",
"totalSent": "3083381250",
"unconfirmedBalance": "0",
"unconfirmedTxs": 0,
"txs": 5,
"txids": [
"383ccb5da16fccad294e24a2ef77bdee5810573bb1b252d8b2af4f0ac8c4e04c",
"75fb93d47969ac92112628e39148ad22323e96f0004c18f8c75938cffb6c1798",
"e8cd84f204b4a42b98e535e72f461dd9832aa081458720b0a38db5856a884876",
"57833d50969208091bd6c950599a1b5cf9d66d992ae8a8d3560fb943b98ebb23",
"9cfd6295f20e74ddca6dd816c8eb71a91e4da70fe396aca6f8ce09dc2947839f"
],
"usedTokens": 2,
"tokens": [
{
"type": "XPUBAddress",
"name": "DUCd1B3YBiXL5By15yXgSLZtEkvwsgEdqS",
"path": "m/44'/3'/0'/0/0",
"transfers": 3,
"decimals": 8,
"balance": "90000000",
"totalReceived": "2903986975",
"totalSent": "2803986975"
},
{
"type": "XPUBAddress",
"name": "DKu2a8Wo6zC2dmBBYXwUG3fxWDHbKnNiPj",
"path": "m/44'/3'/0'/1/0",
"transfers": 2,
"decimals": 8,
"balance": "0",
"totalReceived": "279394275",
"totalSent": "279394275"
}
],
"secondaryValue": 21195.47633568
}
Responses
Status | Meaning | Description | Schema |
---|---|---|---|
200 | OK | OK | Inline |
Response Schema
Status Code 200
Name | Type | Description |
---|---|---|
page | integer | - |
totalPages | integer | - |
itemsOnPage | integer | - |
address | string | - |
balance | string | - |
totalReceived | string | - |
totalSent | string | - |
unconfirmedBalance | string | - |
unconfirmedTxs | integer | - |
txs | integer | - |
txids | [string] | - |
usedTokens | integer | - |
tokens | [object] | - |
type | string | - |
name | string | - |
path | string | - |
transfers | integer | - |
decimals | integer | - |
balance | string | - |
totalReceived | string | - |
totalSent | string | - |
secondaryValue | number | - |
Get UTXO V2
Code samples
# wget, httpie or any other HTTP client works too
curl -X GET https://api.chain49.com/bitcoin/v2/utxo/321x69Cb9HZLWwAWGiUBT1U81r1zPLnEjL \
-H 'Accept: application/json' \
-H 'X-API-Key: YOUR_API_KEY'
const headers = {
'Accept':'application/json',
'X-API-Key':'YOUR_API_KEY'
};
fetch('https://api.chain49.com/bitcoin/v2/utxo/321x69Cb9HZLWwAWGiUBT1U81r1zPLnEjL',
{
method: 'GET',
headers: headers,
})
.then(function(res) {
return res.json();
}).then(function(body) {
console.log(body);
});
import requests
headers = {
'Accept': 'application/json',
'X-API-Key': 'YOUR_API_KEY'
}
r = requests.get('https://api.chain49.com/bitcoin/v2/utxo/321x69Cb9HZLWwAWGiUBT1U81r1zPLnEjL', headers = headers)
print(r.json())
require 'rest-client'
require 'json'
headers = {
'Accept' => 'application/json',
'X-API-Key' => 'YOUR_API_KEY'
}
result = RestClient.get 'https://api.chain49.com/bitcoin/v2/utxo/321x69Cb9HZLWwAWGiUBT1U81r1zPLnEjL',
params: {
}, headers: headers
p JSON.parse(result)
package main
import (
"bytes"
"net/http"
)
func main() {
headers := map[string][]string{
"Accept": []string{"application/json"},
"X-API-Key": []string{"YOUR_API_KEY"},
}
data := bytes.NewBuffer([]byte{jsonReq})
req, err := http.NewRequest("GET", "https://api.chain49.com/bitcoin/v2/utxo/321x69Cb9HZLWwAWGiUBT1U81r1zPLnEjL", data)
req.Header = headers
client := &http.Client{}
resp, err := client.Do(req)
// ...
}
<?php
require 'vendor/autoload.php';
$headers = array(
'Accept' => 'application/json',
'X-API-Key' => 'YOUR_API_KEY',
);
$client = new \GuzzleHttp\Client();
// Define array of request body.
$request_body = array();
try {
$response = $client->request('GET','https://api.chain49.com/bitcoin/v2/utxo/321x69Cb9HZLWwAWGiUBT1U81r1zPLnEjL', array(
'headers' => $headers,
'json' => $request_body,
)
);
print_r($response->getBody()->getContents());
}
catch (\GuzzleHttp\Exception\BadResponseException $e) {
// handle exception or api errors.
print_r($e->getMessage());
}
// ...
GET /{blockchain}/v2/utxo/{addressOrXpub}
Returns array of unspent transaction outputs of address or xpub, applicable only for Bitcoin-type coins. By default, the list contains both confirmed and unconfirmed transactions. The query parameter confirmed=true disables return of unconfirmed transactions. The returned utxos are sorted by block height, newest blocks first. For xpubs or output descriptors, the response also contains address and derivation path of the utxo.
Unconfirmed utxos do not have field height, the field confirmations has value 0 and may contain field lockTime, if not zero.
Coinbase utxos have field coinbase set to true, however due to performance reasons only up to minimum coinbase confirmations limit (100). After this limit, utxos are not detected as coinbase.
Parameters
Name | Description | Example |
---|---|---|
confirmed | OPTIONAL confirmed=true disables return of unconfirmed transactions |
true |
blockchain | Blockchain name | bitcoin |
addressOrXpub | Address or XPUB | 321x69Cb9HZLWwAWGiUBT1U81r1zPLnEjL |
Example responses
Example 1
[
{
"txid": "13d26cd939bf5d155b1c60054e02d9c9b832a85e6ec4f2411be44b6b5a2842e9",
"vout": 0,
"value": "1422303206539",
"confirmations": 0,
"lockTime": 2648100
},
{
"txid": "a79e396a32e10856c97b95f43da7e9d2b9a11d446f7638dbd75e5e7603128cac",
"vout": 1,
"value": "39748685",
"height": 2648043,
"confirmations": 47,
"coinbase": true
},
{
"txid": "de4f379fdc3ea9be063e60340461a014f372a018d70c3db35701654e7066b3ef",
"vout": 0,
"value": "122492339065",
"height": 2646043,
"confirmations": 2047
},
{
"txid": "9e8eb9b3d2e8e4b5d6af4c43a9196dfc55a05945c8675904d8c61f404ea7b1e9",
"vout": 0,
"value": "142771322208",
"height": 2644885,
"confirmations": 3205
}
]
Responses
Status | Meaning | Description | Schema |
---|---|---|---|
200 | OK | OK | Inline |
Response Schema
Get Balance History V2
Code samples
# wget, httpie or any other HTTP client works too
curl -X GET https://api.chain49.com/bitcoin/v2/balancehistory/321x69Cb9HZLWwAWGiUBT1U81r1zPLnEjL \
-H 'Accept: application/json' \
-H 'X-API-Key: YOUR_API_KEY'
const headers = {
'Accept':'application/json',
'X-API-Key':'YOUR_API_KEY'
};
fetch('https://api.chain49.com/bitcoin/v2/balancehistory/321x69Cb9HZLWwAWGiUBT1U81r1zPLnEjL',
{
method: 'GET',
headers: headers,
})
.then(function(res) {
return res.json();
}).then(function(body) {
console.log(body);
});
import requests
headers = {
'Accept': 'application/json',
'X-API-Key': 'YOUR_API_KEY'
}
r = requests.get('https://api.chain49.com/bitcoin/v2/balancehistory/321x69Cb9HZLWwAWGiUBT1U81r1zPLnEjL', headers = headers)
print(r.json())
require 'rest-client'
require 'json'
headers = {
'Accept' => 'application/json',
'X-API-Key' => 'YOUR_API_KEY'
}
result = RestClient.get 'https://api.chain49.com/bitcoin/v2/balancehistory/321x69Cb9HZLWwAWGiUBT1U81r1zPLnEjL',
params: {
}, headers: headers
p JSON.parse(result)
package main
import (
"bytes"
"net/http"
)
func main() {
headers := map[string][]string{
"Accept": []string{"application/json"},
"X-API-Key": []string{"YOUR_API_KEY"},
}
data := bytes.NewBuffer([]byte{jsonReq})
req, err := http.NewRequest("GET", "https://api.chain49.com/bitcoin/v2/balancehistory/321x69Cb9HZLWwAWGiUBT1U81r1zPLnEjL", data)
req.Header = headers
client := &http.Client{}
resp, err := client.Do(req)
// ...
}
<?php
require 'vendor/autoload.php';
$headers = array(
'Accept' => 'application/json',
'X-API-Key' => 'YOUR_API_KEY',
);
$client = new \GuzzleHttp\Client();
// Define array of request body.
$request_body = array();
try {
$response = $client->request('GET','https://api.chain49.com/bitcoin/v2/balancehistory/321x69Cb9HZLWwAWGiUBT1U81r1zPLnEjL', array(
'headers' => $headers,
'json' => $request_body,
)
);
print_r($response->getBody()->getContents());
}
catch (\GuzzleHttp\Exception\BadResponseException $e) {
// handle exception or api errors.
print_r($e->getMessage());
}
// ...
GET /{blockchain}/v2/balancehistory/{addressOrXpub}
Returns a balance history for the specified XPUB or address
The value of sentToSelf is the amount sent from the same address to the same address or within addresses of xpub.
Parameters
Name | Description | Example |
---|---|---|
fromDate | OPTIONAL specifies a start date as a Unix timestamp |
1578391200 |
toDate | OPTIONAL specifies an end date as a Unix timestamp |
1599053802 |
fiatcurrency | OPTIONAL if specified, the response will contain secondary (fiat) rate at the time of transaction. If not, all available currencies will be returned |
usd |
groupBy | OPTIONAL an interval in seconds, to group results by. Default is 3600 seconds |
172800 |
blockchain | Blockchain name | bitcoin |
addressOrXpub | Address or XPUB | 321x69Cb9HZLWwAWGiUBT1U81r1zPLnEjL |
Example responses
fiatcurrency not specified
[
{
"time": 1578391200,
"txs": 5,
"received": "5000000",
"sent": "0",
"sentToSelf": "100000",
"rates": {
"usd": 7855.9,
"eur": 6838.13
}
},
{
"time": 1578488400,
"txs": 1,
"received": "0",
"sent": "5000000",
"sentToSelf": "0",
"rates": {
"usd": 8283.11,
"eur": 7464.45
}
}
]
fiatcurrency=usd
[
{
"time": 0,
"txs": 0,
"received": "string",
"sent": "string",
"sentToSelf": "string",
"rates": {}
}
]
fiatcurrency=usd&groupBy=172800
[
{
"time": 0,
"txs": 0,
"received": "string",
"sent": "string",
"sentToSelf": "string",
"rates": {}
}
]
Responses
Status | Meaning | Description | Schema |
---|---|---|---|
200 | OK | OK | Inline |
Response Schema
Status Code 200
Name | Type | Description |
---|---|---|
time | integer | - |
txs | integer | - |
received | string | - |
sent | string | - |
sentToSelf | string | - |
rates | object | - |
Tickers
Get Tickers list V2
Code samples
# wget, httpie or any other HTTP client works too
curl -X GET https://api.chain49.com/bitcoin/v2/tickers-list \
-H 'Accept: application/json' \
-H 'X-API-Key: YOUR_API_KEY'
const headers = {
'Accept':'application/json',
'X-API-Key':'YOUR_API_KEY'
};
fetch('https://api.chain49.com/bitcoin/v2/tickers-list',
{
method: 'GET',
headers: headers,
})
.then(function(res) {
return res.json();
}).then(function(body) {
console.log(body);
});
import requests
headers = {
'Accept': 'application/json',
'X-API-Key': 'YOUR_API_KEY'
}
r = requests.get('https://api.chain49.com/bitcoin/v2/tickers-list', headers = headers)
print(r.json())
require 'rest-client'
require 'json'
headers = {
'Accept' => 'application/json',
'X-API-Key' => 'YOUR_API_KEY'
}
result = RestClient.get 'https://api.chain49.com/bitcoin/v2/tickers-list',
params: {
}, headers: headers
p JSON.parse(result)
package main
import (
"bytes"
"net/http"
)
func main() {
headers := map[string][]string{
"Accept": []string{"application/json"},
"X-API-Key": []string{"YOUR_API_KEY"},
}
data := bytes.NewBuffer([]byte{jsonReq})
req, err := http.NewRequest("GET", "https://api.chain49.com/bitcoin/v2/tickers-list", data)
req.Header = headers
client := &http.Client{}
resp, err := client.Do(req)
// ...
}
<?php
require 'vendor/autoload.php';
$headers = array(
'Accept' => 'application/json',
'X-API-Key' => 'YOUR_API_KEY',
);
$client = new \GuzzleHttp\Client();
// Define array of request body.
$request_body = array();
try {
$response = $client->request('GET','https://api.chain49.com/bitcoin/v2/tickers-list', array(
'headers' => $headers,
'json' => $request_body,
)
);
print_r($response->getBody()->getContents());
}
catch (\GuzzleHttp\Exception\BadResponseException $e) {
// handle exception or api errors.
print_r($e->getMessage());
}
// ...
GET /{blockchain}/v2/tickers-list
Returns a list of available currency rate tickers (secondary currencies) for the specified date, along with an actual data timestamp.
Parameters
Name | Description | Example |
---|---|---|
timestamp | OPTIONAL specifies a Unix timestamp to (/tickers-list) return available tickers for or (/tickers) that specifies a date to return currency rates for. If not specified, the last available rate will be returned. |
1519053802 |
blockchain | Blockchain name | bitcoin |
Example responses
Example 1
{
"ts": 1574346615,
"available_currencies": [
"eur",
"usd"
]
}
Responses
Status | Meaning | Description | Schema |
---|---|---|---|
200 | OK | OK | Inline |
Response Schema
Status Code 200
Name | Type | Description |
---|---|---|
ts | integer | - |
available_currencies | [string] | - |
Get Tickers V2
Code samples
# wget, httpie or any other HTTP client works too
curl -X GET https://api.chain49.com/bitcoin/v2/tickers \
-H 'Accept: application/json' \
-H 'X-API-Key: YOUR_API_KEY'
const headers = {
'Accept':'application/json',
'X-API-Key':'YOUR_API_KEY'
};
fetch('https://api.chain49.com/bitcoin/v2/tickers',
{
method: 'GET',
headers: headers,
})
.then(function(res) {
return res.json();
}).then(function(body) {
console.log(body);
});
import requests
headers = {
'Accept': 'application/json',
'X-API-Key': 'YOUR_API_KEY'
}
r = requests.get('https://api.chain49.com/bitcoin/v2/tickers', headers = headers)
print(r.json())
require 'rest-client'
require 'json'
headers = {
'Accept' => 'application/json',
'X-API-Key' => 'YOUR_API_KEY'
}
result = RestClient.get 'https://api.chain49.com/bitcoin/v2/tickers',
params: {
}, headers: headers
p JSON.parse(result)
package main
import (
"bytes"
"net/http"
)
func main() {
headers := map[string][]string{
"Accept": []string{"application/json"},
"X-API-Key": []string{"YOUR_API_KEY"},
}
data := bytes.NewBuffer([]byte{jsonReq})
req, err := http.NewRequest("GET", "https://api.chain49.com/bitcoin/v2/tickers", data)
req.Header = headers
client := &http.Client{}
resp, err := client.Do(req)
// ...
}
<?php
require 'vendor/autoload.php';
$headers = array(
'Accept' => 'application/json',
'X-API-Key' => 'YOUR_API_KEY',
);
$client = new \GuzzleHttp\Client();
// Define array of request body.
$request_body = array();
try {
$response = $client->request('GET','https://api.chain49.com/bitcoin/v2/tickers', array(
'headers' => $headers,
'json' => $request_body,
)
);
print_r($response->getBody()->getContents());
}
catch (\GuzzleHttp\Exception\BadResponseException $e) {
// handle exception or api errors.
print_r($e->getMessage());
}
// ...
GET /{blockchain}/v2/tickers
Returns currency rate for the specified currency and date. If the currency is not available for that specific timestamp, the next closest rate will be returned. All responses contain an actual rate timestamp.
Parameters
Name | Description | Example |
---|---|---|
timestamp | OPTIONAL specifies a Unix timestamp to (/tickers-list) return available tickers for or (/tickers) that specifies a date to return currency rates for. If not specified, the last available rate will be returned. |
1519053802 |
currency | OPTIONAL specifies a currency of returned rate (“usd”, “eur”, “eth”…). If not specified, all available currencies will be returned |
usd |
blockchain | Blockchain name | bitcoin |
Example responses
no parameters (all available tickers)
{
"ts": 1574346615,
"rates": {
"eur": 7134.1,
"usd": 7914.5
}
}
currency=usd
{
"ts": 1574346615,
"rates": {
"usd": 7914.5
}
}
Responses
Status | Meaning | Description | Schema |
---|---|---|---|
200 | OK | OK | Inline |
Response Schema
Status Code 200
Name | Type | Description |
---|---|---|
ts | integer | - |
rates | object | - |
Fee Estimation
Estimate transaction fee V2
Code samples
# wget, httpie or any other HTTP client works too
curl -X GET https://api.chain49.com/bitcoin/v2/estimatefee/1 \
-H 'Accept: application/json' \
-H 'X-API-Key: YOUR_API_KEY'
const headers = {
'Accept':'application/json',
'X-API-Key':'YOUR_API_KEY'
};
fetch('https://api.chain49.com/bitcoin/v2/estimatefee/1',
{
method: 'GET',
headers: headers,
})
.then(function(res) {
return res.json();
}).then(function(body) {
console.log(body);
});
import requests
headers = {
'Accept': 'application/json',
'X-API-Key': 'YOUR_API_KEY'
}
r = requests.get('https://api.chain49.com/bitcoin/v2/estimatefee/1', headers = headers)
print(r.json())
require 'rest-client'
require 'json'
headers = {
'Accept' => 'application/json',
'X-API-Key' => 'YOUR_API_KEY'
}
result = RestClient.get 'https://api.chain49.com/bitcoin/v2/estimatefee/1',
params: {
}, headers: headers
p JSON.parse(result)
package main
import (
"bytes"
"net/http"
)
func main() {
headers := map[string][]string{
"Accept": []string{"application/json"},
"X-API-Key": []string{"YOUR_API_KEY"},
}
data := bytes.NewBuffer([]byte{jsonReq})
req, err := http.NewRequest("GET", "https://api.chain49.com/bitcoin/v2/estimatefee/1", data)
req.Header = headers
client := &http.Client{}
resp, err := client.Do(req)
// ...
}
<?php
require 'vendor/autoload.php';
$headers = array(
'Accept' => 'application/json',
'X-API-Key' => 'YOUR_API_KEY',
);
$client = new \GuzzleHttp\Client();
// Define array of request body.
$request_body = array();
try {
$response = $client->request('GET','https://api.chain49.com/bitcoin/v2/estimatefee/1', array(
'headers' => $headers,
'json' => $request_body,
)
);
print_r($response->getBody()->getContents());
}
catch (\GuzzleHttp\Exception\BadResponseException $e) {
// handle exception or api errors.
print_r($e->getMessage());
}
// ...
GET /{blockchain}/v2/estimatefee/{confirmationTarget}
Returns an estimated transaction fee for a specific confirmation target. If you want your transaction to be included in the next block, then you give 1 as parameter. If it is not urgent, then you can wait a bit longer and get an estimation for the fifth next block.
Parameters
Name | Description | Example |
---|---|---|
conservative | OPTIONAL Sets fee estimation mode for Bitcoin-like coins. If set to false, fee estimate mode is ECONOMICAL, true means CONSERVATIVE mode which is the default. Has no effect on Ethereum-like coins More info: https://bitcoincore.org/en/doc/24.0.0/rpc/util/estimatesmartfee/ |
false |
blockchain | Blockchain name | bitcoin |
confirmationTarget | Number of blocks in which the transaction should be confirmed | 1 |
Example responses
Bitcoin (confirmationTarget 1)
{
"result": "0.00018096"
}
Ethereum (confirmationTarget 1)
{
"result": "0.000000018768511957"
}
Responses
Status | Meaning | Description | Schema |
---|---|---|---|
200 | OK | OK | Inline |
Response Schema
Status Code 200
Name | Type | Description |
---|---|---|
result | string | - |
NFT
Get NFT metadata V2
Code samples
# wget, httpie or any other HTTP client works too
curl -X GET https://api.chain49.com/ethereum/v2/nft/0x05756b07725dA0101813475333f372a844789Dc2/22 \
-H 'Accept: application/json' \
-H 'X-API-Key: YOUR_API_KEY'
const headers = {
'Accept':'application/json',
'X-API-Key':'YOUR_API_KEY'
};
fetch('https://api.chain49.com/ethereum/v2/nft/0x05756b07725dA0101813475333f372a844789Dc2/22',
{
method: 'GET',
headers: headers,
})
.then(function(res) {
return res.json();
}).then(function(body) {
console.log(body);
});
import requests
headers = {
'Accept': 'application/json',
'X-API-Key': 'YOUR_API_KEY'
}
r = requests.get('https://api.chain49.com/ethereum/v2/nft/0x05756b07725dA0101813475333f372a844789Dc2/22', headers = headers)
print(r.json())
require 'rest-client'
require 'json'
headers = {
'Accept' => 'application/json',
'X-API-Key' => 'YOUR_API_KEY'
}
result = RestClient.get 'https://api.chain49.com/ethereum/v2/nft/0x05756b07725dA0101813475333f372a844789Dc2/22',
params: {
}, headers: headers
p JSON.parse(result)
package main
import (
"bytes"
"net/http"
)
func main() {
headers := map[string][]string{
"Accept": []string{"application/json"},
"X-API-Key": []string{"YOUR_API_KEY"},
}
data := bytes.NewBuffer([]byte{jsonReq})
req, err := http.NewRequest("GET", "https://api.chain49.com/ethereum/v2/nft/0x05756b07725dA0101813475333f372a844789Dc2/22", data)
req.Header = headers
client := &http.Client{}
resp, err := client.Do(req)
// ...
}
<?php
require 'vendor/autoload.php';
$headers = array(
'Accept' => 'application/json',
'X-API-Key' => 'YOUR_API_KEY',
);
$client = new \GuzzleHttp\Client();
// Define array of request body.
$request_body = array();
try {
$response = $client->request('GET','https://api.chain49.com/ethereum/v2/nft/0x05756b07725dA0101813475333f372a844789Dc2/22', array(
'headers' => $headers,
'json' => $request_body,
)
);
print_r($response->getBody()->getContents());
}
catch (\GuzzleHttp\Exception\BadResponseException $e) {
// handle exception or api errors.
print_r($e->getMessage());
}
// ...
GET /{blockchain}/v2/nft/{nftContract}/{nftTokenId}
Only works on Ethereum-like blockchains (currently ethereum and bsc)
Get metadata like name or description for a specified contract and token ID. The resulting data contains a link which can then be used to request the IPFS link for the actual image to display in a block explorer for example.
Note: this route was implemented by us and is therefore not yet supported by existing blockbook clients.
Parameters
Name | Description | Example |
---|---|---|
blockchain | NFT-compatible blockchain name | ethereum |
nftContract | Address of NFT contract | 0x05756b07725dA0101813475333f372a844789Dc2 |
nftTokenId | Unique token ID of NFT | 22 |
Example responses
Post Photography
{
"tokenId": "22",
"uri": "https://ipfs.io/ipfs/QmfARTk1r8Y5gSu3ZguKicTSVeg4J3rTLdnRz78tAREvZ4/metadata.json",
"contractInfo": {
"type": "ERC721",
"contract": "0x05756b07725dA0101813475333f372a844789Dc2",
"name": "Post Photography",
"symbol": "POSTRUTH",
"decimals": 18
}
}
Responses
Status | Meaning | Description | Schema |
---|---|---|---|
200 | OK | OK | Inline |
Response Schema
Status Code 200
Name | Type | Description |
---|---|---|
tokenId | string | - |
uri | string | - |
contractInfo | object | - |
type | string | - |
contract | string | - |
name | string | - |
symbol | string | - |
decimals | integer | - |
JSON-RPC
JSON-RPC Endpoint
Code samples
# wget, httpie or any other HTTP client works too
curl -X POST https://api.chain49.com/bitcoin/rpc \
-H 'Content-Type: application/json' \
-H 'X-API-Key: YOUR_API_KEY'
const inputBody = '{
"jsonrpc": "2.0",
"id": "49",
"method": "getblock",
"params": [
"0000000000000000000435785429211dca22ed6e2444800c88ad042eb0cc0e94",
1
]
}';
const headers = {
'Content-Type':'application/json',
'X-API-Key':'YOUR_API_KEY'
};
fetch('https://api.chain49.com/bitcoin/rpc',
{
method: 'POST',
headers: headers,
body: inputBody
})
.then(function(res) {
return res.json();
}).then(function(body) {
console.log(body);
});
import requests
headers = {
'Content-Type': 'application/json',
'X-API-Key': 'YOUR_API_KEY'
}
r = requests.post('https://api.chain49.com/bitcoin/rpc', headers = headers)
print(r.json())
require 'rest-client'
require 'json'
headers = {
'Content-Type' => 'application/json',
'X-API-Key' => 'YOUR_API_KEY'
}
result = RestClient.post 'https://api.chain49.com/bitcoin/rpc',
params: {
}, headers: headers
p JSON.parse(result)
package main
import (
"bytes"
"net/http"
)
func main() {
headers := map[string][]string{
"Content-Type": []string{"application/json"},
"X-API-Key": []string{"YOUR_API_KEY"},
}
data := bytes.NewBuffer([]byte{jsonReq})
req, err := http.NewRequest("POST", "https://api.chain49.com/bitcoin/rpc", data)
req.Header = headers
client := &http.Client{}
resp, err := client.Do(req)
// ...
}
<?php
require 'vendor/autoload.php';
$headers = array(
'Content-Type' => 'application/json',
'X-API-Key' => 'YOUR_API_KEY',
);
$client = new \GuzzleHttp\Client();
// Define array of request body.
$request_body = array();
try {
$response = $client->request('POST','https://api.chain49.com/bitcoin/rpc', array(
'headers' => $headers,
'json' => $request_body,
)
);
print_r($response->getBody()->getContents());
}
catch (\GuzzleHttp\Exception\BadResponseException $e) {
// handle exception or api errors.
print_r($e->getMessage());
}
// ...
POST /{blockchain}/rpc
Universal JSON-RPC endpoint for all available blockchains. Can also be accessed via rpc.chain49.com/{blockchain}
This endpoint is compatible with wallets like MetaMask or CLI software such as bitcoin-cli
For detailed documentation of each method, check out the official JSON-RPC spec for your coin:
Ethereum & BNB Smart Chain
Bitcoin, Litecoin, Dogecoin etc
Zcash
Available methods for Bitcoin-like coins (Bitcoin, Litecoin, Dogecoin etc)
Ethereum-like coins (Ethereum, BNB Smart Chain and Polygon)
web3_clientVersion
web3_sha3
net_version
net_listening
eth_syncing
eth_mining
eth_gasPrice
eth_blockNumber
eth_chainId
eth_getBalance
eth_getStorageAt
eth_getTransactionCount
eth_getBlockTransactionCountByHash
eth_getBlockTransactionCountByNumber
eth_getUncleCountByBlockHash
eth_getUncleCountByBlockNumber
eth_getCode
eth_sendRawTransaction
eth_call
eth_estimateGas
eth_getBlockByHash
eth_getBlockByNumber
eth_getTransactionByHash
eth_getTransactionByBlockHashAndIndex
eth_getTransactionByBlockNumberAndIndex
eth_getTransactionReceipt
eth_getUncleByBlockHashAndIndex
eth_getUncleByBlockNumberAndIndex
eth_getWork
eth_getProof
XRP Ledger / Ripple
account_lines
account_objects
account_offers
account_tx
account_channels
account_currencies
account_info
gateway_balances
noripple_check
ledger
ledger_closed
ledger_current
ledger_data
ledger_entry
submit_multisigned
transaction_entry
tx
book_offers
deposit_authorized
ripple_path_find
channel_authorize
channel_verify
fee
server_info
server_state
manifest
random
ping
Monero (XMR)
get_block_count
on_get_block_hash
get_block_template
submit_block
get_last_block_header
get_block_header_by_hash
get_block_header_by_height
get_block_headers_range
get_block
get_info
hard_fork_info
get_coinbase_tx_sum
get_version
get_fee_estimate
get_alternate_chains
relay_tx
get_txpool_backlog
get_output_distribution
Body parameter
{
"jsonrpc": "2.0",
"id": "49",
"method": "getblock",
"params": [
"0000000000000000000435785429211dca22ed6e2444800c88ad042eb0cc0e94",
1
]
}
Parameters
Name | Description | Example |
---|---|---|
jsonrpc | OPTIONAL JSON-RPC version number |
2.0 |
id | OPTIONAL Request ID, gets returned in response |
chain49.com |
method | RPC method to call | string |
params | OPTIONAL Optional parameters for method |
** |
blockchain | Blockchain name | bitcoin |
Responses
Status | Meaning | Description | Schema |
---|---|---|---|
200 | OK | OK | None |
JSON-RPC over HTTP
Code samples
# wget, httpie or any other HTTP client works too
curl -X GET https://api.chain49.com/bitcoin/rpc/getblock/000000000003ba27aa200b1cecaad478d2b00432346c3f1f3986da1afd33e506 \
-H 'Accept: application/json' \
-H 'X-API-Key: YOUR_API_KEY'
const headers = {
'Accept':'application/json',
'X-API-Key':'YOUR_API_KEY'
};
fetch('https://api.chain49.com/bitcoin/rpc/getblock/000000000003ba27aa200b1cecaad478d2b00432346c3f1f3986da1afd33e506',
{
method: 'GET',
headers: headers,
})
.then(function(res) {
return res.json();
}).then(function(body) {
console.log(body);
});
import requests
headers = {
'Accept': 'application/json',
'X-API-Key': 'YOUR_API_KEY'
}
r = requests.get('https://api.chain49.com/bitcoin/rpc/getblock/000000000003ba27aa200b1cecaad478d2b00432346c3f1f3986da1afd33e506', headers = headers)
print(r.json())
require 'rest-client'
require 'json'
headers = {
'Accept' => 'application/json',
'X-API-Key' => 'YOUR_API_KEY'
}
result = RestClient.get 'https://api.chain49.com/bitcoin/rpc/getblock/000000000003ba27aa200b1cecaad478d2b00432346c3f1f3986da1afd33e506',
params: {
}, headers: headers
p JSON.parse(result)
package main
import (
"bytes"
"net/http"
)
func main() {
headers := map[string][]string{
"Accept": []string{"application/json"},
"X-API-Key": []string{"YOUR_API_KEY"},
}
data := bytes.NewBuffer([]byte{jsonReq})
req, err := http.NewRequest("GET", "https://api.chain49.com/bitcoin/rpc/getblock/000000000003ba27aa200b1cecaad478d2b00432346c3f1f3986da1afd33e506", data)
req.Header = headers
client := &http.Client{}
resp, err := client.Do(req)
// ...
}
<?php
require 'vendor/autoload.php';
$headers = array(
'Accept' => 'application/json',
'X-API-Key' => 'YOUR_API_KEY',
);
$client = new \GuzzleHttp\Client();
// Define array of request body.
$request_body = array();
try {
$response = $client->request('GET','https://api.chain49.com/bitcoin/rpc/getblock/000000000003ba27aa200b1cecaad478d2b00432346c3f1f3986da1afd33e506', array(
'headers' => $headers,
'json' => $request_body,
)
);
print_r($response->getBody()->getContents());
}
catch (\GuzzleHttp\Exception\BadResponseException $e) {
// handle exception or api errors.
print_r($e->getMessage());
}
// ...
GET /{blockchain}/rpc/{rpcMethod}/{rpcParams}
All JSON-RPC methods are also available as normal HTTP GET routes if you specify a method (and optional parameters) in the URL.
Body parameter
Parameters
Name | Description | Example |
---|---|---|
blockchain | Blockchain name | bitcoin |
rpcMethod | Method to execute on node | getblock |
rpcParams | Optional: Parameters delimited by “/” | 000000000003ba27aa200b1cecaad478d2b00432346c3f1f3986da1afd33e506 |
Example responses
getblock 000000000003ba27aa200b1cecaad478d2b00432346c3f1f3986da1afd33e506
{
"result": {
"hash": "000000000003ba27aa200b1cecaad478d2b00432346c3f1f3986da1afd33e506",
"confirmations": 690937,
"height": 100000,
"version": 1,
"versionHex": "00000001",
"merkleroot": "f3e94742aca4b5ef85488dc37c06c3282295ffec960994b2c0d5ac2a25a95766",
"time": 1293623863,
"mediantime": 1293622620,
"nonce": 274148111,
"bits": "1b04864c",
"difficulty": 14484.1623612254,
"chainwork": "0000000000000000000000000000000000000000000000000644cb7f5234089e",
"nTx": 4,
"previousblockhash": "000000000002d01c1fccc21636b607dfd930d31d01c3a62104612a1719011250",
"nextblockhash": "00000000000080b66c911bd5ba14a74260057311eaeb1982802f7010f1a9f090",
"strippedsize": 957,
"size": 957,
"weight": 3828,
"tx": [
"8c14f0db3df150123e6f3dbbf30f8b955a8249b62ac1d1ff16284aefa3d06d87",
"fff2525b8931402dd09222c50775608f75787bd2b87e56995a7bdd30f79702c4",
"6359f0868171b1d194cbee1af2f16ea598ae8fad666d9b012c8ed2b79a236ec4",
"e9a66845e05d5abc0ad04ec80f774a7e585c6e8db975962d069a522137b80c1d"
]
},
"error": null,
"id": "chain49.com"
}
Responses
Status | Meaning | Description | Schema |
---|---|---|---|
200 | OK | OK | Inline |
Response Schema
Status Code 200
Name | Type | Description |
---|---|---|
result | object | - |
error | object¦null | - |
id | string | - |
WebSocket
Websocket interface is provided at
/{blockchain}/websocket/
or /{api_key}/{blockchain}/websocket/
Specifying the API key in the URL like this only works for the /websocket route!
You can also give the API key via:
- Header (
X-API-Key
) - Basic Auth (
[email protected]
) - Query Param (
/ethereum?api_key=API_KEY
) instead if your client supports it. Trying it out is often the only way of getting to know the behavior of your client.
Our Websocket Playground can be found here. There you can try out all the available methods and event subscriptions possible over Websocket. We even provide a few free keys for testing.
Websocket communication format
{
"id": "1", //an id to help to identify the response
"method": "getInfo",
"params": "<same params as in the equivalent REST API calls>"
}
The following methods are available:
- ping
- getInfo
- getBlockHash
- getAccountInfo
- getAccountUtxo
- getTransaction
- getTransactionSpecific
- getBalanceHistory
- getCurrentFiatRates
- getFiatRatesTickersList
- getFiatRatesForTimestamps
- estimateFee
- sendTransaction
The client can subscribe to the following events:
Example for subscribing to an address (or multiple addresses)
{
"id":"1",
"method":"subscribeAddresses",
"params":{
"addresses":["mnYYiDCb2JZXnqEeXta1nkt5oCVe2RVhJj", "tb1qp0we5epypgj4acd2c4au58045ruud2pd6heuee"]
}
}
subscribeNewBlock
- new block added to blockchainsubscribeNewTransaction
- new transaction added to blockchain (all addresses)subscribeAddresses
- new transaction for a given address (list of addresses) added to mempoolsubscribeFiatRates
- new currency rate ticker
There can be always only one subscription of given event per connection, i.e. new list of addresses replaces previous list of addresses.
Note: If there is reorg on the backend (blockchain), you will get a new block hash with the same or even smaller height if the reorg is deeper
Thank you
What started as a passion project has grown into a small company and we are very proud to present our finished product. It took over a year of dedicated work to make it possible and many different cryptocurrencies can be quite stressful to keep up with.
Now that we have reached the point of a full public release we are eager to see the reaction of the community and how our infrastructure performs under actual peak traffic which isn’t simulated. But nevertheless, we are confident that your reaction will be positive and that our journey in the crypto space has just begun.
If there is anything we can do for you, you need a free test key, a discount for educational purposes or you just want to talk, just write us at [email protected] 😊
Thank you very much for using Chain49 Blockchain API!