NAV undefined
undefined
bash php javascript

Introduction

Matbea API 2.0 is designed to receive information about cryptocurrency transactions, address balances and their owners. The document presents a methods of Matbea API 2.0, describes the queries parameters and return values. Examples of calling API methods using curl, PHP, and JS (fetch) are given.

HTTP request example

https://api.matbea.net/CURRENCY/METHOD?param[]=VALUE&token=YOUR_TOKEN

Query Parameters:

Parameter Description
CURRENCY Currency type - btc, dash, ltc or zec
METHOD Name of method
VALUE , YOUR_TOKEN Request parameters

Currency supported

Label Currency
btc Bitcooin
dash Dash
ltc Litecoin
zec Zcash

Arrays can be transmitted using the GET and POST methods. Request parameters that are not arrays are only passed in a GET string.

Response

Example response to the request

{
    "error": {},
    "result": {
        "field 1": " ... ",
        "field 2": 12345,
        "field 3": []
    }
}

Response data is returned as json format.

The response data contains the following fields:

Field Type Description
error array Empty result array
result array Array is contain response data

Error requests

Example response to the request if the parameters is incorrect

{
    "error": {
        "code": 1,
        "message": "Transactions are not specified"
    },
    "result": {}
}

Response to the request if the token parameter is missing

{
    "error": {
        "code": 401,
        "message": "no token passed"
    },
    "result": {}
}

Response to the request if the token is empty or incorrect

{
    "error": {
        "code": 401,
        "message": "Incorrect token"
    },
    "result": {}
}

If the request is incorrect, an error message is returned.

The error information contains the following fields:

Field Type Description
error array Array is contain error code and next message
result array Empty result array
code integer Error code
message string Error message

Get informations by addresses

confirmedBalance

Get balance with 50 confirmations of two addresses. Addresses are transmitted by GET method.

curl -g -H "Content-Type: application/json" -H "Accept: application/json" "https://api.matbea.net/btc/confirmedBalance?address[]=1MN3cT9Ro927h4kgpSZ5V7SfYjrwTysXv7&address[]=1BdxBor4JG76RKLAwJZfHC58fWbgidYukz&confirmations=50&token=YOUR_TOKEN"
<?php
$CURRENCY = 'btc';
$ADDR1 = '1MN3cT9Ro927h4kgpSZ5V7SfYjrwTysXv7';
$ADDR2 = '1BdxBor4JG76RKLAwJZfHC58fWbgidYukz';
$CONFIRMATIONS = 50;
$TOKEN = 'YOUR_TOKEN';

$url = 'https://api.matbea.net/' . $CURRENCY . '/confirmedBalance?' .
    'address[]=' . $ADDR1 . '&address[]=' . $ADDR2 . 
    '&confirmations=' . $CONFIRMATIONS . '&token=' . $TOKEN;

$rsh = curl_init();
if ($rsh) {
    curl_setopt($rsh, CURLOPT_URL, $url);
    curl_setopt($rsh, CURLOPT_HTTPHEADER, ['Content-Type:application/json']);
    curl_setopt($rsh, CURLOPT_RETURNTRANSFER, 1);
    curl_setopt($rsh, CURLOPT_POST, 0);
    $r=curl_exec($rsh);
    if (!$r) {
        printf("[E]\t%s (%s)\n", curl_error($rsh), curl_errno($rsh));
    } else {
        printf("%s\n", $r);
    }
    curl_close($rsh);
}
CURRENCY = 'btc';
ADDR1 = '1MN3cT9Ro927h4kgpSZ5V7SfYjrwTysXv7';
ADDR2 = '1BdxBor4JG76RKLAwJZfHC58fWbgidYukz';
CONFIRMATIONS = 50;
TOKEN = 'YOUR_TOKEN';
url = 'https://api.matbea.net/' + CURRENCY + '/confirmedBalance?address[]=' + ADDR1 + '&address[]=' + ADDR2 + '&confirmations=' + CONFIRMATIONS + '&token=' + TOKEN;
fetch(url)
    .then(function (response) {
        return response.json();
    }).then(function (data) {
    console.log(data);
});

The method returns information about the balance of the specified address / addresses for a given number of confirmations.

HTTP request

https://api.matbea.net/CURRENCY/confirmedBalance?address[]=VALUE&confirmations=VALUE

Query parameters

Parameter Type Default Description Request
CURRENCY string - Currency type - btc, dash, ltc or zec URI
address string - The address or array of addresses for which information is requested. Addresses are passed as array URI, POST
confirmations integer 1 The number of confirmations. If the parameter is not passed, then confirmations is assumed default URI

Response

Response example

{
    "error": {},
    "result": {
        "balances": [
            {
                "address": "1MN3cT9Ro927h4kgpSZ5V7SfYjrwTysXv7",
                "balance": 6500
            },
            {
                "address": "1BdxBor4JG76RKLAwJZfHC58fWbgidYukz",
                "balance": 5500
            }
        ],
        "confirmations": 50
    }
}

The query result is returned as json format.

Information on the confirmed balance is represented by the following fields:

Field Type Description
address string Requested address
balance integer Confirmed balance of the requested address
confirmations integer Number of confirmations

If the request contains an invalid address or an address that was not used in transactions, then the contents of the balances array will be empty:

Example of empty result

{
    "error": {},
    "result": {
        "balances": []
    }
}

Other examples

Get balance with 50 confirmations of two addresses. Addresses are transmitted by POST method

curl -g -k -H "Content-Type: application/json" -H "Accept: application/json" -X POST -d "{\"address\":[\"1MN3cT9Ro927h4kgpSZ5V7SfYjrwTysXv7\",\"1BdxBor4JG76RKLAwJZfHC58fWbgidYukz\"]}" "https://api.matbea.net/btc/confirmedBalance?confirmations=50&token=YOUR_TOKEN"
<?php
$CURRENCY = 'btc';
$ADDR1 = '1MN3cT9Ro927h4kgpSZ5V7SfYjrwTysXv7';
$ADDR2 = '1BdxBor4JG76RKLAwJZfHC58fWbgidYukz';
$CONFIRMATIONS = 50;
$TOKEN = 'YOUR_TOKEN';

$url = 'https://api.matbea.net/' . $CURRENCY . '/confirmedBalance?confirmations=' . $CONFIRMATIONS . '&token=' . $TOKEN;
$POSTparam = ['address'=>[$ADDR1, $ADDR2]];

$rsh = curl_init();
if ($rsh) {
    curl_setopt($rsh, CURLOPT_URL, $url);
    curl_setopt($rsh, CURLOPT_HTTPHEADER, ['Content-Type:application/json']);
    curl_setopt($rsh, CURLOPT_RETURNTRANSFER, 1);
    curl_setopt($rsh, CURLOPT_POST, 1);
    curl_setopt($rsh, CURLOPT_POSTFIELDS, json_encode($POSTparam));
    $r=curl_exec($rsh);
    if (!$r) {
        printf("[E]\t%s (%s)\n", curl_error($rsh), curl_errno($rsh));
    } else {
        printf("%s\n", $r);
    }
    curl_close($rsh);
}
CURRENCY = 'btc';
ADDR1 = '1MN3cT9Ro927h4kgpSZ5V7SfYjrwTysXv7';
ADDR2 = '1BdxBor4JG76RKLAwJZfHC58fWbgidYukz';
CONFIRMATIONS = 50;
TOKEN = 'YOUR_TOKEN';
url = 'https://api.matbea.net/' + CURRENCY + '/confirmedBalance?confirmations=' + CONFIRMATIONS + '&token=' + TOKEN;

fetch(url, {
    method: 'post',
    body: JSON.stringify({address: [ADDR1, ADDR2] }) })
        .then(function (response) {
            return response.json();
        }).then(function (data) {
            console.log(data);
        });

Response

{
    "error": {},
    "result": {
        "balances": [
            {
                "address": "1MN3cT9Ro927h4kgpSZ5V7SfYjrwTysXv7",
                "balance": 6500
            },
            {
                "address": "1BdxBor4JG76RKLAwJZfHC58fWbgidYukz",
                "balance": 5500
            }
        ],
        "confirmations": 50
    }
}

Get balance of one address. The address is transmitted by GET method

curl -g -k -H "Content-Type: application/json" -H "Accept: application/json" "https://api.matbea.net/btc/confirmedBalance?address[]=1MN3cT9Ro927h4kgpSZ5V7SfYjrwTysXv7&token=YOUR_TOKEN"
<?php
$CURRENCY = 'btc';
$ADDR1 = '1MN3cT9Ro927h4kgpSZ5V7SfYjrwTysXv7';
$TOKEN = 'YOUR_TOKEN';

$url = 'https://api.matbea.net/' . $CURRENCY . 
    '/confirmedBalance?address[]=' . $ADDR1 . '&token=' . $TOKEN;

$rsh = curl_init();
if ($rsh) {
    curl_setopt($rsh, CURLOPT_URL, $url);
    curl_setopt($rsh, CURLOPT_HTTPHEADER, ['Content-Type:application/json']);
    curl_setopt($rsh, CURLOPT_RETURNTRANSFER, 1);
    curl_setopt($rsh, CURLOPT_POST, 0);
    $r=curl_exec($rsh);
    if (!$r) {
        printf("[E]\t%s (%s)\n", curl_error($rsh), curl_errno($rsh));
    } else {
        printf("%s\n", $r);
    }
    curl_close($rsh);
}
CURRENCY = 'btc';
ADDR1 = '1MN3cT9Ro927h4kgpSZ5V7SfYjrwTysXv7';
TOKEN = 'YOUR_TOKEN';
url = 'https://api.matbea.net/' + CURRENCY + '/confirmedBalance?address[]=' + ADDR1 + '&token=' + TOKEN;
fetch(url)
    .then(function (response) {
        return response.json();
    }).then(function (data) {
    console.log(data);
});

Response

{
    "error": {},
    "result": {
        "balances": [
            {
                "address": "1MN3cT9Ro927h4kgpSZ5V7SfYjrwTysXv7",
                "balance": 6500
            }
        ],
        "confirmations": 1
    }
}

unconfirmedBalance

Request code examples

curl -g -H "Content-Type: application/json" -H "Accept: application/json" "https://api.matbea.net/btc/unconfirmedBalance?address[]=1MN3cT9Ro927h4kgpSZ5V7SfYjrwTysXv7&address[]=1BdxBor4JG76RKLAwJZfHC58fWbgidYukz&token=YOUR_TOKEN"
<?php
$CURRENCY = 'btc';
$ADDR1 = '1MN3cT9Ro927h4kgpSZ5V7SfYjrwTysXv7';
$ADDR2 = '1BdxBor4JG76RKLAwJZfHC58fWbgidYukz';
$TOKEN = 'YOUR_TOKEN';

$url = 'https://api.matbea.net/' . $CURRENCY . '/unconfirmedBalance?' .
    'address[]=' . $ADDR1 . '&address[]=' . $ADDR2 . '&token=' . $TOKEN;

$rsh = curl_init();
if ($rsh) {
    curl_setopt($rsh, CURLOPT_URL, $url);
    curl_setopt($rsh, CURLOPT_HTTPHEADER, ['Content-Type:application/json']);
    curl_setopt($rsh, CURLOPT_RETURNTRANSFER, 1);
    curl_setopt($rsh, CURLOPT_POST, 0);
    $r=curl_exec($rsh);
    if (!$r) {
        printf("[E]\t%s (%s)\n", curl_error($rsh), curl_errno($rsh));
    } else {
        printf("%s\n", $r);
    }
    curl_close($rsh);
}
CURRENCY = 'btc';
ADDR1 = '1MN3cT9Ro927h4kgpSZ5V7SfYjrwTysXv7';
ADDR2 = '1BdxBor4JG76RKLAwJZfHC58fWbgidYukz';
TOKEN = 'YOUR_TOKEN';
url = 'https://api.matbea.net/' + CURRENCY + '/unconfirmedBalance?address[]=' + ADDR1 + '&address[]=' + ADDR2 + '&token=' + TOKEN;
fetch(url)
    .then(function (response) {
        return response.json();
    }).then(function (data) {
    console.log(data);
});

The method returns unconfirmed balance of the specified address / addresses.

HTTP request

https://api.matbea.net/CURRENCY/unconfirmedBalance?address[]=VALUE

Query parameters

Parameter Type Default Description Request
CURRENCY string - Currency type - btc, dash, ltc or zec URI
address string - The address or array of addresses for which information is requested. Addresses are passed as array URI, POST

Response

Response example

{
    "error": {},
    "result": {
        "balances": [
            {
                "address": "1MN3cT9Ro927h4kgpSZ5V7SfYjrwTysXv7",
                "balance": 0
            },
            {
                "address": "1BdxBor4JG76RKLAwJZfHC58fWbgidYukz",
                "balance": 0
            }
        ]
    }
}

The query result is returned as json format.

Information of the uconfirmed balance is represented by the following fields:

Field Type Description
address string Requested address
balance integer Uncofirmed balance of the requested address

If the request contains an invalid address or an address that was not used in transactions, then the contents of the balances array will be empty:

Example of empty result

{
    "error": {},
    "result": {
        "balances": []
    }
}

Example POST request

curl -g -H "Content-Type: application/json" -H "Accept: application/json" -X POST -d "{\"address\":[\"1MN3cT9Ro927h4kgpSZ5V7SfYjrwTysXv7\",\"1BdxBor4JG76RKLAwJZfHC58fWbgidYukz\"]}" "https://api.matbea.net/btc/unconfirmedBalance?token=YOUR_TOKEN"
<?php
$CURRENCY = 'btc';
$ADDR1 = '1MN3cT9Ro927h4kgpSZ5V7SfYjrwTysXv7';
$ADDR2 = '1BdxBor4JG76RKLAwJZfHC58fWbgidYukz';
$TOKEN = 'YOUR_TOKEN';

$url = 'https://api.matbea.net/' . $CURRENCY . '/unconfirmedBalance?token=' . $TOKEN;
$POSTparam=['address'=>[$ADDR1, $ADDR2]];

$rsh = curl_init();
if ($rsh) {
    curl_setopt($rsh, CURLOPT_URL, $url);
    curl_setopt($rsh, CURLOPT_HTTPHEADER, ['Content-Type:application/json']);
    curl_setopt($rsh, CURLOPT_RETURNTRANSFER, 1);
    curl_setopt($rsh, CURLOPT_POST, 1);
    curl_setopt($rsh, CURLOPT_POSTFIELDS, json_encode($POSTparam));
    $r=curl_exec($rsh);
    if (!$r) {
        printf("[E]\t%s (%s)\n", curl_error($rsh), curl_errno($rsh));
    } else {
        printf("%s\n", $r);
    }
    curl_close($rsh);
}
CURRENCY = 'btc';
ADDR1 = '1MN3cT9Ro927h4kgpSZ5V7SfYjrwTysXv7';
ADDR2 = '1BdxBor4JG76RKLAwJZfHC58fWbgidYukz';
TOKEN = 'YOUR_TOKEN';

url = 'https://api.matbea.net/' + CURRENCY + '/unconfirmedBalance?token=' + TOKEN;
fetch(url, {
    method: 'post',
    body: JSON.stringify({address: [ADDR1, ADDR2] }) })
        .then(function (response) {
            return response.json();
        }).then(function (data) {
            console.log(data);
        });

Response

{
    "error": {},
    "result": {
        "balances": [
            {
                "address": "1MN3cT9Ro927h4kgpSZ5V7SfYjrwTysXv7",
                "balance": 0
            },
            {
                "address": "1BdxBor4JG76RKLAwJZfHC58fWbgidYukz",
                "balance": 0
            }
        ]
    }
}

countTransactions

Request code examples

curl -g -H "Content-Type: application/json" -H "Accept: application/json" "https://api.matbea.net/btc/countTransactions?address[]=1MN3cT9Ro927h4kgpSZ5V7SfYjrwTysXv7&address[]=1BdxBor4JG76RKLAwJZfHC58fWbgidYukz&token=YOUR_TOKEN"
<?php
$CURRENCY = 'btc';
$ADDR1 = '1MN3cT9Ro927h4kgpSZ5V7SfYjrwTysXv7';
$ADDR2 = '1BdxBor4JG76RKLAwJZfHC58fWbgidYukz';
$TOKEN = 'YOUR_TOKEN';

$url = 'https://api.matbea.net/' . $CURRENCY . 
    '/countTransactions?address[]=' . $ADDR1 . 
    '&address[]=' . $ADDR2 . '&token='.$TOKEN;

$rsh = curl_init();
if ($rsh) {
    curl_setopt($rsh, CURLOPT_URL, $url);
    curl_setopt($rsh, CURLOPT_HTTPHEADER, ['Content-Type:application/json']);
    curl_setopt($rsh, CURLOPT_RETURNTRANSFER, 1);
    curl_setopt($rsh, CURLOPT_POST, 0);
    $r=curl_exec($rsh);
    if (!$r) {
        printf("[E]\t%s (%s)\n", curl_error($rsh), curl_errno($rsh));
    } else {
        printf("%s\n", $r);
    }
    curl_close($rsh);
}
CURRENCY = 'btc';
ADDR1 = '1MN3cT9Ro927h4kgpSZ5V7SfYjrwTysXv7';
ADDR2 = '1BdxBor4JG76RKLAwJZfHC58fWbgidYukz';
TOKEN = 'YOUR_TOKEN';
url = 'https://api.matbea.net/' + CURRENCY + '/countTransactions?address[]=' + ADDR1 + '&address[]=' + ADDR2 + '&token=' + TOKEN;
fetch(url)
    .then(function (response) {
        return response.json();
    }).then(function (data) {
    console.log(data);
});

The method returns information about the inclusion of address/addresses in the list of confirmed/unconfirmed transactions.

HTTP request

https://api.matbea.net/CURRENCY/countTransactions?address[]=VALUE&confirmed=VALUE

Query parameters

Parameter Type Default Description Request
CURRENCY string - Currency type - btc, dash, ltc or zec URI
address string - Address or array of addresses for which information is requested URI, POST
confirmed boolean - true - address search in confirmed transactions, false - address search in unconfirmed transactions. If the parameter is not set to search in all transactions URI

Response

Response example

{
    "error": {},
    "result": {
        "addresses": [
            {
                "1MN3cT9Ro927h4kgpSZ5V7SfYjrwTysXv7": true
            },
            {
                "ADDRESS": VALUE
            }
        ],
        "confirmed": true
    }
}

The query result is returned as json format. Response are consists by the following fields:

Field Type Description
addresses array Array of searching result
ADDRESS string Requested address
VALUE boolean true - address found, false - address not found
confirmed boolean Search mode, set by 'confirmed' parameter

If the request contains an invalid address or an address that was not used in transactions, the contents of the addresses array will be empty

{
    "error": {},
    "result": {
        "addresses": []
    }
}

Get information about two addresses, do search in confirmed and unconfirmed transactions. Addresses are transmitted using the GET method

curl -g -H "Content-Type: application/json" -H "Accept: application/json" "https://api.matbea.net/btc/countTransactions?address[]=1MN3cT9Ro927h4kgpSZ5V7SfYjrwTysXv7&address[]=1BdxBor4JG76RKLAwJZfHC58fWbgidYukz&token=YOUR_TOKEN"
<?php
$CURRENCY = 'btc';
$ADDR1 = '1MN3cT9Ro927h4kgpSZ5V7SfYjrwTysXv7';
$ADDR2 = '1BdxBor4JG76RKLAwJZfHC58fWbgidYukz';
$TOKEN = 'YOUR_TOKEN';

$url = 'https://api.matbea.net/' . $CURRENCY . 
    '/countTransactions?address[]=' . $ADDR1 . 
    '&address[]=' . $ADDR2 . '&token=' . $TOKEN;

$rsh = curl_init();
if ($rsh) {
    curl_setopt($rsh, CURLOPT_URL, $url);
    curl_setopt($rsh, CURLOPT_HTTPHEADER, ['Content-Type:application/json']);
    curl_setopt($rsh, CURLOPT_RETURNTRANSFER, 1);
    curl_setopt($rsh, CURLOPT_POST, 0);
    $r=curl_exec($rsh);
    if (!$r) {
        printf("[E]\t%s (%s)\n", curl_error($rsh), curl_errno($rsh));
    } else {
        printf("%s\n", $r);
    }
    curl_close($rsh);
}
CURRENCY = 'btc';
ADDR1 = '1MN3cT9Ro927h4kgpSZ5V7SfYjrwTysXv7';
ADDR2 = '1BdxBor4JG76RKLAwJZfHC58fWbgidYukz';
TOKEN = 'YOUR_TOKEN';
url = 'https://api.matbea.net' + CURRENCY + '/countTransactions?address[]=' + ADDR1 + '&address[]=' + ADDR2 + '&token=' + TOKEN;
fetch(url)
    .then(function (response) {
        return response.json();
    }).then(function (data) {
    console.log(data);
});

