Author

Topic: Altcoin address widget - is their one ? (Read 110 times)

legendary
Activity: 1932
Merit: 1273
January 30, 2022, 04:04:21 PM
#8
I don't know much about PHP.

You should just try around printing the variable of the retrieved API URL and then suits it to what/how you want to display it. The API you refer to is not a JSON file so I think you didn't have to parse it.

Try to echo the $result, given $result is the retrieved payload from https://chainz.cryptoid.info/xp/api.dws?q=getbalance&a=PCN5rFx9ZL3rDMpPAP8KKo5jB3hBbYxC7F
member
Activity: 180
Merit: 52
January 30, 2022, 03:32:46 PM
#7

It should be fairly easy if you know basic HTML and javascript:

Code:
let api_url = "https://chainz.cryptoid.info/xp/api.dws?q=getbalance&a=PCN5rFx9ZL3rDMpPAP8KKo5jB3hBbYxC7F"

async function getapi(url) {
    const response = await fetch(url);
    
    var data = await response.json();
    document.getElementById("data").innerHTML = data; // or some code to put up the data on the html
}
getapi(api_url);

If you still got trouble getting it displayed on your page, simply searching for "displaying API data on HTML" should be good to go.

I know a bit which is prob dangerous Smiley

I understand about pulling specific info from arrays like this :
https://bittrex.com/api/v1.1/public/getticker/?market=btc-eth

Using something like this :

Code:
$obj = json_decode($result);

/*
echo"
";
print_r($obj);
echo"
";
*/

echo $obj->result->Bid;

But I have no obj to display/print as it is just the balance i am after

Thanks
TT
legendary
Activity: 1932
Merit: 1273
January 30, 2022, 03:07:47 PM
#6

It should be fairly easy if you know basic HTML and javascript:

Code:
let api_url = "https://chainz.cryptoid.info/xp/api.dws?q=getbalance&a=PCN5rFx9ZL3rDMpPAP8KKo5jB3hBbYxC7F"

async function getapi(url) {
    const response = await fetch(url);
    
    var data = await response.json();
    document.getElementById("data").innerHTML = data; // or some code to put up the data on the html
}
getapi(api_url);

If you still got trouble getting it displayed on your page, simply searching for "displaying API data on HTML" should be good to go.
member
Activity: 180
Merit: 52
January 30, 2022, 02:49:18 PM
#5
I am looking for either a widget that can take info from an altcoin address.... Example it will show balance of a specific address on my website (html/php).
I don't mind either a pre made widget or raw code.

Thanks
TT

It would be helpful if you could specify for which altcoin need information on your website. I doubt there is a universal solution.
Also, if you have programming skills in PHP or some other language, you can access APIs from different blockchain explorers, for example, check out the Etherscan documentation here.



I am trying to set up a webpage to monitor my masternodes balances but I am having trouble (usual story)

Any idea how I would display this api result on my page ?

https://chainz.cryptoid.info/xp/api.dws?q=getbalance&a=PCN5rFx9ZL3rDMpPAP8KKo5jB3hBbYxC7F

And thanks for your replies Smiley

TT
legendary
Activity: 1526
Merit: 1359
January 29, 2022, 12:41:36 PM
#4
I am looking for either a widget that can take info from an altcoin address.... Example it will show balance of a specific address on my website (html/php).
I don't mind either a pre made widget or raw code.

Thanks
TT

It would be helpful if you could specify for which altcoin need information on your website. I doubt there is a universal solution.
Also, if you have programming skills in PHP or some other language, you can access APIs from different blockchain explorers, for example, check out the Etherscan documentation here.

legendary
Activity: 1932
Merit: 1273
January 29, 2022, 08:22:01 AM
#3
I dunno which particular one, but the above suggestion is worth a try if it still works. Anyway, I think if you want to go the raw option, acquiring the data from Blockhair API might be good to go: https://blockchair.com/api/docs#link_300, see that link, you can configure the option to meet your needs. But do note that it is limited only to a few altcoins that are available on the API.
hero member
Activity: 1778
Merit: 709
[Nope]No hype delivers more than hope
January 29, 2022, 08:10:38 AM
#2
Just found this website. On their github repo it is explained that it supports multiple coins. You can find the preview of the widget on the main web page.

Hopefully meet your expectations.
member
Activity: 180
Merit: 52
January 29, 2022, 07:21:57 AM
#1
I am looking for either a widget that can take info from an altcoin address.... Example it will show balance of a specific address on my website (html/php).
I don't mind either a pre made widget or raw code.

Thanks
TT
Jump to: