Bitcoin Forum

Bitcoin => Bitcoin Technical Support => Topic started by: Gordon Bleu on August 15, 2013, 11:27:54 AM



Title: Cryptsy API simple Ticker
Post by: Gordon Bleu on August 15, 2013, 11:27:54 AM
Need the String for a Cryptsy API get,


This URL throws all at me (i'm stupid, i know)

http://pubapi.cryptsy.com/api.php?method=marketdata

as far as i understand i could add more specific Values with &blabla=btc/anc&bla=bla

exp. http://pubapi.cryptsy.com/api.php?method=marketdata&blabla=btc/anc&bla=bla


How to create an GET Call for last sell price for Anoncoin ?




Title: Re: Cryptsy API simple Ticker
Post by: luke.watson on August 15, 2013, 12:21:31 PM
I found this article really helpful for getting the mtgox feed

https://coderwall.com/p/ksrula

I think you'll be able to edit it for different APIs


Title: Re: Cryptsy API simple Ticker
Post by: crypto4games on August 26, 2013, 04:27:09 PM
I know this was an old thread but I was playing with something similar.

I was able to set one up pretty quickly with the help from luke's post. I pasted the code below.


Code:
#!/usr/bin/env php
<?php
$c 
curl_init();
curl_setopt($cCURLOPT_RETURNTRANSFER1);
curl_setopt($cCURLOPT_HTTPHEADER, array('Accept: application/json''Content-Type: application/json'));
curl_setopt($cCURLOPT_URL'http://pubapi.cryptsy.com/api.php?method=marketdata');

$data curl_exec($c);
curl_close($c);
$obj json_decode($data);
echo 
print_r($obj->{'return'}->{'markets'}->{'ANC'}->{'lasttradeprice'}."\n"true);
?>


Title: Re: Cryptsy API simple Ticker
Post by: halibit on October 15, 2013, 05:58:20 AM
I know this was an old thread but I was playing with something similar.

I was able to set one up pretty quickly with the help from luke's post. I pasted the code below.


Code:
#!/usr/bin/env php
<?php
$c 
curl_init();
curl_setopt($cCURLOPT_RETURNTRANSFER1);
curl_setopt($cCURLOPT_HTTPHEADER, array('Accept: application/json''Content-Type: application/json'));
curl_setopt($cCURLOPT_URL'http://pubapi.cryptsy.com/api.php?method=marketdata');

$data curl_exec($c);
curl_close($c);
$obj json_decode($data);
echo 
print_r($obj->{'return'}->{'markets'}->{'ANC'}->{'lasttradeprice'}."\n"true);
?>


Thanks for sharing this. That I was looking for :)