Response example

{
    "error": {},
    "result": {
        "addresses": [
            {
                "1MN3cT9Ro927h4kgpSZ5V7SfYjrwTysXv7": true
            },
            {
                "1BdxBor4JG76RKLAwJZfHC58fWbgidYukz": true
            }
        ]
    }
}

Get information about two addresses with a search in confirmed transactions. Addresses are transmitted using the GET method

curl -g -H "Content-Type: application/json" -H "Accept: application/json" "https://api.matbea.net/btc/countTransactions?address[]=1MN3cT9Ro927h4kgpSZ5V7SfYjrwTysXv7&address[]=1BdxBor4JG76RKLAwJZfHC58fWbgidYukz&confirmed=true&token=YOUR_TOKEN"
<?php
$CURRENCY = 'btc';
$ADDR1 = '1MN3cT9Ro927h4kgpSZ5V7SfYjrwTysXv7';
$ADDR2 = '1BdxBor4JG76RKLAwJZfHC58fWbgidYukz';
$CONFIRMED = 'true';
$TOKEN = 'YOUR_TOKEN';

$url = 'https://api.matbea.net/' . $CURRENCY . '/countTransactions?address[]=' . $ADDR1 . '&address[]=' . $ADDR2 . '&confirmed=' . $CONFIRMED . '&token=' . $TOKEN;

$rsh = curl_init();
if ($rsh) {
    curl_setopt($rsh, CURLOPT_URL, $url);
    curl_setopt($rsh, CURLOPT_HTTPHEADER, ['Content-Type:application/json']);
    curl_setopt($rsh, CURLOPT_RETURNTRANSFER, 1);
    curl_setopt($rsh, CURLOPT_POST, 0);
    $r=curl_exec($rsh);
    if (!$r) {
        printf("[E]\t%s (%s)\n", curl_error($rsh), curl_errno($rsh));
    } else {
        printf("%s\n", $r);
    }
    curl_close($rsh);
}
CURRENCY = 'btc';
ADDR1 = '1MN3cT9Ro927h4kgpSZ5V7SfYjrwTysXv7';
ADDR2 = '1BdxBor4JG76RKLAwJZfHC58fWbgidYukz';
CONFIRMED = 'true';
TOKEN = 'YOUR_TOKEN';

url = 'https://api.matbea.net/' + CURRENCY + '/countTransactions?address[]=' + ADDR1 + '&address[]=' + ADDR2 + '&confirmed=' + CONFIRMED + '&token=' + TOKEN;
fetch(url)
    .then(function (response) {
        return response.json();
    }).then(function (data) {
    console.log(data);
});

Response example

{
    "error": {},
    "result": {
        "addresses": [
            {
                "1MN3cT9Ro927h4kgpSZ5V7SfYjrwTysXv7": true
            },
            {
                "1BdxBor4JG76RKLAwJZfHC58fWbgidYukz": true
            }
        ],
        "confirmed": true
    }
}

Get information about two addresses, do search in confirmed and unconfirmed transactions. Addresses are transmitted using the POST method

curl -g -H "Content-Type: application/json" -H "Accept: application/json" -X POST -d "{\"address\":[\"1MN3cT9Ro927h4kgpSZ5V7SfYjrwTysXv7\",\"1BdxBor4JG76RKLAwJZfHC58fWbgidYukz\"]}" "https://api.matbea.net/btc/countTransactions?&confirmed=false&token=YOUR_TOKEN"
<?php
$CURRENCY = 'btc';
$ADDR1 = '1MN3cT9Ro927h4kgpSZ5V7SfYjrwTysXv7';
$ADDR2 = '1BdxBor4JG76RKLAwJZfHC58fWbgidYukz';
$CONFIRMED = 'false';
$TOKEN = 'YOUR_TOKEN';

$url = 'https://api.matbea.net' . $CURRENCY . '/countTransactions?confirmed=' . $CONFIRMED . '&token=' . $TOKEN;
$POSTparam=['address'=>[$ADDR1, $ADDR2]];

$rsh = curl_init();
if ($rsh) {
    curl_setopt($rsh, CURLOPT_URL, $url);
    curl_setopt($rsh, CURLOPT_HTTPHEADER, ['Content-Type:application/json']);
    curl_setopt($rsh, CURLOPT_RETURNTRANSFER, 1);
    curl_setopt($rsh, CURLOPT_POST, 1);
    curl_setopt($rsh, CURLOPT_POSTFIELDS, json_encode($POSTparam));
    $r=curl_exec($rsh);
    if (!$r) {
        printf("[E]\t%s (%s)\n", curl_error($rsh), curl_errno($rsh));
    } else {
        printf("%s\n", $r);
    }
    curl_close($rsh);
}
CURRENCY = 'btc';
ADDR1 = '1MN3cT9Ro927h4kgpSZ5V7SfYjrwTysXv7';
ADDR2 = '1BdxBor4JG76RKLAwJZfHC58fWbgidYukz';
CONFIRMED = 'false';
TOKEN = 'YOUR_TOKEN';
url = 'https://api.matbea.net/' + CURRENCY + '/countTransactions?confirmed=' + CONFIRMED + '&token=' + TOKEN;
fetch(url, {
    method: 'post',
    body: JSON.stringify({address: [ADDR1, ADDR2] }) })
        .then(function (response) {
            return response.json();
        }).then(function (data) {
            console.log(data);
        });

Response example

{
    "error": {},
    "result": {
        "addresses": [
            {
                "1MN3cT9Ro927h4kgpSZ5V7SfYjrwTysXv7": false
            },
            {
                "1BdxBor4JG76RKLAwJZfHC58fWbgidYukz": false
            }
        ],
        "confirmed": false
    }
}

unspentConfirmed

Request code examples

curl -g -H "Content-Type: application/json" -H "Accept: application/json" "https://api.matbea.net/btc/unspentConfirmed?address[]=1MN3cT9Ro927h4kgpSZ5V7SfYjrwTysXv7&address[]=1BdxBor4JG76RKLAwJZfHC58fWbgidYukz&confirmations=50&token=YOUR_TOKEN"
<?php
$CURRENCY = 'btc';
$ADDR1 = '1MN3cT9Ro927h4kgpSZ5V7SfYjrwTysXv7';
$ADDR2 = '1BdxBor4JG76RKLAwJZfHC58fWbgidYukz';
$CONFIRMATIONS = 50;
$TOKEN = 'YOUR_TOKEN';
$url = 'https://api.matbea.net' . $CURRENCY . '/unspentConfirmed?address[]=' . $ADDR1 .'&address[]=' . $ADDR2 .'&confirmations=' . $CONFIRMATIONS . '&token=' . $TOKEN;

$rsh = curl_init();
if ($rsh) {
    curl_setopt($rsh, CURLOPT_URL, $url);
    curl_setopt($rsh, CURLOPT_HTTPHEADER, ['Content-Type:application/json']);
    curl_setopt($rsh, CURLOPT_RETURNTRANSFER, 1);
    curl_setopt($rsh, CURLOPT_POST, 0);
    $r=curl_exec($rsh);
    if (!$r) {
        printf("[E]\t%s (%s)\n", curl_error($rsh), curl_errno($rsh));
    } else {
        printf("%s\n", $r);
    }
    curl_close($rsh);
}
CURRENCY = 'btc';
ADDR1 = '1MN3cT9Ro927h4kgpSZ5V7SfYjrwTysXv7';
ADDR2 = '1BdxBor4JG76RKLAwJZfHC58fWbgidYukz';
CONFIRMATIONS = 50;
TOKEN = 'YOUR_TOKEN';
url = 'https://api.matbea.net/' + CURRENCY + '/unspentConfirmed?address[]=' + ADDR1 + '&address[]=' + ADDR2 + '&confirmations=' + CONFIRMATIONS + '&token=' + TOKEN;
fetch(url)
    .then(function (response) {
        return response.json();
    }).then(function (data) {
    console.log(data);
});

The method returns information about the confirmed balance of the specified address / addresses.

HTTP request

https://api.matbea.net/CURRENCY/unspentConfirmed?address[]=VALUE&confirmations=VALUE

Query parameters

Parameter Type Default Description Request
CURRENCY string - Currency type - btc, dash, ltc or zec URI
address string - Array of addresses for which information is requested URI, POST
confirmations integer 1 Number of confirmations URI

Response

Response example

{
    "error": {},
    "result": {
        "confirmations": 50,
        "outputs": [
            {
                "address": "1MN3cT9Ro927h4kgpSZ5V7SfYjrwTysXv7",
                "unspent": [
                    {
                        "amount": 5500,
                        "block_height": 456429,
                        "confirmations": 49751,
                        "confirmed": 1489052276,
                        "tx_hash": "97c078f4b762bc0027a4405fb73d6b029c2deddc80e3465e5951503536d65965",
                        "vout": 0
                    },
                    {
                        "amount": 1000,
                        "block_height": 492803,
                        "confirmations": 13377,
                        "confirmed": 1509630924,
                        "tx_hash": "e3994bf9556d70a7a402aae3ed62e6c427f2bd881a06f841f262596dc64b78cb",
                        "vout": 0
                    }
                ]
            },
            {
                "address": "1BdxBor4JG76RKLAwJZfHC58fWbgidYukz",
                "unspent": [
                    {
                        "amount": 5500,
                        "block_height": 450229,
                        "confirmations": 55951,
                        "confirmed": 1485507176,
                        "tx_hash": "d637117f6ccfbbc147a2bcfa0b492b273e3462d1ed8db3521a0967f0abecea27",
                        "vout": 0
                    }
                ]
            }
        ]
    }
}

Empty outputs

{
    "error": {},
    "result": {
        "confirmations": 1,
        "outputs": []
    }
}

The query result is returned as json format. Response are consists by the following fields:

Field Type Description
confirmations integer Number of confirmations
outputs array Array with address and confirmed balance

Array outputs are consists by the following fields:

Field Type Description
address string Requested address
unspent array Array with data on confirmed unspent outputs

Array unspent are consists by the following fields:

Field Type Description
amount integer Funds
block_height integer Block height
confirmations integer Number of confirmations
confirmed integer Confirmation UNIX timestamp
tx_hash string The hash of the input transaction
vout integer Output number

If the request contains an invalid address or an address that was not used in transactions, the contents of the outputs array will be empty.

Get information about confirmed unspent funds for two addresses with 50 confirmations. Addresses are transmitted by the GET method

curl -g -H "Content-Type: application/json" -H "Accept: application/json" "https://api.matbea.net/btc/unspentConfirmed?address[]=1MN3cT9Ro927h4kgpSZ5V7SfYjrwTysXv7&address[]=1BdxBor4JG76RKLAwJZfHC58fWbgidYukz&confirmations=50&token=YOUR_TOKEN"
<?php
$CURRENCY = 'btc';
$ADDR1 = '1MN3cT9Ro927h4kgpSZ5V7SfYjrwTysXv7';
$ADDR2 = '1BdxBor4JG76RKLAwJZfHC58fWbgidYukz';
$CONFIRMATIONS = 50;
$TOKEN = 'YOUR_TOKEN';

$url = 'https://api.matbea.net/' . $CURRENCY . '/unspentConfirmed?address[]=' . $ADDR1 . '&address[]=' . $ADDR2 . '&confirmations=' . $CONFIRMATIONS . '&token=' . $TOKEN;

$rsh = curl_init();
if ($rsh) {
    curl_setopt($rsh, CURLOPT_URL, $url);
    curl_setopt($rsh, CURLOPT_HTTPHEADER, ['Content-Type:application/json']);
    curl_setopt($rsh, CURLOPT_RETURNTRANSFER, 1);
    curl_setopt($rsh, CURLOPT_POST, 0);
    $r=curl_exec($rsh);
    if (!$r) {
        printf("[E]\t%s (%s)\n", curl_error($rsh), curl_errno($rsh));
    } else {
        printf("%s\n", $r);
    }
    curl_close($rsh);
}
CURRENCY = 'btc';
ADDR1 = '1MN3cT9Ro927h4kgpSZ5V7SfYjrwTysXv7';
ADDR2 = '1BdxBor4JG76RKLAwJZfHC58fWbgidYukz';
CONFIRMATIONS = 50;
TOKEN = 'YOUR_TOKEN';
url = 'https://api.matbea.net/' + CURRENCY + '/unspentConfirmed?address[]=' + ADDR1 + '&address[]=' + ADDR2 + '&confirmations=' + CONFIRMATIONS + '&token=' + TOKEN;
fetch(url)
    .then(function (response) {
        return response.json();
    }).then(function (data) {
    console.log(data);
});

Response example

{
    "error": {},
    "result": {
        "confirmations": 50,
        "outputs": [
            {
                "address": "1MN3cT9Ro927h4kgpSZ5V7SfYjrwTysXv7",
                "unspent": [
                    {
                        "amount": 5500,
                        "block_height": 456429,
                        "confirmations": 49751,
                        "confirmed": 1489052276,
                        "tx_hash": "97c078f4b762bc0027a4405fb73d6b029c2deddc80e3465e5951503536d65965",
                        "vout": 0
                    },
                    {
                        "amount": 1000,
                        "block_height": 492803,
                        "confirmations": 13377,
                        "confirmed": 1509630924,
                        "tx_hash": "e3994bf9556d70a7a402aae3ed62e6c427f2bd881a06f841f262596dc64b78cb",
                        "vout": 0
                    }
                ]
            },
            {
                "address": "1BdxBor4JG76RKLAwJZfHC58fWbgidYukz",
                "unspent": [
                    {
                        "amount": 5500,
                        "block_height": 450229,
                        "confirmations": 55951,
                        "confirmed": 1485507176,
                        "tx_hash": "d637117f6ccfbbc147a2bcfa0b492b273e3462d1ed8db3521a0967f0abecea27",
                        "vout": 0
                    }
                ]
            }
        ]
    }
}

Get information about confirmed unspent funds for two addresses with 50 confirmations. Addresses are transmitted by the POST method

curl -g -H "Content-Type: application/json" -H "Accept: application/json" -X POST -d "{\"address\":[\"1MN3cT9Ro927h4kgpSZ5V7SfYjrwTysXv7\",\"1BdxBor4JG76RKLAwJZfHC58fWbgidYukz\"]}" "https://api.matbea.net/btc/unspentConfirmed?confirmations=50&token=YOUR_TOKEN"
<?php
$CURRENCY = 'btc';
$ADDR1 = '1MN3cT9Ro927h4kgpSZ5V7SfYjrwTysXv7';
$ADDR2 = '1BdxBor4JG76RKLAwJZfHC58fWbgidYukz';
$CONFIRMATIONS = 50;
$TOKEN = 'YOUR_TOKEN';
$url = 'https://api.matbea.net/' . $CURRENCY . '/unspentConfirmed?confirmations=' . $CONFIRMATIONS . '&token='.$TOKEN;
$POSTparam=['address'=>[$ADDR1,$ADDR2]];

$rsh = curl_init();
if ($rsh) {
    curl_setopt($rsh, CURLOPT_URL, $url);
    curl_setopt($rsh, CURLOPT_HTTPHEADER, ['Content-Type:application/json']);
    curl_setopt($rsh, CURLOPT_RETURNTRANSFER, 1);
    curl_setopt($rsh, CURLOPT_POST, 1);
    curl_setopt($rsh, CURLOPT_POSTFIELDS, json_encode($POSTparam));
    $r=curl_exec($rsh);
    if (!$r) {
        printf("[E]\t%s (%s)\n", curl_error($rsh), curl_errno($rsh));
    } else {
        printf("%s\n", $r);
    }
    curl_close($rsh);
}
CURRENCY = 'btc';
ADDR1 = '1MN3cT9Ro927h4kgpSZ5V7SfYjrwTysXv7';
ADDR2 = '1BdxBor4JG76RKLAwJZfHC58fWbgidYukz';
CONFIRMATIONS = 50;
TOKEN = 'YOUR_TOKEN';
url = 'https://api.matbea.net/' + CURRENCY + '/unspentConfirmed?confirmations=' + CONFIRMATIONS + '&token=' + TOKEN;
fetch(url, {
    method: 'post',
    body: JSON.stringify({address: [ADDR1, ADDR2] }) })
        .then(function (response) {
            return response.json();
        }).then(function (data) {
            console.log(data);
        });

Response example

{
    "error": {},
    "result": {
        "confirmations": 50,
        "outputs": [
            {
                "address": "1MN3cT9Ro927h4kgpSZ5V7SfYjrwTysXv7",
                "unspent": [
                    {
                        "amount": 5500,
                        "block_height": 456429,
                        "confirmations": 49751,
                        "confirmed": 1489052276,
                        "tx_hash": "97c078f4b762bc0027a4405fb73d6b029c2deddc80e3465e5951503536d65965",
                        "vout": 0
                    },
                    {
                        "amount": 1000,
                        "block_height": 492803,
                        "confirmations": 13377,
                        "confirmed": 1509630924,
                        "tx_hash": "e3994bf9556d70a7a402aae3ed62e6c427f2bd881a06f841f262596dc64b78cb",
                        "vout": 0
                    }
                ]
            },
            {
                "address": "1BdxBor4JG76RKLAwJZfHC58fWbgidYukz",
                "unspent": [
                    {
                        "amount": 5500,
                        "block_height": 450229,
                        "confirmations": 55951,
                        "confirmed": 1485507176,
                        "tx_hash": "d637117f6ccfbbc147a2bcfa0b492b273e3462d1ed8db3521a0967f0abecea27",
                        "vout": 0
                    }
                ]
            }
        ]
    }
}

Get information about confirmed unspent funds for a single address without specifying the number of confirmations. The address is passed by the POST method

curl -g -H "Content-Type: application/json" -H "Accept: application/json" -X POST -d "{\"address\":\"1MN3cT9Ro927h4kgpSZ5V7SfYjrwTysXv7\"}" "https://api.matbea.net/btc/unspentConfirmed?token=YOUR_TOKEN"
<?php
$CURRENCY = 'btc';
$ADDR1 = '1MN3cT9Ro927h4kgpSZ5V7SfYjrwTysXv7';
$TOKEN = 'YOUR_TOKEN';

$url = 'https://api.matbea.net' . $CURRENCY . '/unspentConfirmed?token=' . $TOKEN;
$POSTparam=['address'=>$ADDR1];

$rsh = curl_init();
if ($rsh) {
    curl_setopt($rsh, CURLOPT_URL, $url);
    curl_setopt($rsh, CURLOPT_HTTPHEADER, ['Content-Type:application/json']);
    curl_setopt($rsh, CURLOPT_RETURNTRANSFER, 1);
    curl_setopt($rsh, CURLOPT_POST, 1);
    curl_setopt($rsh, CURLOPT_POSTFIELDS, json_encode($POSTparam));
    $r=curl_exec($rsh);
    if (!$r) {
        printf("[E]\t%s (%s)\n", curl_error($rsh), curl_errno($rsh));
    } else {
        printf("%s\n", $r);
    }
    curl_close($rsh);
}
CURRENCY = 'btc';
ADDR1 = '1MN3cT9Ro927h4kgpSZ5V7SfYjrwTysXv7';
TOKEN = 'YOUR_TOKEN';
url = 'https://api.matbea.net'+ CURRENCY + '/unspentConfirmed?token=' + TOKEN;
fetch(url, {
    method: 'post',
    body: JSON.stringify({address: ADDR1}) })
    .then(function (response) {
        return response.json();
    }).then(function (data) {
    console.log(data);
});

Response example

{
    "error": {},
    "result": {
        "confirmations": 1,
        "outputs": [
            {
                "address": "1MN3cT9Ro927h4kgpSZ5V7SfYjrwTysXv7",
                "unspent": [
                    {
                        "amount": 5500,
                        "block_height": 456429,
                        "confirmations": 49751,
                        "confirmed": 1489052276,
                        "tx_hash": "97c078f4b762bc0027a4405fb73d6b029c2deddc80e3465e5951503536d65965",
                        "vout": 0
                    },
                    {
                        "amount": 1000,
                        "block_height": 492803,
                        "confirmations": 13377,
                        "confirmed": 1509630924,
                        "tx_hash": "e3994bf9556d70a7a402aae3ed62e6c427f2bd881a06f841f262596dc64b78cb",
                        "vout": 0
                    }
                ]
            }
        ]
    }
}

