Explorer web api


#1

I am coding a discord bot that is checking my smart addresses for balances and compute my revenues in my nodes. The problem is that I do not find any documentation or something like an explorer API, in order to get the balance for a specific address.

The problem is that I can not find any API for the explorer something like:
http://explorer.smartcash.cc/ext/getbalance/“my address”

Exist something like that in smartcash?

PS: I already did this kind of bots for some other coins I will put the new bot in my https://github.com/Lyndros in the case that someone else is interested.


#2

Read more here

Here are some example
https://insight.smartcash.cc/api/addr/ShS2t2AS1dvzNhzk9apQDYndadPTCkLyaS
https://insight.smartcash.cc/api/addr/ShS2t2AS1dvzNhzk9apQDYndadPTCkLyaS/balance
https://insight.smartcash.cc/api/addr/ShS2t2AS1dvzNhzk9apQDYndadPTCkLyaS/totalReceived
https://insight.smartcash.cc/api/addr/ShS2t2AS1dvzNhzk9apQDYndadPTCkLyaS/totalSent


#3

Transaction ID API missing number of outputs or inputs: https://insight.smartcash.cc/api/tx/dde9df6f1a4c677372801c76bca647f4d20b3bec779d6466ca2cbd0923deea6c

I am using PHP, and here is what I usually do:
$specific_address = ‘address’;
$json = json_decode(file_get_contents(‘https ://insight.smartcash.cc/api/tx/’.$Tx_hash), true);
for ($n=0; $n<$json[‘NUMBER OF vout’]; $n++) {
$json_address = $json[‘vout’][$n][‘address’];
if ($json_address == $specific_address) { echo ‘Result’; }
}

My goal is to get the [‘value’] which specifically related to [‘address’] by each transaction.
With uncertain number of [‘vout’] or [‘vin’], I cannot catch it by code.

someone adds this up please,
kind regards,
thanks
Wata Malon
(I can speak Vietnamese)