v1 of the CasinoCoin API is now online. Developers can pull the current CSC:BTC ratio rate as well as the value of 1 CSC in various currencies with the following API call to:
http://casinoco.in/api/casinocoin/v1/rate
The result is in JSON format -- here is an example of what the result set is:
Array
(
[cryptsy_cscbtc_ratio] => 0.00001830
[mtxgox_btc_rate_usd] => 948.98999
[values] => Array
(
[USD] => 0.017366516817
[EUR] => 0.012760916557132
[JPY] => 1.8232237680327
[BGN] => 0.025006047564798
[CZK] => 0.34971823240234
[DKK] => 0.095210191797521
[GBP] => 0.010548422314646
[HUF] => 3.8316614379188
[LTL] => 0.044064063119774
[LVL] => 0.0089593860258903
[PLN] => 0.053316943279872
[RON] => 0.057794031315294
[SEK] => 0.11396255665652
[CHF] => 0.015777480528245
[NOK] => 0.10743795628837
[HRK] => 0.097341063410967
[RUB] => 0.57549163428175
[TRY] => 0.038006622054004
[AUD] => 0.019558171239305
[BRL] => 0.041545918181309
[CAD] => 0.018816620971219
[CNY] => 0.10516294258534
[HKD] => 0.13466691800574
[IDR] => 212.46196673918
[ILS] => 0.060827961803224
[INR] => 1.0764635449017
[KRW] => 18.476759973762
[MXN] => 0.22797721286349
[MYR] => 0.056923968822763
[NZD] => 0.021016958651933
[PHP] => 0.77663063205624
[SGD] => 0.022083262784497
[THB] => 0.57361605046551
[ZAR] => 0.18751149202819
[ISK] => 2.0327507934298
)
)
How this works is the code I've written checks Cryptsy for the latest CSC:BTC ratio. It then calls Mt. Gox for the latest BTC USD value and calculates the CSC USD value accordingly. Finally, it pulls up from the Yahoo Finanace API a list of USD exchange rates of various currencies and calculates the value of CSC for those currencies.
One thing I've noticed is that on occasion, calls to the Crypsty API to pull the latest CSC:BTC ratio fails, which results in a value of 0.00 for the CSC:BTC ratio, which then messes up the calculation of CSC in various currencies. I will need to update the code to handle these situations when the call to the Cryptsy API fails. I will also need to implement some form of caching to speed things up.
I'll be releasing the PHP code on GitHub for this shortly in case any developers wanted to integrate this functionality locally into their app. Otherwise, feel free to call the API in your apps.
I will be creating some documentation for the CasinoCoin API, and will integrate the functionality of it into the CasinoCoin homepage so that the current rates are displayed on the header of each page.
I'll be online this evening to answer any questions.