unspentUnconfirmed

Request code examples

curl -g -H "Content-Type: application/json" -H "Accept: application/json" "https://api.matbea.net/btc/unspentUnconfirmed?address[]=1MN3cT9Ro927h4kgpSZ5V7SfYjrwTysXv7&address[]=1BdxBor4JG76RKLAwJZfHC58fWbgidYukz&token=YOUR_TOKEN"
<?php
$CURRENCY = 'btc';
$ADDR1 = '1MN3cT9Ro927h4kgpSZ5V7SfYjrwTysXv7';
$ADDR2 = '1BdxBor4JG76RKLAwJZfHC58fWbgidYukz';
$TOKEN = 'YOUR_TOKEN';

$url =  'https://api.matbea.net/' . $CURRENCY . '/unspentUnconfirmed?address[]=' . $ADDR1 . '&address[]=' . $ADDR2 . '&token=' . $TOKEN;

$rsh = curl_init();
if ($rsh) {
    curl_setopt($rsh, CURLOPT_URL, $url);
    curl_setopt($rsh, CURLOPT_HTTPHEADER, ['Content-Type:application/json']);
    curl_setopt($rsh, CURLOPT_RETURNTRANSFER, 1);
    curl_setopt($rsh, CURLOPT_POST, 0);
    $r=curl_exec($rsh);
    if (!$r) {
        printf("[E]\t%s (%s)\n", curl_error($rsh), curl_errno($rsh));
    } else {
        printf("%s\n", $r);
    }
    curl_close($rsh);
}
CURRENCY = 'btc';
ADDR1 = '1MN3cT9Ro927h4kgpSZ5V7SfYjrwTysXv7';
ADDR2 = '1BdxBor4JG76RKLAwJZfHC58fWbgidYukz';
TOKEN = 'YOUR_TOKEN';
url = 'https://api.matbea.net' + CURRENCY + '/unspentUnconfirmed?address[]=' + ADDR1 + '&address[]=' + ADDR2 + '&token=' + TOKEN;
fetch(url)
    .then(function (response) {
        return response.json();
    }).then(function (data) {
    console.log(data);
});

The method returns information about the unconfirmed balance of the specified address / addresses.

HTTP request

https://api.matbea.net/CURRENCY/unspentUnconfirmed?address[]=VALUE

Query parameters

Parameter Type Default Description Request
CURRENCY string - Currency type - btc, dash, ltc or zec URI
address string - Array of addresses for which information is requested URI, POST

Response

Response example if the specified address not has unconfirmed unspent funds

{
    "error": {},
    "result": {
        "outputs": [
            {
                "address": "1MN3cT9Ro927h4kgpSZ5V7SfYjrwTysXv7",
                "unspent": []
            },
            {
                "address": "1BdxBor4JG76RKLAwJZfHC58fWbgidYukz",
                "unspent": []
            }
        ]
    }
}

Response example if the specified address has unconfirmed unspent funds

{
    "error": {},
    "result": {
        "outputs": [
            {
                "address": "1GNSokHELdoxaXfUfhQqkqz3j9NkxtMcYB",
                "unspent": [
                    {
                        "amount": 263077,
                        "double_spend": true,
                        "time": 1513515545,
                        "tx_hash": "638f27cf5874de68a062c81793bb004aa66550e0015ab819ae8530f99af95d46",
                        "vout": 0
                    }
                ]
            }
        ]
    }
}

The query result is returned as json format. Response are consists by the following fields:

Field Type Description
address string Requested address
unspent array An array of data about the unconfirmed unspent balance of the requested address

If the specified address has unconfirmed unspent funds the array of "unspent" are consists the following fields:

Field Type Description
amount integer Amount of funds
double_spend boolean The flag of double spending
time integer Transaction timestamp
tx_hash string The hash of the input transaction
vout integer Output number

Otherwise, the "unspent" array is empty.

If the request contains an invalid address or an address that was not used in transactions, the contents of the outputs array will be empty.

Empty outputs

{
    "error": {},
    "result": {
        "outputs": []
    }
}

Request example for getting unconfirmed unspent funds for two addresses with 50 confirmations. Addresses are transmitted by POST method

curl -g -H "Content-Type: application/json" -H "Accept: application/json" -X POST -d "{\"address\":[\"1MN3cT9Ro927h4kgpSZ5V7SfYjrwTysXv7\",\"1BdxBor4JG76RKLAwJZfHC58fWbgidYukz\"]}" "https://api.matbea.net/btc/unspentUnconfirmed?token=YOUR_TOKEN"
<?php
$CURRENCY = 'btc';
$ADDR1 = '1MN3cT9Ro927h4kgpSZ5V7SfYjrwTysXv7';
$ADDR2 = '1BdxBor4JG76RKLAwJZfHC58fWbgidYukz';
$TOKEN = 'YOUR_TOKEN';
$url = 'https://api.matbea.net' . $CURRENCY . '/unspentUnconfirmed?token=' . $TOKEN;
$POSTparam=['address'=>[$ADDR1, $ADDR2]];

$rsh = curl_init();
if ($rsh) {
    curl_setopt($rsh, CURLOPT_URL, $url);
    curl_setopt($rsh, CURLOPT_HTTPHEADER, ['Content-Type:application/json']);
    curl_setopt($rsh, CURLOPT_RETURNTRANSFER, 1);
    curl_setopt($rsh, CURLOPT_POST, 1);
    curl_setopt($rsh, CURLOPT_POSTFIELDS, json_encode($POSTparam));
    $r=curl_exec($rsh);
    if (!$r) {
        printf("[E]\t%s (%s)\n", curl_error($rsh), curl_errno($rsh));
    } else {
        printf("%s\n", $r);
    }
    curl_close($rsh);
}
CURRENCY = 'btc';
ADDR1 = '1MN3cT9Ro927h4kgpSZ5V7SfYjrwTysXv7';
ADDR2 = '1BdxBor4JG76RKLAwJZfHC58fWbgidYukz';
TOKEN = 'YOUR_TOKEN';
url = 'https://api.matbea.net/' + CURRENCY + '/unspentUnconfirmed?token=' + TOKEN;
fetch(url, {
    method: 'post',
    body: JSON.stringify({address: [ADDR1, ADDR2] }) })
        .then(function (response) {
            return response.json();
        }).then(function (data) {
            console.log(data);
        });

Response example

{
    "error": {},
    "result": {
        "outputs": [
            {
                "address": "1MN3cT9Ro927h4kgpSZ5V7SfYjrwTysXv7",
                "unspent": []
            },
            {
                "address": "1BdxBor4JG76RKLAwJZfHC58fWbgidYukz",
                "unspent": []
            }
        ]
    }
}

address/ADDRESSHASH/transactions

Request code examples

curl -g -H "Content-Type: application/json" -H "Accept: application/json" "https://api.matbea.net/btc/address/12S42ZEw2741DHrivgZHLfX8M58mxb7bFy/transactions?limit=2&holder_data=1&token=YOUR_TOKEN"
<?php
$CURRENCY = 'btc';
$ADDRESSHASH='12S42ZEw2741DHrivgZHLfX8M58mxb7bFy';
$LIMIT = 2;
$HOLDERDATA = 1;
$TOKEN = 'YOUR_TOKEN';

$url = 'https://api.matbea.net' . $CURRENCY . '/address/' . $ADDRESSHASH . 
    '/transactions?limit=' . $LIMIT . '&holder_data=' . $HOLDERDATA . '&token=' . $TOKEN;

$rsh = curl_init();
if ($rsh) {
    curl_setopt($rsh, CURLOPT_URL, $url);
    curl_setopt($rsh, CURLOPT_HTTPHEADER, ['Content-Type:application/json']);
    curl_setopt($rsh, CURLOPT_RETURNTRANSFER, 1);
    curl_setopt($rsh, CURLOPT_POST, 0);
    $r=curl_exec($rsh);
    if (!$r) {
        printf("[E]\t%s (%s)\n", curl_error($rsh), curl_errno($rsh));
    } else {
        printf("%s\n", $r);
    }
    curl_close($rsh);
}
CURRENCY = 'btc';
ADDRESSHASH='12S42ZEw2741DHrivgZHLfX8M58mxb7bFy';
LIMIT = 2;
HOLDERDATA = 1;
TOKEN = 'YOUR_TOKEN';

url = 'https://api.matbea.net' + CURRENCY + '/address/' + ADDRESSHASH + '/transactions?limit=' + LIMIT + '&holder_data=' + HOLDERDATA + '&token=' + TOKEN;
fetch(url)
    .then((response) => {
    return response.json();
}).then((data) => {
console.log(data);
});

The method returns transaction information to the specified address.

HTTP request

https://api.matbea.net/CURRENCY/address/ADDRESSHASH/transactions?holder_data=VALUE&limit=VALUE&starttxid=VALUE&type=VALUE

Query parameters

Parameter Type Default Description Request
CURRENCY string - Currency type - btc, dash, ltc or zec URI
ADDRESSHASH string - Address for which information on transactions is requested URI
holder_data integer 0 Displaying information about the owner of the address. The accepted values are 1 or 0 URI
limit integer 10 The number of transactions displayed at page URI
starttxid string - A hash of the transaction after which the result is displayed. Optional parameter URI
type string all Type of transactions displayed. The accepted values are "all", "in" or "out".
all - Transactions in which there were receipts or expenditures of funds at a given address
in - transactions in which funds arrived at a given address
out - transactions in which funds were spent from a given address
URI

Response

The query result is returned as json format:

{
    "error": {},
    "result": {
        "address": "12S42ZEw2741DHrivgZHLfX8M58mxb7bFy",
        "holder": {
            "holder_address_count": 1,
            "holder_name": "MyNameIs12S4",
            "holder_rootaddress": "12S42ZEw2741DHrivgZHLfX8M58mxb7bFy"
        },
        "per_page": 2,
        "total": 10,
        "transactions": [
            {
                "block_hash": "0000000000000000005dbb38b1f39af707bb28425c2db6d1a11c7ceab80ee5b9",
                "block_height": 504885,
                "block_time": 1516307736,
                "coinbase": false,
                "confirmations": 3954,
                "double_spend": false,
                "hash": "5c838a768bc339f12fe59786850f87410281559f6209512756df04b776f1d814",
                "lock_time": 0,
                "num_in_block": 831,
                "size": 191,
                "time": 1516300600,
                "txin": [
                    {
                        "addresses": [
                            "12S42ZEw2741DHrivgZHLfX8M58mxb7bFy"
                        ],
                        "holder_address_count": 1,
                        "holder_name": "MyNameIs12S4",
                        "holder_rootaddress": "12S42ZEw2741DHrivgZHLfX8M58mxb7bFy",
                        "n": 0,
                        "output_block_height": 504885,
                        "output_txid": "cbf1bba98082f23889f79364ae146b6cbbfb1767a20c0e2bc210fee43561ee1d",
                        "script_type": "pubkeyhash",
                        "value": 1000000,
                        "vout": 1
                    }
                ],
                "txout": [
                    {
                        "addresses": [
                            "19EZqpVaxH342So7iVmcrR6BNxayY6jMxD"
                        ],
                        "holder_address_count": 110616,
                        "holder_name": "",
                        "holder_rootaddress": "13CNH2fnCDNXSJgNLqScqn1ZA1BBxdwyAC",
                        "input_n": 42,
                        "input_tx_block_height": 505424,
                        "input_txid": "90e98fb67e730748bd16f862b3a17b7c2fca86354c5421652b89f36300ff1c36",
                        "script_type": "pubkeyhash",
                        "value": 968715,
                        "vout": 0
                    }
                ]
            },
            {
                "block_hash": "0000000000000000007ed574c66a420d7e8d504f28a6492523bff8c0ea7a6f68",
                "block_height": 497334,
                "block_time": 1512291088,
                "coinbase": false,
                "confirmations": 11505,
                "double_spend": false,
                "hash": "7722cee32dde81a29d4940d28b178b0914e7e8ac5ee52547538e954f4f5ee71a",
                "lock_time": 0,
                "num_in_block": 340,
                "size": 192,
                "time": 1512290943,
                "txin": [
                    {
                        "addresses": [
                            "1FGaCR3k9B8ZifGc8FWcYY5yS7FXZgbMFF"
                        ],
                        "holder_address_count": 1,
                        "holder_name": "",
                        "holder_rootaddress": "1FGaCR3k9B8ZifGc8FWcYY5yS7FXZgbMFF",
                        "n": 0,
                        "output_block_height": 497334,
                        "output_txid": "5ce44e0c7083277402f81ef7192c80a09186bd3416e76c6631c9ad60e06a6778",
                        "script_type": "pubkeyhash",
                        "value": 25476,
                        "vout": 1
                    }
                ],
                "txout": [
                    {
                        "addresses": [
                            "12S42ZEw2741DHrivgZHLfX8M58mxb7bFy"
                        ],
                        "holder_address_count": 1,
                        "holder_name": "MyNameIs12S4",
                        "holder_rootaddress": "12S42ZEw2741DHrivgZHLfX8M58mxb7bFy",
                        "input_n": null,
                        "input_tx_block_height": null,
                        "input_txid": null,
                        "script_type": "pubkeyhash",
                        "value": 5500,
                        "vout": 0
                    }
                ]
            }
        ],
        "type": "all"
    }
}

Response is represented by the following fields:

Field Type Description
address string Address
holder array Address owner Information. If the holder_data parameter is not specified or is equal to 0, then the holder array is absent as a result
starttxid string The hash of the transaction after which to display data
per_page integer Number of transactions per page
total integer Total transactions
transactions array Transactions information
type string Type of transactions displayed

Array transactions are consists information about each transaction and is represented by the following fields:

Field Type Description
block_hash string Block hash
block_height integer Block height
block_time integer Block creation time
coinbase boolean Mark of a coinbase transaction
confirmations integer Number of transaction confirmations
double_spend boolean Mark of double spending
hash string Transaction hash
lock_time integer Block height or time at which the transaction will be unlocked
0 transaction not blocked
<500000000 Block number on which this transaction will be unlocked
=500000000 UNIX timestamp in which this transaction will be unlocked
A transaction cannot be added to a block before lock_time
num_in_block integer Block transaction number
size integer Block size
time integer Transaction creation time
txin array Array of input
txout array array of output

Array txin are consists by the following fields:

Field Type Description
addresses array Array of addresses. Array element type - string
holder_name string Name of the owner of the address / addresses used in this input
holder_address_count integer The number of addresses for this owner
holder_rootaddress string Owner primary address
n integer Transaction input number
output_block_height integer Transaction block height
output_txid string The hash of the transaction where the spent output is created
script_type string Signature type
value integer The amount of funds at this input
vout integer The output number where the funds were spent

Array txout are consists by the following fields:

Field Type Description
addresses array Array of addresses to which funds are transferred
holder_name string Name of the owner of the address / addresses used in this output
holder_address_count integer The number of addresses this owner
holder_rootaddress string Owner primary address
input_n integer The input number of the transaction in which the current output is spent
input_tx_block_height integer Transaction block height at which current output is spent
input_txid string The hash of the transaction in which the current output is spent
script_type string Signature type
value integer The amount of funds at this output
vout integer The output number

Empty transactions array

{
    "error": {},
    "result": {
        "address": "2BdxBor4JG76RKLAwJZfHC58fWbgidYukz",
        "per_page": 2,
        "total": 0,
        "transactions": [],
        "type": "all" 
    }
}

Get information about transactions with data on owners, indicating the starting hash from which data is output and filtering by input transactions. Number of transactions displayed 2:

curl -g -H "Content-Type: application/json" -H "Accept: application/json" "https://api.matbea.net/btc/address/12S42ZEw2741DHrivgZHLfX8M58mxb7bFy/transactions?limit=2&holder_data=1&type=in&starttxid=7722cee32dde81a29d4940d28b178b0914e7e8ac5ee52547538e954f4f5ee71a&token=YOUR_TOKEN"
<?php
$CURRENCY = 'btc';
$ADDRESSHASH='12S42ZEw2741DHrivgZHLfX8M58mxb7bFy';
$LIMIT = 2;
$HOLDERDATA = 1;
$TYPE='in';
$STARTTXID = '7722cee32dde81a29d4940d28b178b0914e7e8ac5ee52547538e954f4f5ee71a'; 
$TOKEN = 'YOUR_TOKEN';

$url = 'https://api.matbea.net/' . $CURRENCY . '/address/' . $ADDRESSHASH . '/transactions?limit=' . $LIMIT . '&holder_data=' . $HOLDERDATA . '&type=' . $TYPE . '&starttxid=' . $STARTTXID . '&token='. $TOKEN;
$POSTparam=[];

$rsh = curl_init();
if ($rsh) {
    curl_setopt($rsh, CURLOPT_URL, $url);
    curl_setopt($rsh, CURLOPT_HTTPHEADER, ['Content-Type:application/json']);
    curl_setopt($rsh, CURLOPT_RETURNTRANSFER, 1);
    curl_setopt($rsh, CURLOPT_POST, 0);
    $r=curl_exec($rsh);
    if (!$r) {
        printf("[E]\t%s (%s)\n", curl_error($rsh), curl_errno($rsh));
    } else {
        printf("%s\n", $r);
    }
    curl_close($rsh);
}
addr1='12S42ZEw2741DHrivgZHLfX8M58mxb7bFy';
hash1 = '7722cee32dde81a29d4940d28b178b0914e7e8ac5ee52547538e954f4f5ee71a';

CURRENCY = 'btc';
ADDRESSHASH='12S42ZEw2741DHrivgZHLfX8M58mxb7bFy';
LIMIT = 2;
HOLDERDATA = 1;
TYPE='in';
STARTTXID = '7722cee32dde81a29d4940d28b178b0914e7e8ac5ee52547538e954f4f5ee71a';
TOKEN = 'YOUR_TOKEN';

url = 'https://api.matbea.net/' + CURRENCY + '/address/' + ADDRESSHASH + '/transactions?limit=' + LIMIT + '&holder_data=' + HOLDERDATA + '&type=' + TYPE + '&starttxid=' + STARTTXID + '&token=' + TOKEN;
fetch(url)
    .then((response) => {
    return response.json();
}).then((data) => {
console.log(data);
});

Response example

