Bitcoin-mining-proxy icon indicating copy to clipboard operation
Bitcoin-mining-proxy copied to clipboard

Balance Stats API

Open tecnobrat opened this issue 13 years ago • 16 comments

Many pools provide an API to view the balance of your account. Perhaps this can be integrated so you can view the balance of all of your pools from the pool overview page.

tecnobrat avatar Jun 29 '11 17:06 tecnobrat

This is present for a while now, use this URL: /admin/?format=Json

echiu64 avatar Jul 06 '11 15:07 echiu64

@echiu64: That's a different feature entirely. @tecnobrat is requesting that the dashboard show the account balances of the various pools.

cdhowie avatar Jul 06 '11 15:07 cdhowie

Ah, my mistake. In that case, not sure about account balance, but for pool balance, would be useful to shortlist a set a pools to start with, maybe deepbit, slush and btcguild?

echiu64 avatar Jul 06 '11 17:07 echiu64

Current order of % of total hashrate:

(Note: BTCGuild is down I believe)

  • Deepbit
  • Slush
  • BTCMine
  • BitcoinPool
  • Bitcoins.lc
  • MTRed

tecnobrat avatar Jul 06 '11 17:07 tecnobrat

I would like to implement this feature in such a way that I don't have to special-case each pool, but rather leave it open for extension by the user. This model will take a bit of work to design, so it probably won't be ready soon.

cdhowie avatar Jul 07 '11 03:07 cdhowie

I've written some simple perl scrapers for collectd, there are 2 categories, JSON and scraped. JSON is probably the easiest, simply put the URL (which would include any API key/username/password) and then the JSON object to capture. For data that doesn't contain the total explicitly, would need a way to express how to sum up an array.

I vote we start support (with a generic slant) for deepbit/slush/btcguild, they all have JSON APIs.

btcmind (no account) didn't see any reference to a JSON API. bitcoins.lc has a JSON API, but doesn't return any user stats (worker or total hashrate) bitcoinpool no user JSON data

echiu64 avatar Jul 08 '11 15:07 echiu64

I would like to request Eligius support as well, though I do not know the status of any API or similar.

edgeman16 avatar Jul 08 '11 17:07 edgeman16

I have a basic JSON only balance view, will push it to github in the next 24 hours. A better version would be to pull it into mysql and graph it.

echiu64 avatar Jul 13 '11 04:07 echiu64

I added support for pools supporting JSON, i put examples for deepbit, btcguild and slush. If anyone has other URLs, send me the JSON data and I'll try to help you configure it. See my tree (https://github.com/echiu64/Bitcoin-mining-proxy)

echiu64 avatar Jul 13 '11 17:07 echiu64

Here is config for mtred:

    'mtred' => array(
            'url' => 'https://mtred.com/api/user/key/123',
            'confirmed' => 'balance',
            'unconfirmed' => ''),

tecnobrat avatar Jul 13 '11 19:07 tecnobrat

btcmine:

    'btcmine' => array(
            'url' => 'http://btcmine.com/api/getbalance/123/',
            'confirmed' => 'confirmed',
            'unconfirmed' => 'unconfirmed'),

tecnobrat avatar Jul 13 '11 19:07 tecnobrat

bitcoinpool doesn't use API keys, they allow you to see the balances of any user. Put your USERNAME in the correct location.

    'bitcoinpool' => array(
            'url' => 'http://bitcoinpool.com/user.php?u=USERNAME&json=1',
            'confirmed' => 'User.unpaid',
            'unconfirmed' => 'User.unconfirmed'),

tecnobrat avatar Jul 13 '11 19:07 tecnobrat

Eligius has data in a json:

http://eligius.st/~luke-jr/raw/5/balances.json

You'd have to know the bitcoin address you wanted to look for, no API keys required... I think?

edgeman16 avatar Jul 13 '11 19:07 edgeman16

Sent a pull request for initial balance chart implementation...

echiu64 avatar Jul 13 '11 20:07 echiu64

Committed the examples for BTCMine, the others are in there as well

echiu64 avatar Jul 14 '11 01:07 echiu64

@edgeman16: I've added Eligius support in my fork based on the work @echiu64 completed for the other pools balance data. Unfortunately Eligius does require a separate script, but I've built it all in so that all you would need to do is update the config file and pull the getEligius.php script. Feel free to grab just the new script and the config entries, or to pull the entire fork.

raetha avatar Jul 25 '11 13:07 raetha