Tommo_Aus
|
|
August 09, 2013, 01:03:20 AM |
|
I'm trying to access the API through Java but keep getting a 403 - Forbidden error, is the API blocked unless you're using a browser? I'm doing something like: URL url = new URL(" http://www.coinchoose.com/api.php"); HttpURLConnection conn; try { conn = (HttpURLConnection) url.openConnection(); return IOUtils.toString(conn.getInputStream()); } catch (IOException ex) { throw new Exception("CoinChoose unavailable", ex); } Doing this works for any other API, just not this one
|
Tompool - http://tompool.org - a 2% fee SHA256/Scrypt/BURST/Groestl multipool supporting ANC, ASC, DGC, EZC, FLO, GLD, GME, MNC, RYC, TGC, TRC, XNC, ZET & more
|
|
|
sal002 (OP)
|
|
August 09, 2013, 12:24:28 PM |
|
I am trying to use the JSON feature. Is there a param that can be passed to the PHP to just return one coin? I'm trying to pull this into Excel however the data opening in http://jsonviewer.stack.hu/# is not really usable for my situation as it doesn't parse easy. JSON doesn't seem to have any Start Array. They all start with 0 so have no unique variable designator to call a particular block. Thanks. JR { "0": "ALF", "symbol": "ALF", "1": "Alphacoin", "name": "Alphacoin", "2": "scrypt", "algo": "scrypt", "3": "139899", "currentBlocks": "139899", "4": "0.28117197", "difficulty": "0.28117197", "5": "50", "reward": "50", "6": "0.5", "minBlockTime": "0.5", "7": "42348021", "networkhashrate": "42348021", "price": "0.00000668", "exchange": "CRY", "ratio": 177.67324231619, "adjustedratio": 149.30524564386, "avgProfit": "238.90397144111515", "avgHash": "32870159.8819" }, { "0": "AMC", "symbol": "AMC", "1": "AmericanCoin", "name": "AmericanCoin", "2": "scrypt", "algo": "scrypt", "3": "26447", "currentBlocks": "26447", "4": "0.58185063", "difficulty": "0.58185063", "5": "100", "reward": "100", "6": "1", "minBlockTime": "1", "7": "4298789", "networkhashrate": "4298789", "price": "0.0000082675", "exchange": "CRY", "ratio": 212.52512455529, "adjustedratio": 196.45179580741, "avgProfit": "201.92091254984373", "avgHash": "5449881.8681" },
Hi - since the API is already being used in several applications, I can't alter the format now. However, you could just iterate thru and find the symbol by examining the "symbol".
|
|
|
|
sal002 (OP)
|
|
August 09, 2013, 12:25:41 PM |
|
I'm trying to access the API through Java but keep getting a 403 - Forbidden error, is the API blocked unless you're using a browser? I'm doing something like: URL url = new URL(" http://www.coinchoose.com/api.php"); HttpURLConnection conn; try { conn = (HttpURLConnection) url.openConnection(); return IOUtils.toString(conn.getInputStream()); } catch (IOException ex) { throw new Exception("CoinChoose unavailable", ex); } Doing this works for any other API, just not this one You might have been blocked by CloudFlare as there is nothing on my side blocking it (several applications use it not from a browser with no issue). Please PM me your IP and I can whitelist.
|
|
|
|
Cryptoin
|
|
August 11, 2013, 05:22:14 PM |
|
Any chance you will be adding trade volume in BTC to the charts?
|
|
|
|
lucazane
Legendary
Offline
Activity: 1198
Merit: 1000
|
|
August 11, 2013, 05:32:05 PM |
|
Any chance you will be adding trade volume in BTC to the charts?
it would be great ! Total volume trade (sum of all exchange)
|
|
|
|
Tommo_Aus
|
|
August 12, 2013, 12:35:15 AM |
|
You might have been blocked by CloudFlare as there is nothing on my side blocking it (several applications use it not from a browser with no issue). Please PM me your IP and I can whitelist.
Found a solution, I had to add a browser user agent string to the request: URLConnection conn = url.openConnection(); conn.setRequestProperty("User-Agent", "Mozilla/5.0 (Windows; U; Windows NT 6.1; en-GB; rv:1.9.2.13) Gecko/20101203 Firefox/3.6.13 (.NET CLR 3.5.30729)"); Queries work now, not sure why I needed to add this to an API tho.
|
Tompool - http://tompool.org - a 2% fee SHA256/Scrypt/BURST/Groestl multipool supporting ANC, ASC, DGC, EZC, FLO, GLD, GME, MNC, RYC, TGC, TRC, XNC, ZET & more
|
|
|
Jazkal
|
|
August 12, 2013, 03:19:17 PM |
|
What happened to CGB? Was it de-listed?
|
|
|
|
Vitalicus
Full Member
Offline
Activity: 467
Merit: 100
DIA | Data infrastructure for DeFi
|
|
August 12, 2013, 07:35:08 PM |
|
where is ppcoin ?
|
|
|
|
sal002 (OP)
|
|
August 12, 2013, 07:37:45 PM |
|
*sigh* Block explorers died.
|
|
|
|
Eli0t
|
|
August 12, 2013, 07:40:35 PM |
|
would it be possible to add a button to take out the top result so we can see the history of the other coins?
eg with BTG hitting 53000% none of the other coins can be seen until its off the graph (and the coin toggle buttons no longer remove the coin)
|
LTC: LKpJf3uk7KsHU73kxq8iFJrP1AAKN7Yni7 DGC: DKXGvEbj3Rwgrm2QQbRyNPDDZDYoq4Y44d XPM: AWV5AKfLFyoBaMjg9C77rGUBhuFxz5DGGL
|
|
|
Athanasios Motok
|
|
August 12, 2013, 10:02:09 PM |
|
How can you find out a profitability of a coin?
|
|
|
|
sal002 (OP)
|
|
August 13, 2013, 01:51:45 AM |
|
would it be possible to add a button to take out the top result so we can see the history of the other coins?
eg with BTG hitting 53000% none of the other coins can be seen until its off the graph (and the coin toggle buttons no longer remove the coin)
Partially got this done - now just to save what was previously clicked (on the refresh).
|
|
|
|
sal002 (OP)
|
|
August 13, 2013, 01:52:26 AM |
|
How can you find out a profitability of a coin?
Besides looking at my site
|
|
|
|
bandjhughes
Member
Offline
Activity: 81
Merit: 10
|
|
August 13, 2013, 02:37:45 AM |
|
Hello, Great job with CoinChoose. I find it extremely useful.
Can I make one suggestion/request? When doing a history query, for the coins that are on multiple markets it's not always super simple to determine if the record is using the LTC or the BTC market. Would it be difficult for you to add an exchange type field in the record (i.e., a field with either BTC or LTC)?
Thanks,
|
|
|
|
Jazkal
|
|
August 13, 2013, 01:18:27 PM |
|
What happened to CGB? Was it de-listed?
CGB is still not being listed. Is this a bug, or by design?
|
|
|
|
sal002 (OP)
|
|
August 13, 2013, 01:33:17 PM |
|
It's block explorer is down so it is by design. I do not keep up a coin if the data is stale as that would easily skew the numbers.
To be clear - I do not really 'delist' a coin unless the coin's developers make it clear that I need to delist it. So far, I have delisted Powercoin and Doubloons. That is it - every other coin falters usually because the Block explorer is dead and I cannot get updated statistics. If a block explorer stays dead for a few days, I try to bring up a local daemon.
With respect to CGB, I was working on a few other things on the site yesterday (clicking the legend and a few backend tweaks) and did not have time to bring up the local daemon. I will work on it shortly.
|
|
|
|
sal002 (OP)
|
|
August 13, 2013, 01:33:49 PM |
|
Hello, Great job with CoinChoose. I find it extremely useful.
Can I make one suggestion/request? When doing a history query, for the coins that are on multiple markets it's not always super simple to determine if the record is using the LTC or the BTC market. Would it be difficult for you to add an exchange type field in the record (i.e., a field with either BTC or LTC)?
Thanks,
Sure - do you mean the json.php request?
|
|
|
|
gudmunsn
|
|
August 13, 2013, 03:06:55 PM |
|
The WDC patch has altered the block size and time, so that should affect the stats on coinchoose. You should probably update that when you get a chance, as it will greatly reduce stales
|
|
|
|
Jazkal
|
|
August 13, 2013, 06:18:56 PM |
|
It's block explorer is down so it is by design. I do not keep up a coin if the data is stale as that would easily skew the numbers.
To be clear - I do not really 'delist' a coin unless the coin's developers make it clear that I need to delist it. So far, I have delisted Powercoin and Doubloons. That is it - every other coin falters usually because the Block explorer is dead and I cannot get updated statistics. If a block explorer stays dead for a few days, I try to bring up a local daemon.
With respect to CGB, I was working on a few other things on the site yesterday (clicking the legend and a few backend tweaks) and did not have time to bring up the local daemon. I will work on it shortly.
Good to know. And thanks for the good work you do.
|
|
|
|
bandjhughes
Member
Offline
Activity: 81
Merit: 10
|
|
August 13, 2013, 07:01:13 PM Last edit: August 13, 2013, 07:15:31 PM by bandjhughes |
|
Hello, Great job with CoinChoose. I find it extremely useful.
Can I make one suggestion/request? When doing a history query, for the coins that are on multiple markets it's not always super simple to determine if the record is using the LTC or the BTC market. Would it be difficult for you to add an exchange type field in the record (i.e., a field with either BTC or LTC)?
Thanks,
Sure - do you mean the json.php request? Yes, the json.php request. Thank You !!! As an example of why this would be beneficial....here are two histories for BQC during the last hour: {"currency":"BQC","profitability":"234.08428870675","time":"2013-08-13 13:10:02","price":"0.000025003333333333"} {"currency":"BQC","profitability":"97.422862240985","time":"2013-08-13 13:10:02","price":"0.000914"}, both have the same time, and one is for the BTC market and the other for the LTC market. Obviously one could tell from the price which is which. But sometimes there are no trades on one of the markets during a period and then you only have one BQC record for that period. So instead of writing my own code to figure out which market the trade occurred on, it would be great if that field was already in the record. Thanks again for your great site!
|
|
|
|
|