{
    "error": {},
    "result": {
        "address": "12S42ZEw2741DHrivgZHLfX8M58mxb7bFy",
        "holder": {
            "holder_address_count": 1,
            "holder_name": "MyNameIs12S4",
            "holder_rootaddress": "12S42ZEw2741DHrivgZHLfX8M58mxb7bFy"
        },
        "per_page": 2,
        "starttxid": "7722cee32dde81a29d4940d28b178b0914e7e8ac5ee52547538e954f4f5ee71a",
        "total": 10,
        "transactions": [
            {
                "block_hash": "0000000000000000007c225ae8af1286e6fe2bb448c7202e0af0ddd974f1a62f",
                "block_height": 493899,
                "block_time": 1510311879,
                "coinbase": false,
                "confirmations": 14943,
                "double_spend": false,
                "hash": "cbf1bba98082f23889f79364ae146b6cbbfb1767a20c0e2bc210fee43561ee1d",
                "lock_time": 0,
                "num_in_block": 127,
                "size": 223,
                "time": 1510311484,
                "txin": [
                    {
                        "addresses": [
                            "12S42ZEw2741DHrivgZHLfX8M58mxb7bFy"
                        ],
                        "holder_address_count": 1,
                        "holder_name": "MyNameIs12S4",
                        "holder_rootaddress": "12S42ZEw2741DHrivgZHLfX8M58mxb7bFy",
                        "n": 0,
                        "output_block_height": 493899,
                        "output_txid": "d1789305f1ae4a39c045e0c67a024048cda0990297dc863e4caac546c6c32b86",
                        "script_type": "pubkeyhash",
                        "value": 1102678,
                        "vout": 1
                    }
                ],
                "txout": [
                    {
                        "addresses": [
                            "3P6sVMdtiqSwPuruSMguJQmmvFba3groVh"
                        ],
                        "holder_address_count": null,
                        "holder_name": "",
                        "holder_rootaddress": null,
                        "input_n": null,
                        "input_tx_block_height": null,
                        "input_txid": null,
                        "script_type": "scripthash",
                        "value": 5500,
                        "vout": 0
                    },
                    {
                        "addresses": [
                            "12S42ZEw2741DHrivgZHLfX8M58mxb7bFy"
                        ],
                        "holder_address_count": 1,
                        "holder_name": "MyNameIs12S4",
                        "holder_rootaddress": "12S42ZEw2741DHrivgZHLfX8M58mxb7bFy",
                        "input_n": 0,
                        "input_tx_block_height": 504885,
                        "input_txid": "5c838a768bc339f12fe59786850f87410281559f6209512756df04b776f1d814",
                        "script_type": "pubkeyhash",
                        "value": 1000000,
                        "vout": 1
                    }
                ]
            },
            {
                "block_hash": "00000000000000000060db556b634305ee64e542810a5ac1f2d174294a738ca3",
                "block_height": 493897,
                "block_time": 1510310573,
                "coinbase": false,
                "confirmations": 14945,
                "double_spend": false,
                "hash": "d1789305f1ae4a39c045e0c67a024048cda0990297dc863e4caac546c6c32b86",
                "lock_time": 0,
                "num_in_block": 355,
                "size": 223,
                "time": 1510309760,
                "txin": [
                    {
                        "addresses": [
                            "12S42ZEw2741DHrivgZHLfX8M58mxb7bFy"
                        ],
                        "holder_address_count": 1,
                        "holder_name": "MyNameIs12S4",
                        "holder_rootaddress": "12S42ZEw2741DHrivgZHLfX8M58mxb7bFy",
                        "n": 0,
                        "output_block_height": 493897,
                        "output_txid": "4989efcec28faedc86ee309a0cb1ba1319987d5c214fcb39d709538576e79342",
                        "script_type": "pubkeyhash",
                        "value": 1179178,
                        "vout": 1
                    }
                ],
                "txout": [
                    {
                        "addresses": [
                            "3Jc4v7eo9rptPj4277c9cCjgJmWSQmBiwj"
                        ],
                        "holder_address_count": null,
                        "holder_name": "",
                        "holder_rootaddress": null,
                        "input_n": null,
                        "input_tx_block_height": null,
                        "input_txid": null,
                        "script_type": "scripthash",
                        "value": 5500,
                        "vout": 0
                    },
                    {
                        "addresses": [
                            "12S42ZEw2741DHrivgZHLfX8M58mxb7bFy"
                        ],
                        "holder_address_count": 1,
                        "holder_name": "MyNameIs12S4",
                        "holder_rootaddress": "12S42ZEw2741DHrivgZHLfX8M58mxb7bFy",
                        "input_n": 0,
                        "input_tx_block_height": 493899,
                        "input_txid": "cbf1bba98082f23889f79364ae146b6cbbfb1767a20c0e2bc210fee43561ee1d",
                        "script_type": "pubkeyhash",
                        "value": 1102678,
                        "vout": 1
                    }
                ]
            }
        ],
        "type": "in"
    }
}

Array holder are consists by the following fields:

Field Type Description
holder_address_count integer The number of addresses owned by the owner of the requested address
holder_name string Owners name
holder_rootaddress string Owner primary address

If the request contains an invalid address or an address that was not used in transactions, the contents of the transactions array will be empty.

Get informations by pubkey

dumpxpub

Request code examples

curl -g -H "Content-Type: application/json" -H "Accept: application/json" "https://api.matbea.net/btc/hdwallet/dumpxpub?pubkey=xpub6CUGRUonZSQ4TWtTMmzXdrXDtypWKiKrhko4egpiMZbpiaQL2jkwSB1icqYh2cfDfVxdx4df189oLKnC5fSwqPfgyP3hooxujYzAu3fDVmz&include_balance=1&include_addresses=1&confirmations=15&token=YOUR_TOKEN" 
<?php
$CURRENCY = 'btc';
$PUBKEY = 'xpub6CUGRUonZSQ4TWtTMmzXdrXDtypWKiKrhko4egpiMZbpiaQL2jkwSB1icqYh2cfDfVxdx4df189oLKnC5fSwqPfgyP3hooxujYzAu3fDVmz';
$INCLUDEBALANCE = 1;
$INCLUDEADDRESSES = 1;
$CONFIRMATIONS = 15;
$TOKEN = 'YOUR_TOKEN';

$url = 'https://api.matbea.net/'. $CURRENCY . '/hdwallet/dumpxpub?pubkey=' . $PUBKEY . 
    '&include_balance=' . $INCLUDEBALANCE .
    '&include_addresses=' . $INCLUDEADDRESSES .
    '&confirmations=' . $CONFIRMATIONS .
    '&token=' . $TOKEN;

$rsh = curl_init();
if ($rsh) {
    curl_setopt($rsh, CURLOPT_URL, $url);
    curl_setopt($rsh, CURLOPT_HTTPHEADER, ['Content-Type:application/json']);
    curl_setopt($rsh, CURLOPT_RETURNTRANSFER, 1);
    curl_setopt($rsh, CURLOPT_POST, 0);
    $r=curl_exec($rsh);
    if (!$r) {
        printf("[E]\t%s (%s)\n", curl_error($rsh), curl_errno($rsh));
    } else {
        printf("%s\n", $r);
    }
    curl_close($rsh);
}
CURRENCY = 'btc';
PUBKEY = 'xpub6CUGRUonZSQ4TWtTMmzXdrXDtypWKiKrhko4egpiMZbpiaQL2jkwSB1icqYh2cfDfVxdx4df189oLKnC5fSwqPfgyP3hooxujYzAu3fDVmz';
INCLUDEBALANCE = 1;
INCLUDEADDRESSES = 1;
CONFIRMATIONS = 15;
TOKEN = 'YOUR_TOKEN';

url = 'https://api.matbea.net/' + CURRENCY + '/hdwallet/dumpxpub?pubkey=' + PUBKEY + '&include_balance=' + INCLUDEBALANCE + '&include_addresses=' + INCLUDEADDRESSES + '&confirmations=' + CONFIRMATIONS + '&token=' + TOKEN;
fetch(url)
    .then((response) => {
        return response.json();
    }).then((data) => {
        console.log(data);
    });

Returns information about the balance and addresses that were used in transactions specified by xpub or ypub.

HTTP request

https://api.matbea.net/CURRENCY/hdwallet/dumpxpub?pubkey=VALUE&include_balance=VALUE&include_addresses=VALUE&gap=VALUE&confirmations=VALUE

Query Parameters

Parameter Type Default Description Request
CURRENCY string - Currency type - btc, dash, ltc or zec URI
pubkey string - The xpub or ypub key for which information is requested URI
include_balance integer 0 Include balance information. Accepted values: 1 - include, or 0 - do not include URI
include_addresses integer 0 Include the addresses that were used in transactions. Accepted values: 1 - include, or 0 - do not include URI
gap integer 20 Addresses gap range. Accepted values in range 1 - 10000 URI
confirmations integer - The number of confirmations for calculating the balance URI

Response

Response example

{
    "error": {},
    "result": {
        "addresses": [
            {
                "address": "1EfgV2Hr5CDjXPavHDpDMjmU33BA2veHy6",
                "derivationPath": "m/0/0"
            },
            {
                "address": "12iNxzdF6KFZ14UyRTYCRuptxkKSSVHzqF",
                "derivationPath": "m/0/1"
            },
            {
                "address": "1CcEugXu9Yf9Qw5cpB8gHUK4X9683WyghM",
                "derivationPath": "m/0/2"
            },
            {
                "address": "15xANZb5vJv5RGL263NFuh8UGgHT7noXeZ",
                "derivationPath": "m/0/3"
            },
            {
                "address": "1PJMBXKBYEBMRDmpAoBRbDff26gHJrawSp",
                "derivationPath": "m/0/4"
            },
            {
                "address": "16ZBYSHkLkRFHAuZvyzosXYgU1UDJxRV1R",
                "derivationPath": "m/0/5"
            },
            {
                "address": "1EHeVKfjjq6FJpix86G2yzFeRbZ6RNg2Zm",
                "derivationPath": "m/0/6"
            },
            {
                "address": "1HqsYkwczwvkMXCobk5WPZmhj2S2TK613Z",
                "derivationPath": "m/0/8"
            },
            {
                "address": "1687EJf5YEmeEtcscnuJPiV5b8HkM1o98q",
                "derivationPath": "m/0/9"
            },
            {
                "address": "1MS6eGqD4iUGyJPbEsjqmoNaRhApgtmF8J",
                "derivationPath": "m/0/10"
            }
        ],
        "balance": 490868,
        "confirmations": 15
    }
}

The query result is returned as json format. Response are consists by the following fields:

Field Type Description
addresses array Array of addresses used in transactions
address string Address used in transaction
derivationPath string Derivation path
balance integer Balance xpub or ypub key
confirmations integer The number of confirmations to used for the balance calculate. This field is displayed only when include_balance = 1

The parameters include_balance, include_addresses, gap and confirmations are optional. If parameters are not specified, then the number of child addresses participating in the transactions is returned.

Example of request code without include_balance, include_addresses, gap, confirmations parameters

curl -g -H "Content-Type: application/json" -H "Accept: application/json" "https://api.matbea.net/btc/hdwallet/dumpxpub?pubkey=xpub6CUGRUonZSQ4TWtTMmzXdrXDtypWKiKrhko4egpiMZbpiaQL2jkwSB1icqYh2cfDfVxdx4df189oLKnC5fSwqPfgyP3hooxujYzAu3fDVmz&token=YOUR_TOKEN" 
<?php
$CURRENCY = 'btc';
$PUBKEY = 'xpub6CUGRUonZSQ4TWtTMmzXdrXDtypWKiKrhko4egpiMZbpiaQL2jkwSB1icqYh2cfDfVxdx4df189oLKnC5fSwqPfgyP3hooxujYzAu3fDVmz';
$TOKEN = 'YOUR_TOKEN';

$url = 'https://api.matbea.net/' . $CURRENCY . '/hdwallet/dumpxpub?pubkey=' . $PUBKEY . '&token=' . $TOKEN;

$rsh = curl_init();
if ($rsh) {
    curl_setopt($rsh, CURLOPT_URL, $url);
    curl_setopt($rsh, CURLOPT_HTTPHEADER, ['Content-Type:application/json']);
    curl_setopt($rsh, CURLOPT_RETURNTRANSFER, 1);
    curl_setopt($rsh, CURLOPT_POST, 0);
    $r=curl_exec($rsh);
    if (!$r) {
        printf("[E]\t%s (%s)\n", curl_error($rsh), curl_errno($rsh));
    } else {
        printf("%s\n", $r);
    }
    curl_close($rsh);
}
CURRENCY = 'btc';
PUBKEY='xpub6CUGRUonZSQ4TWtTMmzXdrXDtypWKiKrhko4egpiMZbpiaQL2jkwSB1icqYh2cfDfVxdx4df189oLKnC5fSwqPfgyP3hooxujYzAu3fDVmz';
TOKEN = 'YOUR_TOKEN';
url = 'https://api.matbea.net/' + CURRENCY + '/hdwallet/dumpxpub?pubkey=' + PUBKEY + '&token=' + TOKEN;
fetch(url)
    .then((response) => {
        return response.json();
    }).then((data) => {
        console.log(data);
    });

Response for request without include_balance, include_addresses, gap, confirmations parameters

{
    "error": {},
    "result": {
        "countAddresses": 10
    }
}

Response is represented by the following fields:

Field Type Description
countAddresses integer The number of addresses used in transactions

Example of code for include_addresses=0.

curl -g -H "Content-Type: application/json" -H "Accept: application/json" "https://api.matbea.net/btc/hdwallet/dumpxpub?pubkey=xpub6CUGRUonZSQ4TWtTMmzXdrXDtypWKiKrhko4egpiMZbpiaQL2jkwSB1icqYh2cfDfVxdx4df189oLKnC5fSwqPfgyP3hooxujYzAu3fDVmz&include_balance=1&include_addresses=0&confirmations=50&token=YOUR_TOKEN" 
<?php
$CURRENCY = 'btc';
$PUBKEY = 'xpub6CUGRUonZSQ4TWtTMmzXdrXDtypWKiKrhko4egpiMZbpiaQL2jkwSB1icqYh2cfDfVxdx4df189oLKnC5fSwqPfgyP3hooxujYzAu3fDVmz';
$INCLUDEBALANCE = 1;
$INCLUDEADDRESSES = 0;
$CONFIRMATIONS = 50;
$TOKEN = 'YOUR_TOKEN';

$url = 'https://api.matbea.net/' . $CURRENCY . '/hdwallet/dumpxpub?pubkey=' . $PUBKEY . 
    '&include_balance=' . $INCLUDEBALANCE .
    '&include_addresses=' . $INCLUDEADDRESSES .
    '&confirmations=' . $CONFIRMATIONS .
    '&token=' . $TOKEN;

$rsh = curl_init();
if ($rsh) {
    curl_setopt($rsh, CURLOPT_URL, $url);
    curl_setopt($rsh, CURLOPT_HTTPHEADER, ['Content-Type:application/json']);
    curl_setopt($rsh, CURLOPT_RETURNTRANSFER, 1);
    curl_setopt($rsh, CURLOPT_POST, 0);
    $r=curl_exec($rsh);
    if (!$r) {
        printf("[E]\t%s (%s)\n", curl_error($rsh), curl_errno($rsh));
    } else {
        printf("%s\n", $r);
    }
    curl_close($rsh);
}
CURRENCY = 'btc';
PUBKEY = 'xpub6CUGRUonZSQ4TWtTMmzXdrXDtypWKiKrhko4egpiMZbpiaQL2jkwSB1icqYh2cfDfVxdx4df189oLKnC5fSwqPfgyP3hooxujYzAu3fDVmz';
INCLUDEBALANCE = 1;
INCLUDEADDRESSES = 0;
CONFIRMATIONS = 50;
TOKEN = 'YOUR_TOKEN';

url = 'https://api.matbea.net/' + CURRENCY + '/hdwallet/dumpxpub?pubkey=' + PUBKEY + '&include_balance=' + INCLUDEBALANCE + '&include_addresses=' + INCLUDEADDRESSES + '&confirmations=' + CONFIRMATIONS + '&token=' + TOKEN;
fetch(url)
    .then((response) => {
        return response.json();
    }).then((data) => {
        console.log(data);
    });

If include_addresses not specified or include_addresses=0, then balance return

{
    "error": {},
    "result": {
        "balance": 490868,
        "confirmations": 50
    }
}

getpristineaddress

Request code examples

curl -g -H "Content-Type: application/json" -H "Accept: application/json" "https://api.matbea.net/btc/hdwallet/getpristineaddress?pubkey=xpub6CUGRUonZSQ4TWtTMmzXdrXDtypWKiKrhko4egpiMZbpiaQL2jkwSB1icqYh2cfDfVxdx4df189oLKnC5fSwqPfgyP3hooxujYzAu3fDVmz&&startfrom=1&token=YOUR_TOKEN" 
<?php
$CURRENCY = 'btc';
$PUBKEY='xpub6CUGRUonZSQ4TWtTMmzXdrXDtypWKiKrhko4egpiMZbpiaQL2jkwSB1icqYh2cfDfVxdx4df189oLKnC5fSwqPfgyP3hooxujYzAu3fDVmz';
$STARTFROM = 1;
$TOKEN = 'YOUR_TOKEN';
$url = 'https://api.matbea.net/' . $CURRENCY . '/hdwallet/getpristineaddress?pubkey=' . $PUBKEY . '&startfrom=' . $STARTFROM . '&token=' . $TOKEN;
$rsh = curl_init();
if ($rsh) {
    curl_setopt($rsh, CURLOPT_URL, $url);
    curl_setopt($rsh, CURLOPT_HTTPHEADER, ['Content-Type:application/json']);
    curl_setopt($rsh, CURLOPT_RETURNTRANSFER, 1);
    curl_setopt($rsh, CURLOPT_POST, 0);
    $r=curl_exec($rsh);
    if (!$r) {
        printf("[E]\t%s (%s)\n", curl_error($rsh), curl_errno($rsh));
    } else {
        printf("%s\n", $r);
    }
    curl_close($rsh);
}
CURRENCY = 'btc';
PUBKEY='xpub6CUGRUonZSQ4TWtTMmzXdrXDtypWKiKrhko4egpiMZbpiaQL2jkwSB1icqYh2cfDfVxdx4df189oLKnC5fSwqPfgyP3hooxujYzAu3fDVmz';
STARTFROM = 1;
TOKEN = 'YOUR_TOKEN';
url = 'https://api.matbea.net/' + CURRENCY + '/hdwallet/getpristineaddress?pubkey=' + PUBKEY + '&startfrom=' + STARTFROM + '&token' + TOKEN;
fetch(url)
    .then((response) => {
        return response.json();
    }).then((data) => {
        console.log(data);
    });
    return true;

The method returns a derived address that was not previously used in transactions for the specified xpub or ypub key.

HTTP request

https://api.matbea.net/CURRENCY/hdwallet/getpristineaddress?pubkey=VALUE&startfrom=VALUE

Query Parameters

Parameter Type Default Description Request
CURRENCY string - Currency type - btc, dash, ltc or zec URI
pubkey string - The xpub or ypub key for which the address is required. URI
startfrom integer 0 The number of the address in the derivation path (m/0/START) from which to start searching. URI

Response

Response example

{
    "error": {},
    "result": {
        "address": "17BvBPGypT4nt1xc5QpdSDkQb54xoUuQkD",
        "derivationPath": "m/0/7",
        "number": 7
    }
}

The query result is returned as json format. Response are consists by the following fields:

Field Type Description
address string The derivative address of the specified xpub or ypub
derivationPath string Derivative path
number integer Address number (m/0/number).

gettxs

Request code examples

curl -g -H "Content-Type: application/json" -H "Accept: application/json" "https://api.matbea.net/btc/hdwallet/gettxs?pubkey=xpub6CUGRUonZSQ4TWtTMmzXdrXDtypWKiKrhko4egpiMZbpiaQL2jkwSB1icqYh2cfDfVxdx4df189oLKnC5fSwqPfgyP3hooxujYzAu3fDVmz&page=1&token=YOUR_TOKEN"
<?php
$CURRENCY = 'btc';
$PUBKEY='xpub6CUGRUonZSQ4TWtTMmzXdrXDtypWKiKrhko4egpiMZbpiaQL2jkwSB1icqYh2cfDfVxdx4df189oLKnC5fSwqPfgyP3hooxujYzAu3fDVmz';
$PAGE = 1;
$TOKEN = 'YOUR_TOKEN';
$url = 'https://api.matbea.net/' . $CURRENCY . '/hdwallet/gettxs?pubkey=' . $PUBKEY . '&page=' . $PAGE . '&token=' . $TOKEN;
$rsh = curl_init();
if ($rsh) {
    curl_setopt($rsh, CURLOPT_URL, $url);
    curl_setopt($rsh, CURLOPT_HTTPHEADER, ['Content-Type:application/json']);
    curl_setopt($rsh, CURLOPT_RETURNTRANSFER, 1);
    curl_setopt($rsh, CURLOPT_POST, 0);
    $r=curl_exec($rsh);
    if (!$r) {
        printf("[E]\t%s (%s)\n", curl_error($rsh), curl_errno($rsh));
    } else {
        printf("%s\n", $r);
    }
    curl_close($rsh);
}
CURRENCY = 'btc';
PUBKEY='xpub6CUGRUonZSQ4TWtTMmzXdrXDtypWKiKrhko4egpiMZbpiaQL2jkwSB1icqYh2cfDfVxdx4df189oLKnC5fSwqPfgyP3hooxujYzAu3fDVmz';
PAGE = 1;
TOKEN = 'YOUR_TOKEN';
url = 'https://api.matbea.net/' + CURRENCY + '/hdwallet/gettxs?pubkey=' + PUBKEY + '&page=' + PAGE + '&token' + TOKEN;
fetch(url)
    .then((response) => {
        return response.json();
    }).then((data) => {
        console.log(data);
    });
    return true;

The method returns transaction data of child addresses of the specified pubkey

HTTP request

https://api.matbea.net/CURRENCY/hdwallet/gettxs?pubkey=VALUE&page=VALUE

Query parameters

Parameter Type Default Description Request
CURRENCY string - Currency type - btc, dash, ltc or zec URI
pubkey string - The xpub or ypub key for which the address is required URI
page integer 1 The number of page. Equal or more 1 URI

Response

The query result is returned as json format:

{
    "error": "",
    "result": {
        "data": [
            {
                "block_hash": "000000000000000012fccc0c48f7e7be35a4abf164ba5e5229a855f459c0c784",
                "block_height": 335392,
                "block_time": 1419270130,
                "confirmations": 261495,
                "double_spend": false,
                "hash": "6faca777767c3130722c1ed3cea8537099ca3d4db475ad6be1c2f93fbce571c3",
                "num_in_block": 207,
                "size": 226,
                "time": 1419270130
            },
            {
                "block_hash": "000000000000000012fccc0c48f7e7be35a4abf164ba5e5229a855f459c0c784",
                "block_height": 335392,
                "block_time": 1419270130,
                "confirmations": 261495,
                "double_spend": false,
                "hash": "6624d78e14ebae02be652c1b155cc8cd1cd9fd7b8531df16cdcfcbe36b8ab272",
                "num_in_block": 208,
                "size": 226,
                "time": 1419270130
            },
            {
                "block_hash": "00000000000000001aa3d46426d843133e3e6b3e0dba6bfaa053d54af503f977",
                "block_height": 335428,
                "block_time": 1419283942,
                "confirmations": 261459,
                "double_spend": false,
                "hash": "d339e4ffd23586e9f75c44aa5c60cc8775980ccd09a431cc0b56dac863d7f6f2",
                "num_in_block": 750,
                "size": 226,
                "time": 1419283942
            },
            {
                "block_hash": "0000000000000000030593f652371abb57a36cd6b5c198c60a48201d0fe779f4",
                "block_height": 335556,
                "block_time": 1419355581,
                "confirmations": 261331,
                "double_spend": false,
                "hash": "4fbbbdf97d77f27cf39572a21a996e938b88f76ac173a0806f60e94f23995016",
                "num_in_block": 404,
                "size": 225,
                "time": 1419355581
            },
            {
                "block_hash": "000000000000000003eda5c2fc1ac8992fd4391ec62ffde381ac7f684d808170",
                "block_height": 425673,
                "block_time": 1471493231,
                "confirmations": 171214,
                "double_spend": false,
                "hash": "d398308c6b1123d53f0c669146ad9772164dacdf4df4c79d26e657264f20250f",
                "num_in_block": 1397,
                "size": 258,
                "time": 1471493231
            },
            {
                "block_hash": "0000000000000000011358746ea47f9d8f71b1bb0a9cbe1de22192cc68be6508",
                "block_height": 472199,
                "block_time": 1498014082,
                "confirmations": 124688,
                "double_spend": false,
                "hash": "9922f59186cb133769bee41876bd8c0186dee21a005823d4e28ddaf6e324805c",
                "num_in_block": 344,
                "size": 616,
                "time": 1498014082
            },
            {
                "block_hash": "0000000000000000001d28601aec2609ea73a555493dc8b4d2c17680fa10b747",
                "block_height": 473887,
                "block_time": 1499015523,
                "confirmations": 123000,
                "double_spend": false,
                "hash": "0b290c3d0f27ce20a91d3054ab2d6e43700b86b2d290bdb1a5686c453a1687b7",
                "num_in_block": 1054,
                "size": 225,
                "time": 1499015523
            },
            {
                "block_hash": "0000000000000000001651eb70b312c3c1d2d0201a78b93a3bc97a076ac389e5",
                "block_height": 473890,
                "block_time": 1499016409,
                "confirmations": 122997,
                "double_spend": false,
                "hash": "31cd8e45a007482c61c8721f7e6e799f2f40c89b3485a8f1991a0195e8a19b83",
                "num_in_block": 395,
                "size": 226,
                "time": 1499016409
            },
            {
                "block_hash": "000000000000000000d0a0d5738e4745a3ea78e2c5dea2ca4d0d784bd1075086",
                "block_height": 473895,
                "block_time": 1499019077,
                "confirmations": 122992,
                "double_spend": false,
                "hash": "b302f204738c02a3427d3867ed53a85cf6234157ba306ac05dc8d7d85d8b09f4",
                "num_in_block": 1242,
                "size": 373,
                "time": 1499019077
            },
            {
                "block_hash": "000000000000000000196f9251a434cf6787b6cc2f30d2de2e685dc4515a4ece",
                "block_height": 544826,
                "block_time": 1538959396,
                "confirmations": 52061,
                "double_spend": false,
                "hash": "89ba68e39862a36a71065bc13f0896213e9ee0240a41800c252802e2edc1b817",
                "num_in_block": 2060,
                "size": 225,
                "time": 1538953829
            }
        ],
        "limit": 10,
        "page": 1,
        "pubkey": "xpub6CUGRUonZSQ4TWtTMmzXdrXDtypWKiKrhko4egpiMZbpiaQL2jkwSB1icqYh2cfDfVxdx4df189oLKnC5fSwqPfgyP3hooxujYzAu3fDVmz"
    }
}

Response is represented by the following fields:

Field Type Description
data array Array of transaction data
limit integer Number records per page
page integer Current page
pubkey string The public key for which information returned

Each element of the data array consists fields:

Field Type Description
block_hash string Block hash
block_height integer Block height
block_time integer Block creation time
confirmations integer Number of transaction confirmations
double_spend boolean Mark of double spending
hash string Transaction hash
num_in_block integer Block transaction number
size integer Block size
time integer Transaction creation time

Get Informations by blocks

block

Request code examples

curl -g -H "Content-Type: application/json" -H "Accept: application/json" "https://api.matbea.net/btc/block/0000000066356691a4353dd8bdc2c60da20d68ad34fff93d8839a133b2a6d42a?token=YOUR_TOKEN"
<?php
$CURRENCY = 'btc';
$BLOCKHASH = '0000000066356691a4353dd8bdc2c60da20d68ad34fff93d8839a133b2a6d42a';
$TOKEN = 'YOUR_TOKEN';
$url = 'https://api.matbea.net' . $CURRENCY . '/block/' . $BLOCKHASH . '?token=' . $TOKEN;

$rsh = curl_init();
if ($rsh) {
    curl_setopt($rsh, CURLOPT_URL, $url);
    curl_setopt($rsh, CURLOPT_HTTPHEADER, ['Content-Type:application/json']);
    curl_setopt($rsh, CURLOPT_RETURNTRANSFER, 1);
    curl_setopt($rsh, CURLOPT_POST, 0);
    $r=curl_exec($rsh);
    if (!$r) {
        printf("[E]\t%s (%s)\n", curl_error($rsh), curl_errno($rsh));
    } else {
        printf("%s\n", $r);
    }
    curl_close($rsh);
}
CURRENCY = 'btc';
BLOCKHASH = '0000000066356691a4353dd8bdc2c60da20d68ad34fff93d8839a133b2a6d42a';
TOKEN = 'YOUR_TOKEN';
url = 'https://api.matbea.net/' + CURRENCY + '/block/' + BLOCKHASH + '?token=' + TOKEN;
fetch(url)
    .then(function (response) {
        return response.json();
    }).then(function (data) {
    console.log(data);
});

The method returns information about the block by hash or height. A method can be called in two ways.

HTTP request

1) https://api.matbea.net/CURRENCY/block/BLOCKHASH
2) https://api.matbea.net/CURRENCY/block/BLOCKHEIGHT

Query parameters

Parameter Type Default Description Request
CURRENCY string - Currency type - btc, dash, ltc or zec URI
BLOCKHASH string - Block hash URI
BLOCKHEIGHT string - Block height URI

Response

The query result is returned as json format:

Response example

{
    "error": {},
    "result": {
        "block_difficulty": 1,
        "block_hash": "0000000066356691a4353dd8bdc2c60da20d68ad34fff93d8839a133b2a6d42a",
        "block_height": 221,
        "block_size": 417,
        "block_time": 1231770060,
        "block_version": 1,
        "confirmations": 505809,
        "tx_count": 2
    }
}

Response is represented by the following fields:

Field Type Description
block_difficulty double Block difficulty
block_hash string Block hash
block_height integer Block height
block_size integer Block size in bytes
block_time integer Block creation time
block_version integer Version
confirmations integer Number of confirmations
tx_count integer The number of transactions in the block

Get information by block height

curl -g -H "Content-Type: application/json" -H "Accept: application/json" "https://api.matbea.net/btc/block/221?token=YOUR_TOKEN"
<?php

$CURRENCY = 'btc';
$BLOCKHEIGHT = 221;
$TOKEN = 'YOUR_TOKEN';
$url = 'https://api.matbea.net/' . $CURRENCY . '/block/' . $BLOCKHEIGHT . '?token=' . $TOKEN;

$rsh = curl_init();
if ($rsh) {
    curl_setopt($rsh, CURLOPT_URL, $url);
    curl_setopt($rsh, CURLOPT_HTTPHEADER, ['Content-Type:application/json']);
    curl_setopt($rsh, CURLOPT_RETURNTRANSFER, 1);
    curl_setopt($rsh, CURLOPT_POST, 0);
    $r=curl_exec($rsh);
    if (!$r) {
        printf("[E]\t%s (%s)\n", curl_error($rsh), curl_errno($rsh));
    } else {
        printf("%s\n", $r);
    }
    curl_close($rsh);
}
CURRENCY = 'btc';
BLOCKHEIGHT = 221;
TOKEN = 'YOUR_TOKEN';
url = 'https://api.matbea.net/' + CURRENCY + '/block/' + BLOCKHEIGHT + '?token=' + TOKEN;
fetch(url)
    .then(function (response) {
        return response.json();
    }).then(function (data) {
    console.log(data);
});

Response example

{
    "error": {},
    "result": {
        "block_difficulty": 1,
        "block_hash": "0000000066356691a4353dd8bdc2c60da20d68ad34fff93d8839a133b2a6d42a",
        "block_height": 221,
        "block_size": 417,
        "block_time": 1231770060,
        "block_version": 1,
        "confirmations": 505809,
        "tx_count": 2
    }
}

blocks

Request code examples

curl -g -H "Content-Type: application/json" -H "Accept: application/json" "https://api.matbea.net/btc/blocks?blockid[]=1&blockid[]=5000&token=YOUR_TOKEN"
<?php
$CURRENCY = 'btc';
$BLOCKID1 = 1;
$BLOCKID2 = 5000;
$TOKEN = 'YOUR_TOKEN';
$url = 'https://api.matbea.net/' . $CURRENCY . '/blocks?blockid[]=' . $BLOCKID1 . '&blockid[]=' . $BLOCKID2 . '&token='.$TOKEN;
$POSTparam=[];

$rsh = curl_init();
if ($rsh) {
    curl_setopt($rsh, CURLOPT_URL, $url . $GETparam);
    curl_setopt($rsh, CURLOPT_HTTPHEADER, ['Content-Type:application/json']);
    curl_setopt($rsh, CURLOPT_RETURNTRANSFER, 1);
    curl_setopt($rsh, CURLOPT_POST, 0);
    $r=curl_exec($rsh);
    if (!$r) {
        printf("[E]\t%s (%s)\n", curl_error($rsh), curl_errno($rsh));
    } else {
        printf("%s\n", $r);
    }
    curl_close($rsh);
}
CURRENCY = 'btc';
BLOCKID1 = '1';
BLOCKID2 = '5000';
TOKEN = 'YOUR_TOKEN';
url = 'https://api.matbea.net/' + CURRENCY + '/blocks?blockid[]=' + BLOCKID1 + '&blockid[]=' + BLOCKID2 + '&token=' + TOKEN;
fetch(url)
    .then(function (response) {
        return response.json();
    }).then(function (data) {
    console.log(data);
});

The method returns information about blocks by the given block numbers.

HTTP request

https://api.matbea.net/CURRENCY/blocks?blockid[]=VALUE

Query parameters

Parameter Type Default Description Request
CURRENCY string - Currency type - btc, dash, ltc or zec URI
blockid integer - An array of block heights about which information is needed URI, POST

Response

The query result is returned as json format

Response example

{
    "error": {},
    "result": {
        "blocks": [
            {
                "block_difficulty": 1,
                "block_hash": "00000000839a8e6886ab5951d76f411475428afc90947ee320161bbf18eb6048",
                "block_height": 1,
                "block_size": 215,
                "block_time": 1231469665,
                "block_version": 1,
                "confirmations": 506029,
                "tx_count": 1
            },
            {
                "block_difficulty": 1,
                "block_hash": "000000004d78d2a8a93a1d20a24d721268690bebd2b51f7e80657d57e226eef9",
                "block_height": 5000,
                "block_size": 216,
                "block_time": 1235135895,
                "block_version": 1,
                "confirmations": 501030,
                "tx_count": 1
            }
        ]
    }
}

Response is represented by the following fields:

Field Type Description
block_difficulty double Block difficulty
block_hash string Block hash
block_height integer Block height
block_size integer Block size in bytes
block_time integer Block creation time
block_version integer Version
confirmations integer Number of confirmations
tx_count integer The number of transactions in the block

Getting information by the POST method

curl -g -H "Content-Type: application/json" -H "Accept: application/json" -X POST -d "{\"blockid\":[1,5000]}" "https://api.matbea.net/btc/blocks?token=YOUR_TOKEN"
<?php
$CURRENCY = 'btc';
$BLOCKID1 = 1;
$BLOCKID2 = 5000;
$TOKEN = 'YOUR_TOKEN';
$url = 'https://api.matbea.net' . $CURRENCY . '/blocks?token='.$TOKEN;
$POSTparam=['blockid' => [$BLOCKID1, $BLOCKID2]];

$rsh = curl_init();
if ($rsh) {
    curl_setopt($rsh, CURLOPT_URL, $url);
    curl_setopt($rsh, CURLOPT_HTTPHEADER, ['Content-Type:application/json']);
    curl_setopt($rsh, CURLOPT_RETURNTRANSFER, 1);
    curl_setopt($rsh, CURLOPT_POST, 1);
    curl_setopt($rsh, CURLOPT_POSTFIELDS, json_encode($POSTparam));
    $r=curl_exec($rsh);
    if (!$r) {
        printf("[E]\t%s (%s)\n", curl_error($rsh), curl_errno($rsh));
    } else {
        printf("%s\n", $r);
    }
    curl_close($rsh);
}
CURRENCY = 'btc';
BLOCKID1 = 1;
BLOCKID2 = 5000;
TOKEN = 'YOUR_TOKEN';
url = 'https://api.matbea.net/' + CURRENCY + '/blocks?token=' + TOKEN;

fetch(url, {
    method: 'post',
    body: JSON.stringify({blockid: [BLOCKID1, BLOCKID2]})})
        .then(function (response) {
            return response.json();
        }).then(function (data) {
            console.log(data);
        });

Response example

{
    "error": {},
    "result": {
        "blocks": [
            {
                "block_difficulty": 1,
                "block_hash": "00000000839a8e6886ab5951d76f411475428afc90947ee320161bbf18eb6048",
                "block_height": 1,
                "block_size": 215,
                "block_time": 1231469665,
                "block_version": 1,
                "confirmations": 506029,
                "tx_count": 1
            },
            {
                "block_difficulty": 1,
                "block_hash": "000000004d78d2a8a93a1d20a24d721268690bebd2b51f7e80657d57e226eef9",
                "block_height": 5000,
                "block_size": 216,
                "block_time": 1235135895,
                "block_version": 1,
                "confirmations": 501030,
                "tx_count": 1
            }
        ]
    }
}

lastblocks

Request code examples

curl -g -H "Content-Type: application/json" -H "Accept: application/json" "https://api.matbea.net/btc/lastblocks?count=3&token=YOUR_TOKEN"
<?php
$CURRENCY = 'btc';
$COUNT = 3;
$TOKEN = 'YOUR_TOKEN';
$url = 'https://api.matbea.net/' . $CURRENCY . '/lastblocks?count=' . $COUNT . '&token=' . $TOKEN;

$rsh = curl_init();
if ($rsh) {
    curl_setopt($rsh, CURLOPT_URL, $url . $GETparam);
    curl_setopt($rsh, CURLOPT_HTTPHEADER, ['Content-Type:application/json']);
    curl_setopt($rsh, CURLOPT_RETURNTRANSFER, 1);
    curl_setopt($rsh, CURLOPT_POST, 0);
    $r=curl_exec($rsh);
    if (!$r) {
        printf("[E]\t%s (%s)\n", curl_error($rsh), curl_errno($rsh));
    } else {
        printf("%s\n", $r);
    }
    curl_close($rsh);
}
CURRENCY = 'btc';
COUNT = '3';
TOKEN = 'YOUR_TOKEN';
url = 'https://api.matbea.net/' + CURRENCY + '/lastblocks?count=' + COUNT + '&token=' + TOKEN;

fetch(url)
        .then(function (response) {
            return response.json();
        }).then(function (data) {
        console.log(data);
    });

The method returns information about the last blocks included in the blockchain.

HTTP request

https://api.matbea.net/CURRENCY/lastblocks?count=VALUE

Query parameters

Parameter Type Default Description Request
CURRENCY string - Currency type - btc, dash, ltc or zec URI
count integer - The number of last blocks displayed as a result URI

Response

The query result is returned as json format:

{
    "error": {},
    "result": {
        "blocks": [
            {
                "block_difficulty": 2603077300218.6,
                "block_hash": "00000000000000000059c15d5e0ac4c813714bb6b8e9792c8e213844b9754e0e",
                "block_height": 506029,
                "block_size": 1003238,
                "block_time": 1516871154,
                "block_version": 536870912,
                "confirmations": 1,
                "tx_count": 432
            },
            {
                "block_difficulty": 2603077300218.6,
                "block_hash": "00000000000000000064ad4a4839abefd2e4e3d2a75c2bd1fadead59ad9c32b8",
                "block_height": 506028,
                "block_size": 1046102,
                "block_time": 1516871116,
                "block_version": 536870912,
                "confirmations": 2,
                "tx_count": 1036
            },
            {
                "block_difficulty": 2603077300218.6,
                "block_hash": "0000000000000000003133c567a511c15ae1da565ff9ca7601dcf1532291b282",
                "block_height": 506027,
                "block_size": 1037188,
                "block_time": 1516870806,
                "block_version": 536870912,
                "confirmations": 3,
                "tx_count": 1911
            }
        ]
    }
}

Response is represented by the following fields:

Field Type Description
block_difficulty double Block difficulty
block_hash string Block hash
block_height integer Block height
block_size integer Block size in bytes
block_time integer Block creation time
block_version integer Version
confirmations integer Number of confirmations
tx_count integer The number of transactions in the block

blocktransactions

Request code examples

curl -g -H "Content-Type: application/json" -H "Accept: application/json" "https://api.matbea.net/btc/blocktransactions?block=444444&page=5&limit=3&token=YOUR_TOKEN"
<?php
$CURRENCY = 'btc';
$BLOCK = 444444;
$PAGE = 5;
$LIMIT = 3;
$TOKEN = 'YOUR_TOKEN';
$url = 'https://api.matbea.net' . $CURRENCY . '/blocktransactions?block=' . $BLOCK . '&page=' . $PAGE . '&limit=' . $LIMIT . '&token=' . $TOKEN;

$rsh = curl_init();
if ($rsh) {
    curl_setopt($rsh, CURLOPT_URL, $url . $GETparam);
    curl_setopt($rsh, CURLOPT_HTTPHEADER, ['Content-Type:application/json']);
    curl_setopt($rsh, CURLOPT_RETURNTRANSFER, 1);
    curl_setopt($rsh, CURLOPT_POST, 0);
    $r=curl_exec($rsh);
    if (!$r) {
        printf("[E]\t%s (%s)\n", curl_error($rsh), curl_errno($rsh));
    } else {
        printf("%s\n", $r);
    }
    curl_close($rsh);
}
CURRENCY = 'btc';
BLOCK = 444444;
PAGE = 5;
LIMIT = 3;
TOKEN = 'YOUR_TOKEN';
url = 'https://api.matbea.net/' + CURRENCY + 'blocktransactions?block=' + BLOCK + '&page=' + PAGE + '&limit=' + LIMIT + '&token=' + TOKEN;
fetch(url)
    .then(function (response) {
        return response.json();
    }).then(function (data) {
    console.log(data);
});

The method returns information about transactions in a block with a given height.

HTTP request

https://api.matbea.net/CURRENCY/blocktransactions?block=VALUE&page=VALUE&limit=VALUE

Query parameters

Parameter Type Default Description Request
CURRENCY string - Currency type - btc, dash, ltc or zec URI
block integer - Block height. Positive number, greater than 0 URI
page integer - Page number URI
limit integer - Number of records per page URI

Response

The query result is returned as json format:

{
    "error": {},
    "result": {
        "confirmations": 61719,
        "current_page": 5,
        "per_page": 3,
        "total": 2072,
        "txs": [
            {
                "inputs_count": 1,
                "outputs_count": 2,
                "transaction_time": 1482335740,
                "tx_hash": "f64dbcd3c69ef5c1e08dbab1a0365c260cb7675bcc7e8c6b6552b17228a92a79"
            },
            {
                "inputs_count": 1,
                "outputs_count": 2,
                "transaction_time": 1482335740,
                "tx_hash": "3ffa38f6718ea9a8f35b02f96620ccf1e55395544339aa8587ae28b823295927"
            },
            {
                "inputs_count": 1,
                "outputs_count": 2,
                "transaction_time": 1482335740,
                "tx_hash": "0d9cfe5c852cfb60b4e0b77f2c63da5ec9f7c75437946f68a194994a0eef6e0c"
            }
        ]
    }
}

Response is represented by the following fields:

Field Type Description
confirmations integer Number of confirmations
current_page integer Returned page number. Defines by parameter "page"
per_page integer The number of records per page. Defines by parameter "limit"
total integer The total number of records in the block
txs array Array of transaction data included in the block

Array txs is represented by the following fields:

Field Type Description
inputs_count integer Number of inputs
outputs_count integer Number of outputs
transaction_time integer Transaction time
tx_hash string Transaction hash

Get informations by transactions

transaction

Request code examples

curl -g -H "Content-Type: application/json" -H "Accept: application/json" "https://api.matbea.net/btc/transaction?298ca2045d174f8a158961806ffc4ef96fad02d71a6b84d9fa0491813a776160&holder_data=1&token=YOUR_TOKEN"
<?php
$CURRENCY = 'btc';
$TRANSACTIONHASH = '298ca2045d174f8a158961806ffc4ef96fad02d71a6b84d9fa0491813a776160';
$HOLDERDATA = 1;
$TOKEN = 'YOUR_TOKEN';
$url = 'https://api.matbea.net/' . $CURRENCY . '/transaction?' . $TRANSACTIONHASH . '&holder_data=' . $HOLDERDATA . '&token=' . $TOKEN;

$rsh = curl_init();
if ($rsh) {
    curl_setopt($rsh, CURLOPT_URL, $url);
    curl_setopt($rsh, CURLOPT_HTTPHEADER, ['Content-Type:application/json']);
    curl_setopt($rsh, CURLOPT_RETURNTRANSFER, 1);
    curl_setopt($rsh, CURLOPT_POST, 0);
    $r=curl_exec($rsh);
    if (!$r) {
        printf("[E]\t%s (%s)\n", curl_error($rsh), curl_errno($rsh));
    } else {
        printf("%s\n", $r);
    }
    curl_close($rsh);
}
CURRENCY = 'btc';
TRANSACTIONHASH = '298ca2045d174f8a158961806ffc4ef96fad02d71a6b84d9fa0491813a776160';
HOLDERDATA = 1;
TOKEN = 'YOUR_TOKEN';
url = 'https://api.matbea.net/' + CURRENCY + '/transaction?' + TRANSACTIONHASH + '&holder_data=' + HOLDERDATA + '&token=' + $TOKEN;
fetch(url)
    .then((response) => {
        return response.json();
    }).then((data) => {
    console.log(data);
});

The method returns transaction information by hash.

HTTP request

https://api.matbea.net/CURRENCY/transaction?TRANSACTIONHASH&holder_data=VALUE

Query Parameters:

Parameter Type Default Description Request
CURRENCY string - Currency type - btc, dash, ltc or zec URI
TRANSACTIONHASH string - The hash of the transaction about which information is needed URI
holder_data integer 0 Flag displaying information about the owner of the address. The accepted values are 1 or 0. URI

Response

The query result is returned as json format:

Response example

{
    "error": {},
    "result": {
        "block_hash": "0000000066356691a4353dd8bdc2c60da20d68ad34fff93d8839a133b2a6d42a",
        "block_height": 221,
        "block_time": 1231770060,
        "coinbase": false,
        "confirmations": 507882,
        "double_spend": false,
        "hash": "298ca2045d174f8a158961806ffc4ef96fad02d71a6b84d9fa0491813a776160",
        "lock_time": 0,
        "num_in_block": 2,
        "size": 201,
        "time": 1231770060,
        "txin": [
            {
                "addresses": [
                    "1LzBzVqEeuQyjD2mRWHes3dgWrT9titxvq"
                ],
                "holder_address_count": 1,
                "holder_name": "holder2",
                "holder_rootaddress": "1LzBzVqEeuQyjD2mRWHes3dgWrT9titxvq",
                "n": 0,
                "output_block_height": 221,
                "output_txid": "591e91f809d716912ca1d4a9295e70c3e78bab077683f79350f101da64588073",
                "script_type": "pubkey",
                "value": 100000000,
                "vout": 0
            }
        ],
        "txout": [
            {
                "addresses": [
                    "1BDvQZjaAJH4ecZ8aL3fYgTi7rnn3o2thE"
                ],
                "holder_address_count": null,
                "holder_name": null,
                "holder_rootaddress": null,
                "input_n": null,
                "input_tx_block_height": null,
                "input_txid": null,
                "script_type": "pubkey",
                "value": 100000000,
                "vout": 0
            }
        ]
    }
}

Response is represented by the following fields:

Field Type Description
block_hash string Block hash
block_height integer Block height
block_time integer Block creation time
coinbase boolean Mark of a coinbase transaction
confirmations integer Number of transaction confirmations
double_spend boolean Mark of double spending
hash string Transaction hash
lock_time integer Block height or time at which the transaction will be unlocked
0 transaction not blocked
<500000000 Block number on which this transaction will be unlocked
=500000000 UNIX timestamp in which this transaction will be unlocked
A transaction cannot be added to a block before lock_time
num_in_block integer Block transaction number
size integer Block size
time integer Transaction creation time
txin array Array of input
txout array array of output

Array txin are consists by the following fields:

Field Type Description
addresses array Array of addresses. Array element type - string
holder_name string Name of the owner of the address / addresses used in this input
holder_address_count integer The number of addresses for this owner
holder_rootaddress string Owner primary address
n integer Transaction input number
output_block_height integer Transaction block height
output_txid string The hash of the transaction where the spent output is created
script_type string Signature type
value integer The amount of funds at this input
vout integer The output number where the funds were spent

Array txout are consists by the following fields:

Field Type Description
addresses array Array of addresses to which funds are transferred
holder_name string Name of the owner of the address / addresses used in this output
holder_address_count integer The number of addresses this owner
holder_rootaddress string Owner primary address
input_n integer The input number of the transaction in which the current output is spent
input_tx_block_height integer Transaction block height at which current output is spent
input_txid string The hash of the transaction in which the current output is spent
script_type string Signature type
value integer The amount of funds at this output
vout integer The output number

transactions

Request code examples

curl -g -H "Content-Type: application/json" -H "Accept: application/json" -X POST -d "{\"txid\":[\"298ca2045d174f8a158961806ffc4ef96fad02d71a6b84d9fa0491813a776160\",\"d9620012dd61f8cee4e42f730231af09334889c5a1d6e52172952f27561b573f\"]}" "https://api.matbea.net/btc/transactions&holder_data=1&token=YOUR_TOKEN"
<?php
$CURRENCY = 'btc';
$HASH1 = '298ca2045d174f8a158961806ffc4ef96fad02d71a6b84d9fa0491813a776160';
$HASH2 = 'd9620012dd61f8cee4e42f730231af09334889c5a1d6e52172952f27561b573f';
$HOLDERDATA = 1;
$TOKEN = 'YOUR_TOKEN';

$url = 'https://api.matbea.net/' . $CURRENCY . '/transactions&holder_data=' . $HOLDERDATA . '&token=' . $TOKEN;
$POSTparam=['txid'=>[$HASH1, $HASH2]];

$rsh = curl_init();
if ($rsh) {
    curl_setopt($rsh, CURLOPT_URL, $url);
    curl_setopt($rsh, CURLOPT_HTTPHEADER, ['Content-Type:application/json']);
    curl_setopt($rsh, CURLOPT_RETURNTRANSFER, 1);
    curl_setopt($rsh, CURLOPT_POST, 1);
    curl_setopt($rsh, CURLOPT_POSTFIELDS, json_encode($POSTparam));
    $r=curl_exec($rsh);
    if (!$r) {
        printf("[E]\t%s (%s)\n", curl_error($rsh), curl_errno($rsh));
    } else {
        printf("%s\n", $r);
    }
    curl_close($rsh);
}
CURRENCY = 'btc';
HASH1 = '298ca2045d174f8a158961806ffc4ef96fad02d71a6b84d9fa0491813a776160';
HASH2 = 'd9620012dd61f8cee4e42f730231af09334889c5a1d6e52172952f27561b573f';
HOLDERDATA = 1;
TOKEN = 'YOUR_TOKEN';
url = 'https://api.matbea.net/' + CURRENCY + '/transactions&holder_data=' + HOLDERDATA + '&token=' + TOKEN;

fetch(url, {
    method: 'post',
    body: JSON.stringify({txid: [HASH1, HASH2] }) })
    .then((response) => {
        return response.json();
    }).then((data) => {
    console.log(data);
});

The method method returns transactions information by array of hashes.

HTTP request

https://api.matbea.net/CURRENCY/transactions?txid[]=VALUE&holder_data=VALUE

Query Parameters:

Parameter Type Default Description Request
CURRENCY string - Currency type - btc, dash, ltc or zec URI
txid string - The hash of the transaction or array of hashes of the transactions about which information is needed URI, POST
holder_data integer 0 Flag displaying information about the owner of the address. The accepted values are 1 or 0. URI

Response

The query result is returned as json format

Response example

{
    "error": {},
    "result": {
        "transactions": [
            {
                "block_hash": "0000000066356691a4353dd8bdc2c60da20d68ad34fff93d8839a133b2a6d42a",
                "block_height": 221,
                "block_time": 1231770060,
                "coinbase": false,
                "confirmations": 510202,
                "double_spend": false,
                "hash": "298ca2045d174f8a158961806ffc4ef96fad02d71a6b84d9fa0491813a776160",
                "lock_time": 0,
                "num_in_block": 2,
                "size": 201,
                "time": 1231770060,
                "txin": [
                    {
                        "addresses": [
                            "1LzBzVqEeuQyjD2mRWHes3dgWrT9titxvq" 
                        ],
                        "holder_address_count": 1,
                        "holder_name": "holder2",
                        "holder_rootaddress": "1LzBzVqEeuQyjD2mRWHes3dgWrT9titxvq",
                        "n": 0,
                        "output_block_height": 221,
                        "output_txid": "591e91f809d716912ca1d4a9295e70c3e78bab077683f79350f101da64588073",
                        "script_type": "pubkey",
                        "value": 100000000,
                        "vout": 0
                    }
                ],
                "txout": [
                    {
                        "addresses": [
                            "1BDvQZjaAJH4ecZ8aL3fYgTi7rnn3o2thE" 
                        ],
                        "holder_address_count": null,
                        "holder_name": "",
                        "holder_rootaddress": null,
                        "input_n": null,
                        "input_tx_block_height": null,
                        "input_txid": null,
                        "script_type": "pubkey",
                        "value": 100000000,
                        "vout": 0
                    }
                ]
            },
            {
                "block_hash": "000000000000000000c4913c9a4c9c34289eaf8cd9ddfedc71c708b38ed61bc3",
                "block_height": 495585,
                "block_time": 1511352853,
                "coinbase": true,
                "confirmations": 14838,
                "double_spend": false,
                "hash": "d9620012dd61f8cee4e42f730231af09334889c5a1d6e52172952f27561b573f",
                "lock_time": 0,
                "num_in_block": 1,
                "size": 248,
                "time": 1511352853,
                "txin": [
                    {
                        "value": 1250000000
                    }
                ],
                "txout": [
                    {
                        "addresses": [
                            "1Sjj2cPC3rTWcSTEYDeu2f3BavLosog4T" 
                        ],
                        "holder_address_count": 214,
                        "holder_name": "",
                        "holder_rootaddress": "1NS4gbx1G2D5rc9PnvVsPys12nKxGiQg72",
                        "input_n": 18,
                        "input_tx_block_height": 495969,
                        "input_txid": "fe7d0cd7a843d0654a6be1fc7a16b3b661c60bf3dd7725e460868eeb7cba60b6",
                        "script_type": "pubkeyhash",
                        "value": 1340680951,
                        "vout": 0
                    },
                    {
                        "addresses": [],
                        "holder_address_count": null,
                        "holder_name": "",
                        "holder_rootaddress": null,
                        "input_n": null,
                        "input_tx_block_height": null,
                        "input_txid": null,
                        "script_type": "nulldata",
                        "value": 0,
                        "vout": 1
                    }
                ]
            }
        ]
    }
}

Response is represented array of information about transactions. The each transaction information is consists by the following fields:

Field Type Description
block_hash string Block hash
block_height integer Block height
block_time integer Block creation time
coinbase boolean Mark of a coinbase transaction
confirmations integer Number of transaction confirmations
double_spend boolean Mark of double spending
hash string Transaction hash
lock_time integer Block height or time at which the transaction will be unlocked
0 transaction not blocked
<500000000 Block number on which this transaction will be unlocked
=500000000 UNIX timestamp in which this transaction will be unlocked
A transaction cannot be added to a block before lock_time
num_in_block integer Block transaction number
size integer Block size
time integer Transaction creation time
txin array Array of input
txout array array of output

Array txin are consists by the following fields:

Field Type Description
addresses array Array of addresses. Array element type - string
holder_name string Name of the owner of the address / addresses used in this input
holder_address_count integer The number of addresses for this owner
holder_rootaddress string Owner primary address
n integer Transaction input number
output_block_height integer Transaction block height
output_txid string The hash of the transaction where the spent output is created
script_type string Signature type
value integer The amount of funds at this input
vout integer The output number where the funds were spent

Array txout are consists by the following fields:

Field Type Description
addresses array Array of addresses to which funds are transferred
holder_name string Name of the owner of the address / addresses used in this output
holder_address_count integer The number of addresses this owner
holder_rootaddress string Owner primary address
input_n integer The input number of the transaction in which the current output is spent
input_tx_block_height integer Transaction block height at which current output is spent
input_txid string The hash of the transaction in which the current output is spent
script_type string Signature type
value integer The amount of funds at this output
vout integer The output number

Getting information about one transaction with owner data by the POST method

curl -g -H "Content-Type: application/json" -H "Accept: application/json" -X POST -d "{\"txid\":\"298ca2045d174f8a158961806ffc4ef96fad02d71a6b84d9fa0491813a776160\"}" "https://api.matbea.net/btc/transactions&holder_data=1&token=YOUR_TOKEN"
<?php
$CURRENCY = 'btc';
$HASH1 = '298ca2045d174f8a158961806ffc4ef96fad02d71a6b84d9fa0491813a776160';
$HOLDERDATA = 1;
$TOKEN = 'YOUR_TOKEN';
$url = 'https://api.matbea.net/' . $CURRENCY . '/transactions&holder_data=' . $HOLDERDATA . '&token=' . $TOKEN;
$POSTparam=['txid' => $HASH1];

$rsh = curl_init();
if ($rsh) {
    curl_setopt($rsh, CURLOPT_URL, $url);
    curl_setopt($rsh, CURLOPT_HTTPHEADER, ['Content-Type:application/json']);
    curl_setopt($rsh, CURLOPT_RETURNTRANSFER, 1);
    curl_setopt($rsh, CURLOPT_POST, 1);
    curl_setopt($rsh, CURLOPT_POSTFIELDS, json_encode($POSTparam));
    $r=curl_exec($rsh);
    if (!$r) {
        printf("[E]\t%s (%s)\n", curl_error($rsh), curl_errno($rsh));
    } else {
        printf("%s\n", $r);
    }
    curl_close($rsh);
}
CURRENCY = 'btc';
HASH1 = '298ca2045d174f8a158961806ffc4ef96fad02d71a6b84d9fa0491813a776160';
HOLDERDATA = 1;
TOKEN = 'YOUR_TOKEN';
url = 'https://api.matbea.net/' + CURRENCY + '/transactions&holder_data=' + HOLDERDATA + '&token=' + TOKEN;
fetch(url, {
    method: 'post',
    body: JSON.stringify({txid: HASH1 }) })
    .then((response) => {
        return response.json();
    }).then((data) => {
    console.log(data);
});

Response example

{
    "error": {},
    "result": {
        "transactions": [
            {
                "block_hash": "0000000066356691a4353dd8bdc2c60da20d68ad34fff93d8839a133b2a6d42a",
                "block_height": 221,
                "block_time": 1231770060,
                "coinbase": false,
                "confirmations": 510202,
                "double_spend": false,
                "hash": "298ca2045d174f8a158961806ffc4ef96fad02d71a6b84d9fa0491813a776160",
                "lock_time": 0,
                "num_in_block": 2,
                "size": 201,
                "time": 1231770060,
                "txin": [
                    {
                        "addresses": [
                            "1LzBzVqEeuQyjD2mRWHes3dgWrT9titxvq" 
                        ],
                        "holder_address_count": 1,
                        "holder_name": "holder2",
                        "holder_rootaddress": "1LzBzVqEeuQyjD2mRWHes3dgWrT9titxvq",
                        "n": 0,
                        "output_block_height": 221,
                        "output_txid": "591e91f809d716912ca1d4a9295e70c3e78bab077683f79350f101da64588073",
                        "script_type": "pubkey",
                        "value": 100000000,
                        "vout": 0
                    }
                ],
                "txout": [
                    {
                        "addresses": [
                            "1BDvQZjaAJH4ecZ8aL3fYgTi7rnn3o2thE" 
                        ],
                        "holder_address_count": null,
                        "holder_name": "",
                        "holder_rootaddress": null,
                        "input_n": null,
                        "input_tx_block_height": null,
                        "input_txid": null,
                        "script_type": "pubkey",
                        "value": 100000000,
                        "vout": 0
                    }
                ]
            }
        ]
    }
}

Getting transaction information without owner data by the GET method

curl -g -H "Content-Type: application/json" -H "Accept: application/json" "https://api.matbea.net/transactions?txid[]=298ca2045d174f8a158961806ffc4ef96fad02d71a6b84d9fa0491813a776160&txid[]=d9620012dd61f8cee4e42f730231af09334889c5a1d6e52172952f27561b573f&token=YOUR_TOKEN"
<?php
$CURRENCY = 'btc';
$HASH1 = '298ca2045d174f8a158961806ffc4ef96fad02d71a6b84d9fa0491813a776160';
$HASH2 = 'd9620012dd61f8cee4e42f730231af09334889c5a1d6e52172952f27561b573f';
$TOKEN = 'YOUR_TOKEN';
$url = 'https://api.matbea.net/' . $CURRENCY . '/transactions?txid[]=' . $HASH1 . '&txid[]=' . $HASH2 . '&token=' . $TOKEN;

$rsh = curl_init();
if ($rsh) {
    curl_setopt($rsh, CURLOPT_URL, $url);
    curl_setopt($rsh, CURLOPT_HTTPHEADER, ['Content-Type:application/json']);
    curl_setopt($rsh, CURLOPT_RETURNTRANSFER, 1);
    curl_setopt($rsh, CURLOPT_POST, 0);
    $r=curl_exec($rsh);
    if (!$r) {
        printf("[E]\t%s (%s)\n", curl_error($rsh), curl_errno($rsh));
    } else {
        printf("%s\n", $r);
    }
    curl_close($rsh);
}
CURRENCY = 'btc';
HASH1 = '298ca2045d174f8a158961806ffc4ef96fad02d71a6b84d9fa0491813a776160';
HASH2 = 'd9620012dd61f8cee4e42f730231af09334889c5a1d6e52172952f27561b573f';
TOKEN = 'YOUR_TOKEN';
url = 'https://api.matbea.net/' + CURRENCY + '/transactions?txid[]=' + HASH1 + '&txid[]=' + HASH2 + '&token=' + TOKEN;

fetch(url)
    .then((response) => {
        return response.json();
    }).then((data) => {
    console.log(data);
});

Response example

{
    "error": {},
    "result": {
        "transactions": [
            {
                "block_hash": "0000000066356691a4353dd8bdc2c60da20d68ad34fff93d8839a133b2a6d42a",
                "block_height": 221,
                "block_time": 1231770060,
                "coinbase": false,
                "confirmations": 593489,
                "double_spend": false,
                "hash": "298ca2045d174f8a158961806ffc4ef96fad02d71a6b84d9fa0491813a776160",
                "lock_time": 0,
                "num_in_block": 2,
                "size": 201,
                "time": 1231770060,
                "txin": [
                    {
                        "addresses": [
                            "1LzBzVqEeuQyjD2mRWHes3dgWrT9titxvq"
                        ],
                        "n": 0,
                        "output_block_height": 221,
                        "output_txid": "591e91f809d716912ca1d4a9295e70c3e78bab077683f79350f101da64588073",
                        "script_type": "pubkey",
                        "value": 100000000,
                        "vout": 0
                    }
                ],
                "txout": [
                    {
                        "addresses": [
                            "1BDvQZjaAJH4ecZ8aL3fYgTi7rnn3o2thE"
                        ],
                        "input_n": null,
                        "input_tx_block_height": null,
                        "input_txid": null,
                        "script_type": "pubkey",
                        "value": 100000000,
                        "vout": 0
                    }
                ]
            },
            {
                "block_hash": "000000000000000000c4913c9a4c9c34289eaf8cd9ddfedc71c708b38ed61bc3",
                "block_height": 495585,
                "block_time": 1511352853,
                "coinbase": true,
                "confirmations": 98125,
                "double_spend": false,
                "hash": "d9620012dd61f8cee4e42f730231af09334889c5a1d6e52172952f27561b573f",
                "lock_time": 0,
                "num_in_block": 1,
                "size": 248,
                "time": 1511352853,
                "txin": [
                    {
                        "value": 1250000000
                    }
                ],
                "txout": [
                    {
                        "addresses": [
                            "1Sjj2cPC3rTWcSTEYDeu2f3BavLosog4T"
                        ],
                        "input_n": 18,
                        "input_tx_block_height": 495969,
                        "input_txid": "fe7d0cd7a843d0654a6be1fc7a16b3b661c60bf3dd7725e460868eeb7cba60b6",
                        "script_type": "pubkeyhash",
                        "value": 1340680951,
                        "vout": 0
                    },
                    {
                        "addresses": [],
                        "input_n": null,
                        "input_tx_block_height": null,
                        "input_txid": null,
                        "script_type": "nulldata",
                        "value": 0,
                        "vout": 1
                    }
                ]
            }
        ]
    }
}

transactionsholders

Request code examples

curl -g -H "Content-Type: application/json" -H "Accept: application/json" -X POST -d "{\"txid\":[\"7722cee32dde81a29d4940d28b178b0914e7e8ac5ee52547538e954f4f5ee71a\",\"c07ca408706788c9e916b5c446fb93f064de90d21049b206608fbd5f45e2bdb3\"]}" "https://api.matbea.net/btc/transactionsholders?token=YOUR_TOKEN"
<?php
$CURRENCY = 'btc';
$HASH1 = '7722cee32dde81a29d4940d28b178b0914e7e8ac5ee52547538e954f4f5ee71a';
$HASH2 = 'c07ca408706788c9e916b5c446fb93f064de90d21049b206608fbd5f45e2bdb3';
$TOKEN = 'YOUR_TOKEN';
$url = 'https://api.matbea.net/' . $CURRENCY . '/transactionsholders?token=' . $TOKEN;
$POSTparam=['txid'=>[$HASH1, $HASH2]];
$rsh = curl_init();
if ($rsh) {
    curl_setopt($rsh, CURLOPT_URL, $url);
    curl_setopt($rsh, CURLOPT_HTTPHEADER, ['Content-Type:application/json']);
    curl_setopt($rsh, CURLOPT_RETURNTRANSFER, 1);
    curl_setopt($rsh, CURLOPT_POST, 1);
    curl_setopt($rsh, CURLOPT_POSTFIELDS, json_encode($POSTparam));
    $r=curl_exec($rsh);
    if (!$r) {
        printf("[E]\t%s (%s)\n", curl_error($rsh), curl_errno($rsh));
    } else {
        printf("%s\n", $r);
    }
    curl_close($rsh);
}
CURRENCY = 'btc';
HASH1 = '7722cee32dde81a29d4940d28b178b0914e7e8ac5ee52547538e954f4f5ee71a';
HASH2 = 'c07ca408706788c9e916b5c446fb93f064de90d21049b206608fbd5f45e2bdb3';
TOKEN = 'YOUR_TOKEN';
url = 'https://api.matbea.net/' + CURRENCY + '/transactionsholders?token=' + TOKEN;

fetch(url, {
    method: 'post',
    body: JSON.stringify({txid: [hash1, hash2] }) })
    .then((response) => {
        return response.json();
    }).then((data) => {
    console.log(data);
});

The method returns data about the addresses and their owners included in the requested transaction

HTTP request

https://api.matbea.net/CURRENCY/transactionsholders

A hash or an array of transaction hashes is passed in the txid parameter by the POST method.

Query Parameters:

Parameter Type Default Description Request
CURRENCY string - Currency type - btc, dash, ltc or zec URI
txid string - The hash of the transaction about which information is needed is passed in the parameter.
Passing more than one hash is performed in an array. One hash can be passed as a string parameter.
POST

Response

The query result is returned as json format.

Response example

{
    "error": {},
    "result": {
        "inputs": [
            {
                "holder_address_count": 1,
                "holder_name": "",
                "holder_rootaddress": "1MN3cT9Ro927h4kgpSZ5V7SfYjrwTysXv7",
                "transactions": [
                    "c07ca408706788c9e916b5c446fb93f064de90d21049b206608fbd5f45e2bdb3"
                ]
            },
            {
                "holder_address_count": 1,
                "holder_name": "",
                "holder_rootaddress": "1FGaCR3k9B8ZifGc8FWcYY5yS7FXZgbMFF",
                "transactions": [
                    "7722cee32dde81a29d4940d28b178b0914e7e8ac5ee52547538e954f4f5ee71a"
                ]
            }
        ],
        "outputs": [
            {
                "holder_address_count": 1,
                "holder_name": "",
                "holder_rootaddress": "1BdxBor4JG76RKLAwJZfHC58fWbgidYukz",
                "transactions": [
                    "c07ca408706788c9e916b5c446fb93f064de90d21049b206608fbd5f45e2bdb3"
                ]
            },
            {
                "holder_address_count": 1,
                "holder_name": "",
                "holder_rootaddress": "1MN3cT9Ro927h4kgpSZ5V7SfYjrwTysXv7",
                "transactions": [
                    "c07ca408706788c9e916b5c446fb93f064de90d21049b206608fbd5f45e2bdb3"
                ]
            },
            {
                "holder_address_count": 1,
                "holder_name": "MyNameIs12S4",
                "holder_rootaddress": "12S42ZEw2741DHrivgZHLfX8M58mxb7bFy",
                "transactions": [
                    "7722cee32dde81a29d4940d28b178b0914e7e8ac5ee52547538e954f4f5ee71a"
                ]
            }
        ]
    }
}

Response is represented by the following fields:

Field Type Description
inputs array The array of Information about inputs
outputs array The array of Information about outputs

Array inputs are consists by the following fields:

Field Type Description
holder_address_count integer Number of addresses owner
holder_name string Owners name
holder_rootaddress string Owner root address
transactions array Array of transaction hashes in which this address was as input

Array outputs are consists by the following fields:

Field Type Description
holder_address_count integer Number of addresses owner
holder_name string Owners name
holder_rootaddress string Owner root address
transactions array Array of transaction hashes in which this address was as output

Getting information about one transaction

curl -g -H "Content-Type: application/json" -H "Accept: application/json" -X POST -d "{\"txid\":\"7722cee32dde81a29d4940d28b178b0914e7e8ac5ee52547538e954f4f5ee71a\"}" "https://api.matbea.net/btc/transactionsholders?token=YOUR_TOKEN"
<?php
$CURRENCY = 'btc';
$HASH1 = '7722cee32dde81a29d4940d28b178b0914e7e8ac5ee52547538e954f4f5ee71a';
$TOKEN = 'YOUR_TOKEN';
$url = 'https://api.matbea.net/' . $CURRENCY . '/transactionsholders?token=' . $TOKEN;
$POSTparam=['txid' => $HASH1];
$rsh = curl_init();
if ($rsh) {
    curl_setopt($rsh, CURLOPT_URL, $url);
    curl_setopt($rsh, CURLOPT_HTTPHEADER, ['Content-Type:application/json']);
    curl_setopt($rsh, CURLOPT_RETURNTRANSFER, 1);
    curl_setopt($rsh, CURLOPT_POST, 1);
    curl_setopt($rsh, CURLOPT_POSTFIELDS, json_encode($POSTparam));
    $r=curl_exec($rsh);
    if (!$r) {
        printf("[E]\t%s (%s)\n", curl_error($rsh), curl_errno($rsh));
    } else {
        printf("%s\n", $r);
    }
    curl_close($rsh);
}
CURRENCY = 'btc';
HASH1 = '7722cee32dde81a29d4940d28b178b0914e7e8ac5ee52547538e954f4f5ee71a';
TOKEN = 'YOUR_TOKEN';
url = 'https://api.matbea.net/' + CURRENCY + '/transactionsholders?token=' + TOKEN;

fetch(url, {
    method: 'post',
    body: JSON.stringify({txid: HASH1})})
    .then( (response) => {
        return response.json();
    }).then( (data) => {
    console.log(data);
});

Response example

{
    "error": {},
    "result": {
        "inputs": [
            {
                "holder_address_count": 1,
                "holder_name": "",
                "holder_rootaddress": "1FGaCR3k9B8ZifGc8FWcYY5yS7FXZgbMFF",
                "transactions": [
                    "7722cee32dde81a29d4940d28b178b0914e7e8ac5ee52547538e954f4f5ee71a"
                ]
            }
        ],
        "outputs": [
            {
                "holder_address_count": 1,
                "holder_name": "MyNameIs12S4",
                "holder_rootaddress": "12S42ZEw2741DHrivgZHLfX8M58mxb7bFy",
                "transactions": [
                    "7722cee32dde81a29d4940d28b178b0914e7e8ac5ee52547538e954f4f5ee71a"
                ]
            }
        ]
    }
}

Get information about address owners

getholder

Request code examples

curl -g -H "Content-Type: application/json" -H "Accept: application/json" "https://api.matbea.net/btc/getholder/12S42ZEw2741DHrivgZHLfX8M58mxb7bFy?address_data=1&token=YOUR_TOKEN"
<?php
$CURRENCY = 'btc';
$ADDR1 = '12S42ZEw2741DHrivgZHLfX8M58mxb7bFy';
$ADDRESSDATA = 1;
$TOKEN = 'YOUR_TOKEN';
$url = 'https://api.matbea.net/' . $CURRENCY . '/getholder/' . $ADDR1 . '?address_data=' . $ADDRESSDATA . '&token=' . $TOKEN;

$rsh = curl_init();
if ($rsh) {
    curl_setopt($rsh, CURLOPT_URL, $url);
    curl_setopt($rsh, CURLOPT_HTTPHEADER, ['Content-Type:application/json']);
    curl_setopt($rsh, CURLOPT_RETURNTRANSFER, 1);
    curl_setopt($rsh, CURLOPT_POST, 0);
    $r=curl_exec($rsh);
    if (!$r) {
        printf("[E]\t%s (%s)\n", curl_error($rsh), curl_errno($rsh));
    } else {
        printf("%s\n", $r);
    }
    curl_close($rsh);
}
CURRENCY = 'btc';
ADDR1 = '12S42ZEw2741DHrivgZHLfX8M58mxb7bFy';
ADDRESSDATA = 1;
TOKEN = 'YOUR_TOKEN';
url = 'https://api.matbea.net/' + CURRENCY + '/getholder/' + ADDR1 + '?address_data=' + ADDRESSDATA + '&token=' + TOKEN;

fetch(url)
    .then(function (response) {
        return response.json();
    }).then(function (data) {
    console.log(data);
});

The method returns information about the owner of the root address.

HTTP request

https://api.matbea.net/CURRENCY/getholder/ADDRESS?address_data=VALUE

Query parameters

Parameter Type Default Description Request
CURRENCY string - Currency type - btc, dash, ltc or zec URI
ADDRESS string - Root address about which information is needed URI
address_data integer - Flag for displaying information about other addresses of the owner. The accepted values are 1 or 0 URI

Response

The query result is returned as json format:

{
    "error": {},
    "result": {
        "holder_address_count": 1,
        "addresses": [
            "12S42ZEw2741DHrivgZHLfX8M58mxb7bFy"
        ],
        "download_type": "direct",
        "holder_name": "MyNameIs12S4",
        "holder_rootaddress": "12S42ZEw2741DHrivgZHLfX8M58mxb7bFy"
    }
}

Response if the parameter address_data is not set or is equal to 0

{
    "error": {},
    "result": {
        "holder_address_count": 1,
        "holder_name": "MyNameIs12S4",
        "holder_rootaddress": "12S42ZEw2741DHrivgZHLfX8M58mxb7bFy"
    }
}

If there is no information about the address owner, the following result is returned

{
    "error": {
        "code": 2,
        "message": "No such holder"
    },
    "result": {}
}

Response is represented by the following fields:

Field Type Description
holder_address_count integer Number of addresses
addresses array Addresses array
download_type string The method of obtaining addresses:
"by_support_email" - if the number of addresses is 10000000 or more, then receipt by request;
"by_link" - if the number of addresses is in the range from 200 to 10000000, then the addresses can be downloaded by the link;
"direct" - if the number of addresses is equal or less than to 200, then the addresses are presented in the current response.
holder_name string Owners name
holder_rootaddress string Owner root address

If the parameter address_data is not set or is equal to 0, then the array addresses as a result is not returned. If information about the owner of the address is missing or a child address or incorrect address has been sent, an error is returned.

Getting information about the owner of the address without additional data

curl -g -H "Content-Type: application/json" -H "Accept: application/json" "https://api.matbea.net/btc/getholder/12S42ZEw2741DHrivgZHLfX8M58mxb7bFy?token=YOUR_TOKEN"
<?php
$CURRENCY = 'btc';
$ADDR1 = '12S42ZEw2741DHrivgZHLfX8M58mxb7bFy';
$TOKEN = 'YOUR_TOKEN';

$url = 'https://api.matbea.net/' . $CURRENCY . '/getholder/' . $ADDR1 . '?token=' . $TOKEN;

$rsh = curl_init();
if ($rsh) {
    curl_setopt($rsh, CURLOPT_URL, $url);
    curl_setopt($rsh, CURLOPT_HTTPHEADER, ['Content-Type:application/json']);
    curl_setopt($rsh, CURLOPT_RETURNTRANSFER, 1);
    curl_setopt($rsh, CURLOPT_POST, 0);
    $r=curl_exec($rsh);
    if (!$r) {
        printf("[E]\t%s (%s)\n", curl_error($rsh), curl_errno($rsh));
    } else {
        printf("%s\n", $r);
    }
    curl_close($rsh);
}
CURRENCY = 'btc';
ADDR1 = '12S42ZEw2741DHrivgZHLfX8M58mxb7bFy';
TOKEN = 'YOUR_TOKEN';

url = 'https://api.matbea.net/' + CURRENCY + '/getholder/' + ADDR1 + '?token=' + TOKEN;

fetch(url)
    .then(function (response) {
        return response.json();
    }).then(function (data) {
    console.log(data);
});

Response example

{
    "error": {},
    "result": {
        "holder_address_count": 1,
        "holder_name": "MyNameIs12S4",
        "holder_rootaddress": "12S42ZEw2741DHrivgZHLfX8M58mxb7bFy"
    }
}

getholders

Request code examples

curl -g -H "Content-Type: application/json" -H "Accept: application/json" "https://api.matbea.net/btc/getholders?address[]=12S42ZEw2741DHrivgZHLfX8M58mxb7bFy&address[]=1MN3cT9Ro927h4kgpSZ5V7SfYjrwTysXv7&confirmations=10&token=YOUR_TOKEN"
<?php
$CURRENCY = 'btc';
$ADDR1 = '12S42ZEw2741DHrivgZHLfX8M58mxb7bFy';
$ADDR2 = '1MN3cT9Ro927h4kgpSZ5V7SfYjrwTysXv7';
$CONFIRMATIONS = 10;
$TOKEN = 'YOUR_TOKEN';

$url = 'https://api.matbea.net/' . $CURRENCY . '/getholders?address[]=' . $ADDR1 . '&address[]=' . $ADDR2 . '&confirmations=' . $CONFIRMATIONS . '&token=' . $TOKEN;

$rsh = curl_init();
if ($rsh) {
    curl_setopt($rsh, CURLOPT_URL, $url . $GETparam);
    curl_setopt($rsh, CURLOPT_HTTPHEADER, ['Content-Type:application/json']);
    curl_setopt($rsh, CURLOPT_RETURNTRANSFER, 1);
    curl_setopt($rsh, CURLOPT_POST, 0);
    $r=curl_exec($rsh);
    if (!$r) {
        printf("[E]\t%s (%s)\n", curl_error($rsh), curl_errno($rsh));
    } else {
        printf("%s\n", $r);
    }
    curl_close($rsh);
}
CURRENCY = 'btc';
ADDR1 = '12S42ZEw2741DHrivgZHLfX8M58mxb7bFy';
ADDR2 = '1MN3cT9Ro927h4kgpSZ5V7SfYjrwTysXv7';
CONFIRMATIONS = 10;
TOKEN = 'YOUR_TOKEN';

url = 'https://api.matbea.net/' + CURRENCY + '/getholders?address[]=' + ADDR1 + '&address[]=' + ADDR2 + '&confirmations=' + CONFIRMATIONS + '&token=' + TOKEN;

fetch(url)
    .then(function (response) {
        return response.json();
    }).then(function (data) {
    console.log(data);
});

The method returns information about the balance and owners of addresses.

HTTP request

https://api.matbea.net/CURRENCY/getholders?address[]=VALUE&confirmations=VALUE

Query parameters

Parameter Type Default Description Request
CURRENCY string - Currency type - btc, dash, ltc or zec URI
address string - The address or array of addresses for which information is requested. The addresses is transmitted in an array. URI, POST
confirmations integer 1 Number of balance confirmations URI

Response

The query result is returned as json format:

{
    "error": {},
    "result": [
        {
            "address_balance": 5500,
            "address_hash": "12S42ZEw2741DHrivgZHLfX8M58mxb7bFy",
            "holder_address_count": 1,
            "holder_name": "MyNameIs12S4",
            "holder_rootaddress": "12S42ZEw2741DHrivgZHLfX8M58mxb7bFy"
        },
        {
            "address_balance": 6500,
            "address_hash": "1MN3cT9Ro927h4kgpSZ5V7SfYjrwTysXv7",
            "holder_address_count": 1,
            "holder_name": "",
            "holder_rootaddress": "1MN3cT9Ro927h4kgpSZ5V7SfYjrwTysXv7"
        }
    ]
}

Empty result

{
    "error": {},
    "result": []
}

Response is represented by the following fields:

Field Type Description
address_balance integer Balance of address
address_hash string Requested address
holder_address_count integer The number of addresses belonging to the owner of the requested address
holder_name string Owners name
holder_rootaddress string Owner root address

If information about the address owner is missing, then the fields holder_address_count, holder_name, holder_rootaddress are null.

If the request contains an invalid address or an address that was not used in transactions, then the contents of the result array will be empty.

Getting information about the balance and owners of addresses, with a specified number of balance confirmation, using the POST method

curl -g -H "Content-Type: application/json" -H "Accept: application/json" -X POST -d "{\"address\":[\"12S42ZEw2741DHrivgZHLfX8M58mxb7bFy\",\"1MN3cT9Ro927h4kgpSZ5V7SfYjrwTysXv7\"]}" "https://api.matbea.net/btc/getholders?confirmations=1000000&token=YOUR_TOKEN"
<?php
$CURRENCY = 'btc';
$ADDR1 = '12S42ZEw2741DHrivgZHLfX8M58mxb7bFy';
$ADDR2 = '1MN3cT9Ro927h4kgpSZ5V7SfYjrwTysXv7';
$CONFIRMATIONS = 1000000;
$TOKEN = 'YOUR_TOKEN';

$url = 'https://api.matbea.net/' . $CURRENCY . '/getholders?confirmations=' . $CONFIRMATIONS . '&token=' . $TOKEN;
$POSTparam=['address'=>[$ADDR1, $ADDR2]];
$rsh = curl_init();
if ($rsh) {
    curl_setopt($rsh, CURLOPT_URL, $url . $GETparam);
    curl_setopt($rsh, CURLOPT_HTTPHEADER, ['Content-Type:application/json']);
    curl_setopt($rsh, CURLOPT_RETURNTRANSFER, 1);
    curl_setopt($rsh, CURLOPT_POST, 1);
    curl_setopt($rsh, CURLOPT_POSTFIELDS, json_encode($POSTparam));
    $r=curl_exec($rsh);
    if (!$r) {
        printf("[E]\t%s (%s)\n", curl_error($rsh), curl_errno($rsh));
    } else {
        printf("%s\n", $r);
    }
    curl_close($rsh);
}
CURRENCY = 'btc';
ADDR1 = '12S42ZEw2741DHrivgZHLfX8M58mxb7bFy';
ADDR2 = '1MN3cT9Ro927h4kgpSZ5V7SfYjrwTysXv7';
CONFIRMATIONS = 1000000;
TOKEN = 'YOUR_TOKEN';

url = 'https://api.matbea.net/' + CURRENCY + '/getholders?confirmations=' + CONFIRMATIONS + '&token=' + TOKEN;

fetch(url, {
    method: 'post',
    body: JSON.stringify({address: [ADDR1, ADDR2] }) })
    .then(function (response) {
        return response.json();
    }).then(function (data) {
    console.log(data);
});

Response example

{
    "error": {},
    "result": [
        {
            "address_balance": 0,
            "address_hash": "12S42ZEw2741DHrivgZHLfX8M58mxb7bFy",
            "holder_address_count": 1,
            "holder_name": "MyNameIs12S4",
            "holder_rootaddress": "12S42ZEw2741DHrivgZHLfX8M58mxb7bFy"
        },
        {
            "address_balance": 0,
            "address_hash": "1MN3cT9Ro927h4kgpSZ5V7SfYjrwTysXv7",
            "holder_address_count": 1,
            "holder_name": "",
            "holder_rootaddress": "1MN3cT9Ro927h4kgpSZ5V7SfYjrwTysXv7"
        }
    ]
}

Getting information about the balance and the owner of one address, without setting the number of confirmations, using the POST method

curl -g -H "Content-Type: application/json" -H "Accept: application/json" -X POST -d "{\"address\":\"12S42ZEw2741DHrivgZHLfX8M58mxb7bFy\"}" "https://api.matbea.net/btc/getholders?token=YOUR_TOKEN"
<?php
$CURRENCY = 'btc';
$ADDR1 = '12S42ZEw2741DHrivgZHLfX8M58mxb7bFy';
$TOKEN = 'YOUR_TOKEN';

$url = 'https://api.matbea.net/' . $CURRENCY . '/getholders?token=' . $TOKEN;
$POSTparam=['address' => $ADDR1];

$rsh = curl_init();
if ($rsh) {
    curl_setopt($rsh, CURLOPT_URL, $url);
    curl_setopt($rsh, CURLOPT_HTTPHEADER, ['Content-Type:application/json']);
    curl_setopt($rsh, CURLOPT_RETURNTRANSFER, 1);
    curl_setopt($rsh, CURLOPT_POST, 1);
    curl_setopt($rsh, CURLOPT_POSTFIELDS, json_encode($POSTparam));
    $r=curl_exec($rsh);
    if (!$r) {
        printf("[E]\t%s (%s)\n", curl_error($rsh), curl_errno($rsh));
    } else {
        printf("%s\n", $r);
    }
    curl_close($rsh);
}
CURRENCY = 'btc';
ADDR1 = '12S42ZEw2741DHrivgZHLfX8M58mxb7bFy';
TOKEN = 'YOUR_TOKEN';

url = 'https://api.matbea.net/' + CURRENCY + '/getholders?token=' + TOKEN;

fetch(url, {
    method: 'post',
    body: JSON.stringify({address: ADDR1})})
    .then(function (response) {
        return response.json();
    }).then(function (data) {
    console.log(data);
});

Response example

{
    "error": {},
    "result": [
        {
            "address_balance": 5500,
            "address_hash": "12S42ZEw2741DHrivgZHLfX8M58mxb7bFy",
            "holder_address_count": 1,
            "holder_name": "MyNameIs12S4",
            "holder_rootaddress": "12S42ZEw2741DHrivgZHLfX8M58mxb7bFy"
        }
    ]
}

downloadholder

Request code examples

curl -g -H "Content-Type: application/json" -H "Accept: application/json" "https://api.matbea.net/btc/downloadholder/132aSc15WmoPwtMbqRVzouZKNnjWL1YTVb?token=YOUR_TOKEN"
<?php
$CURRENCY = 'btc';
$ADDRESS = '132aSc15WmoPwtMbqRVzouZKNnjWL1YTVb';
$TOKEN = 'YOUR_TOKEN';
$url = 'https://api.matbea.net/' . $CURRENCY . '/downloadholder/' . $ADDRESS . '?token=' . $TOKEN;

$rsh = curl_init();
if ($rsh) {
    curl_setopt($rsh, CURLOPT_URL, $url);
    curl_setopt($rsh, CURLOPT_HTTPHEADER, ['Content-Type:application/json']);
    curl_setopt($rsh, CURLOPT_RETURNTRANSFER, 1);
    curl_setopt($rsh, CURLOPT_POST, 0);
    $r=curl_exec($rsh);
    if (!$r) {
        printf("[E]\t%s (%s)\n", curl_error($rsh), curl_errno($rsh));
    } else {
        printf("%s\n", $r);
    }
    curl_close($rsh);
}
CURRENCY = 'btc';
ADDRESS = '132aSc15WmoPwtMbqRVzouZKNnjWL1YTVb';
TOKEN = 'YOUR_TOKEN';
url = 'https://api.matbea.net/' + CURRENCY + '/downloadholder/' + ADDRESS + '?token=' + TOKEN;

fetch(url)
    .then((response) => {
        return response.text();
    }).then((data) => {
    console.log(data);
});

Returns a list of other addresses of the owner to whom the requested address is belongs.

HTTP request

https://api.matbea.net/CURRENCY/downloadholder/ADDRESS

Query parameters

Parameter Type Default Description Request
CURRENCY string - Currency type - btc, dash, ltc or zec URI
ADDRESS string - The address for which information is requested URI

Response

The query result is returned as csv format

132aSc15WmoPwtMbqRVzouZKNnjWL1YTVb
17oofDoUGPaTi7xEP3StP1sU1YxEMDfQa6

Response example if the result contains more than 1000000 addresses

{
    "error": {
        "code": 1,
        "message": "Holder is too big for downloading. Contact support service, please."
    },
    "result": {}
}

If the result contains the number of addresses equal to or less than 1000000, then the data is returned as csv format.

If the result contains more than 1000000 addresses, an error is returned.

Proxy methods

estimatefee

Request code examples

curl -g -H "Content-Type: application/json" -H "Accept: application/json" "https://api.matbea.net/btc/transaction/estimatefee?blocks=3&token=YOUR_TOKEN"
<?php
$CURRENCY = 'btc';
$BLOCKS = 3;
$TOKEN = 'YOUR_TOKEN';
$url = 'https://api.matbea.net/' . $CURRENCY . '/transaction/estimatefee?blocks=' . $BLOCKS . '&token=' . $TOKEN;

$rsh = curl_init();
if ($rsh) {
    curl_setopt($rsh, CURLOPT_URL, $url);
    curl_setopt($rsh, CURLOPT_HTTPHEADER, ['Content-Type:application/json']);
    curl_setopt($rsh, CURLOPT_RETURNTRANSFER, 1);
    curl_setopt($rsh, CURLOPT_POST, 0);
    $r=curl_exec($rsh);
    if (!$r) {
        printf("[E]\t%s (%s)\n", curl_error($rsh), curl_errno($rsh));
    } else {
        printf("%s\n", $r);
    }
    curl_close($rsh);
}
CURRENCY = 'btc';
BLOCKS = 3;
TOKEN = 'YOUR_TOKEN';
url = 'https://api.matbea.net/' + CURRENCY + '/transaction/estimatefee?blocks=' + BLOCKS + '&token=' + TOKEN;

fetch(url)
    .then(function (response) {
        return response.json();
    }).then(function (data) {
    console.log(data);
});

The method returns information about the recommended commission for including a transaction in a given block.

HTTP request

https://api.matbea.net/CURRENCY/transaction/estimatefee?blocks=VALUE

Query parameters

Parameter Type Default Description Request
CURRENCY string - Currency type - btc, dash, ltc or zec URI
blocks integer 2 The block number in which the transaction is to be included. Accepted values in range 1 - 25 URI

Response

The query result is returned as json format.

Response example

{
    "error": {},
    "result": {
        "blocks": 3,
        "estimatefee": 0.00389181
    }
}

Response example if it is impossible to calculate the commission

{
    "error": {},
    "result": {
        "blocks": 1000,
        "estimatefee": -1
    }
}

Response is represented by the following fields:

Field Type Description
blocks integer Block height
estimatefee double Recommended fee

Getting the recommended commission without specifying the block number

curl -g -H "Content-Type: application/json" -H "Accept: application/json" "https://api.matbea.net/btc/transaction/estimatefee?token=YOUR_TOKEN"
<?php
$CURRENCY = 'btc';
$TOKEN = 'YOUR_TOKEN';
$url = 'https://api.matbea.net/' . $CURRENCY . '/transaction/estimatefee?token=' . $TOKEN;

$rsh = curl_init();
if ($rsh) {
    curl_setopt($rsh, CURLOPT_URL, $url);
    curl_setopt($rsh, CURLOPT_HTTPHEADER, ['Content-Type:application/json']);
    curl_setopt($rsh, CURLOPT_RETURNTRANSFER, 1);
    curl_setopt($rsh, CURLOPT_POST, 0);
    $r=curl_exec($rsh);
    if (!$r) {
        printf("[E]\t%s (%s)\n", curl_error($rsh), curl_errno($rsh));
    } else {
        printf("%s\n", $r);
    }
    curl_close($rsh);
}
CURRENCY = 'btc';
TOKEN = 'YOUR_TOKEN';
url = 'https://api.matbea.net/' + CURRENCY + '/transaction/estimatefee?token=' + TOKEN;

fetch(url)
    .then(function (response) {
        return response.json();
    }).then(function (data) {
    console.log(data);
});

Response example

{
    "error": {},
    "result": {
        "blocks": 2,
        "estimatefee": 0.00463748
    }
}

getrawtransaction

Request code examples

curl -g -H "Content-Type: application/json" -H "Accept: application/json" "https://api.matbea.net/btc/getrawtransaction/000000329877c7141c6e50b04ed714a860abcb15135611f6ac92609cb392ef60?token=YOUR_TOKEN"
<?php
$CURRENCY = 'btc';
$TXID = '000000329877c7141c6e50b04ed714a860abcb15135611f6ac92609cb392ef60';
$TOKEN = 'YOUR_TOKEN';
$url = 'https://api.matbea.net/' . $CURRENCY . '/getrawtransaction/' . $TXID . '?token=' . $TOKEN;

$rsh = curl_init();
if ($rsh) {
    curl_setopt($rsh, CURLOPT_URL, $url);
    curl_setopt($rsh, CURLOPT_HTTPHEADER, ['Content-Type:application/json']);
    curl_setopt($rsh, CURLOPT_RETURNTRANSFER, 1);
    curl_setopt($rsh, CURLOPT_POST, 0);
    $r=curl_exec($rsh);
    if (!$r) {
        printf("[E]\t%s (%s)\n", curl_error($rsh), curl_errno($rsh));
    } else {
        printf("%s\n", $r);
    }
    curl_close($rsh);
}
CURRENCY = 'btc';
TXID = '000000329877c7141c6e50b04ed714a860abcb15135611f6ac92609cb392ef60';
TOKEN = 'YOUR_TOKEN';
url = 'https://api.matbea.net/' + CURRENCY + '/getrawtransaction/' + TXID + '?token=' + TOKEN;

fetch(url)
    .then((response) => {
        return response.json();
    }).then((data) => {
    console.log(data);
});

The method returns transaction information in raw format.

HTTP request

https://api.matbea.net/CURRENCY/getrawtransaction/TXID

Query parameters

Parameter Type Default Description Request
CURRENCY string - Currency type - btc, dash, ltc or zec URI
TXID string - Transaction ID URI

Response

The query result is returned as json format:

Response example

{
    "error": null,
    "id": "1",
    "result": {
        "blockhash": "00000000000000bde803f93f8d9832aca482cf80d1f46530d75b73f4e0b19ef2",
        "blocktime": 1366601333,
        "confirmations": 273834,
        "hash": "000000329877c7141c6e50b04ed714a860abcb15135611f6ac92609cb392ef60",
        "hex": "010000000179936f0ea31acd9801904d9da2a1061252664c877e9c19b5543e7c08682b6688010000006b4830450220395c119dfe52c38f83b9f5c28e2d6e597dc5cf244c5080ce25dfbe08560630e3022100d63bbd40ff43f0c45d2c84dc7df64ab41bd151d868e4f8c3d02259cdea6ea686012103d84c8403be88b2549a5e6d6792df08ef262f3172c62e6077c8849879d2345c6bffffffff02380b0000000000001976a91432ba382cf668657bae15ee0a97fa87f12e1bc89f88ac40420f00000000001976a91406f1b66ffe49df7fce684df16c62f59dc9adbd3f88ac00000000",
        "locktime": 0,
        "size": 226,
        "time": 1366601333,
        "txid": "000000329877c7141c6e50b04ed714a860abcb15135611f6ac92609cb392ef60",
        "version": 1,
        "vin": [
            {
                "scriptSig": {
                    "asm": "30450220395c119dfe52c38f83b9f5c28e2d6e597dc5cf244c5080ce25dfbe08560630e3022100d63bbd40ff43f0c45d2c84dc7df64ab41bd151d868e4f8c3d02259cdea6ea686[ALL] 03d84c8403be88b2549a5e6d6792df08ef262f3172c62e6077c8849879d2345c6b",
                    "hex": "4830450220395c119dfe52c38f83b9f5c28e2d6e597dc5cf244c5080ce25dfbe08560630e3022100d63bbd40ff43f0c45d2c84dc7df64ab41bd151d868e4f8c3d02259cdea6ea686012103d84c8403be88b2549a5e6d6792df08ef262f3172c62e6077c8849879d2345c6b"
                },
                "sequence": 4294967295,
                "txid": "88662b68087c3e54b5199c7e874c66521206a1a29d4d900198cd1aa30e6f9379",
                "vout": 1
            }
        ],
        "vout": [
            {
                "n": 0,
                "scriptPubKey": {
                    "addresses": [
                        "15dDsLzoxHnoZYbab18mxcD5gjc8CLTyEe"
                    ],
                    "asm": "OP_DUP OP_HASH160 32ba382cf668657bae15ee0a97fa87f12e1bc89f OP_EQUALVERIFY OP_CHECKSIG",
                    "hex": "76a91432ba382cf668657bae15ee0a97fa87f12e1bc89f88ac",
                    "reqSigs": 1,
                    "type": "pubkeyhash"
                },
                "value": 2.872e-05
            },
            {
                "n": 1,
                "scriptPubKey": {
                    "addresses": [
                        "1dice8EMZmqKvrGE4Qc9bUFf9PX3xaYDp"
                    ],
                    "asm": "OP_DUP OP_HASH160 06f1b66ffe49df7fce684df16c62f59dc9adbd3f OP_EQUALVERIFY OP_CHECKSIG",
                    "hex": "76a91406f1b66ffe49df7fce684df16c62f59dc9adbd3f88ac",
                    "reqSigs": 1,
                    "type": "pubkeyhash"
                },
                "value": 0.01
            }
        ],
        "vsize": 226
    }
}

Response is represented by the following fields:

Field Type Description
error array On success, is null
id integer The request number. Always is 1
result array Transaction information

Array result are consists by the following fields:

Field Type Description
blockhash string Hash of block
blocktime integer Block creation time
confirmations integer Number of confirmations
hash string Hash of transaction
hex string Hash in hexadecimal
locktime integer Lock time
size integer Transaction size
time integer Time
txid string Transaction ID
version integer Version
vin array Array of inputs
vout array Array of outputs
vsize integer Size

Array vin are consists by the following fields:

Field Type Description
scriptSig array An array describing the signature script. In coinbase-transactions are missing
asm string Signed decoded script with operation codes, without data
hex string Hex encoded signed script
sequence integer The number of precedence. The number defined for each transaction input, which determines how much time (expressed by the number of 512 second time intervals or the number of blocks) must elapse from the moment the input is confirmed to the moment when the transaction has the opportunity to be accepted on the blockchain
txid string Hash of input
vout integer The output number which the funds were spent. In coinbase-transactions are missing

Array vout are consists by the following fields:

Field Type Description
n integer Number
scriptPubKey array An array containing public signature information
addresses array Array of addresses used in the transaction
asm string Script of public signature in decoded form with transaction codes, without data
hex string Hex encoded public signature script
reqSigs integer The required number of signatures. Always equal 1. For multisig transaction may be greater than 2
type string Signature type
value double Output number

If request parameters is incorrect, then result is null and error array is represented by the following fields:

Field Type Description
code integer Error code
message string Error message

sendrawtransaction

Request code examples

curl -g -H "Content-Type: application/json" -H "Accept: application/json" -X POST -d "{\"txhash\":\"0100000001997ae2a654ddb2432ea2fece72bc71d3dbd371703a0479592efae21bf6b7d5100100000000ffffffff01e00f9700000000001976a9142a495afa8b8147ec2f01713b18693cb0a85743b288ac00000000\"}" "https://api.matbea.net/btc/sendrawtransaction?token=YOUR_TOKEN"
<?php
$CURRENCY = 'btc';
$TXHASH = 'SERIALIZED AND HEX-ENCODED RAW TRANSACTION';
$TOKEN = 'YOUR_TOKEN';
$url = 'https://api.matbea.net/' . $CURRENCY . '/sendrawtransaction?token=' . $TOKEN;
$POSTparam = ['txhash' => $TXHASH];
$rsh = curl_init();
if ($rsh) {
    curl_setopt($rsh, CURLOPT_URL, $url);
    curl_setopt($rsh, CURLOPT_HTTPHEADER, ['Content-Type:application/json']);
    curl_setopt($rsh, CURLOPT_RETURNTRANSFER, 1);
    curl_setopt($rsh, CURLOPT_POST, 1);
    curl_setopt($rsh, CURLOPT_POSTFIELDS, http_build_query($POSTparam) );
    $r=curl_exec($rsh);
    if (!$r) {
        printf("[E]\t%s (%s)\n", curl_error($rsh), curl_errno($rsh));
    } else {
        printf("%s\n", $r);
    }
    curl_close($rsh);
}
CURRENCY = 'btc';
TXHASH = 'SERIALIZED AND HEX-ENCODED RAW TRANSACTION';
TOKEN = 'YOUR_TOKEN';
url = 'https://api.matbea.net/' + CURRENCY + '/sendrawtransaction?token=' + TOKEN;

fetch(url, {
    method: 'post',
    body: 'txhash=' + TXHASH})
    .then((response) => {
        return response.json();
    }).then((data) => {
    console.log(data);
});

The method sends a transaction in raw format.

Transaction data is transmitted by the POST method.

HTTP request

https://api.matbea.net/CURRENCY/sendrawtransaction

Query parameters

Parameter Type Default Description Request
CURRENCY string - Currency type - btc, dash, ltc or zec URI
txhash string - Serialized and hex encoded raw transaction POST

Response

The query result is returned as json format:

Response example

{
    "result": "6d32b5f707ed5dc7272396b1b0410ba5ebaf516b00bbdd726f3863e793186324",
    "error": null,
    "id": "1"
}

Response is represented by the following fields:

Field Type Description
result string Transaction hash
error array On success, is null
id integer The request number. Always is 1

If request parameters is incorrect, then result is null and error array is represented by the following fields:

Field Type Description
code integer Error code
message string Error message