Bitcoin Forum
May 14, 2024, 01:36:56 PM *
News: Latest Bitcoin Core release: 27.0 [Torrent]
 
   Home   Help Search Login Register More  
Pages: [1]
  Print  
Author Topic: Cryptsy Ticker API with Bid/Ask Price?  (Read 1006 times)
Sinjin Jenson (OP)
Newbie
*
Offline Offline

Activity: 6
Merit: 0


View Profile
February 14, 2014, 10:34:22 PM
 #1

I'm trying to figure out the best way to implement a ticker using the Cryptsy API. I specifically want bid/ask prices and volume if possible.

The nearest thing I can find is this which retrieves market data (for LTC-BTC in this case)...

http://pubapi.cryptsy.com/api.php?method=singlemarketdata&marketid=3

This gives me a whole ream of stuff (below). But buried in there are "buyorders" and "sellorders". Am I correct in thinking that I must extra maximum/minimum prices myself to arrive at bid and ask prices here?

Is there a simpler way to do this?

Cheers


{"success":1,"return":{"markets":{"LTC":{"marketid":"3","label":"LTC\/BTC","lasttradeprice":"0.02518260","volume":"19617.38568340","lasttradetime":"2014-02-14 16:53:57","primaryname":"LiteCoin","primarycode":"LTC","secondaryname":"BitCoin","secondarycode":"BTC","recenttrades":[{"id":"23846528","time":"2014-02-14 17:14:27","price":"0.02529971","quantity":"75.34549791","total":"1.90621925"},{"id":"23846526","time":"2014-02-14 17:14:27","price":"0.02529971","quantity":"2.59602000","total":"0.06567855"},

...

{"id":"23842974","time":"2014-02-14 16:58:52","price":"0.02518260","quantity":"0.20512347","total":"0.00516554"},{"id":"23842895","time":"2014-02-14 16:58:41","price":"0.02518260","quantity":"0.61845652","total":"0.01557434"},{"id":"23842893","time":"2014-02-14 16:58:41","price":"0.02518260","quantity":"0.61845652","total":"0.01557434"},{"id":"23842886","time":"2014-02-14 16:58:39","price":"0.02518260","quantity":"0.61845652","total":"0.01557434"}],"sellorders":[{"price":"0.02529968","quantity":"38.00173858","total":"0.96143183"},{"price":"0.02529972","quantity":"32.45181918","total":"0.82102194"},{"price":"0.02529981","quantity":"0.07025210","total":"0.00177736"},{"price":"0.02529983","quantity":"0.09388749","total":"0.00237534"},{"price":"0.02529984","quantity":"0.09389746","total":"0.00237559"},{"price":"0.02529987","quantity":"3.67426794","total":"0.09295850"},{"price":"0.02529991","quantity":"0.04872477","total":"0.00123273"},{"price":"0.02529992","quantity":"2.31846117","total":"0.05865688"},{"price":"0.02529997","quantity":"0.19422769","total":"0.00491395"},{"price":"0.02530000","quantity":"1.44335508","total":"0.03651688"},{"price":"0.02531000","quantity":"19.46400125","total":"0.49263387"},{"price":"0.02531050","quantity":"0.03200000","total":"0.00080994"},{"price":"0.02531150","quantity":"0.03200000","total":"0.00080997"},{"price":"0.02531350","quantity":"0.03200000","total":"0.00081003"},{"price":"0.02531460","quantity":"0.19985000","total":"0.00505912"},{"price":"0.02531650","quantity":"0.03200000","total":"0.00081013"},{"price":"0.02531950","quantity":"0.03200000","total":"0.00081022"},{"price":"0.02532000","quantity":"0.10000000","total":"0.00253200"},{"price":"0.02532480","quantity":"0.19985000","total":"0.00506116"},{"price":"0.02532984","quantity":"0.03200000","total":"0.00081055"}],"buyorders":[{"price":"0.02520000","quantity":"22.52642300","total":"0.56766586"},{"price":"0.02516086","quantity":"5.58681657","total":"0.14056911"},{"price":"0.02516085","quantity":"3.13241711","total":"0.07881428"},{"price":"0.02516083","quantity":"0.91040171","total":"0.02290646"},{"price":"0.02516000","quantity":"79.69218677","total":"2.00505542"},{"price":"0.02515001","quantity":"0.37897644","total":"0.00953126"},{"price":"0.02515000","quantity":"0.81084758","total":"0.02039282"},{"price":"0.02512667","quantity":"0.48738044","total":"0.01224625"},{"price":"0.02508580","quantity":"0.20015000","total":"0.00502092"},{"price":"0.02507310","quantity":"0.20015000","total":"0.00501838"},{"price":"0.02505001","quantity":"0.07237958","total":"0.00181311"},{"price":"0.02505000","quantity":"0.96469278","total":"0.02416555"},{"price":"0.02504407","quantity":"1.01401137","total":"0.02539497"},{"price":"0.02502680","quantity":"0.20015000","total":"0.00500911"},{"price":"0.02501002","quantity":"14.49400038","total":"0.36249524"},{"price":"0.02501000","quantity":"39.90419812","total":"0.99800399"},{"price":"0.02500113","quantity":"0.36450112","total":"0.00911294"},{"price":"0.02500112","quantity":"1.32158653","total":"0.03304114"},{"price":"0.02500111","quantity":"2.39136790","total":"0.05978685"},{"price":"0.02500101","quantity":"1.00000000","total":"0.02500101"}]}}}}
1715693816
Hero Member
*
Offline Offline

Posts: 1715693816

View Profile Personal Message (Offline)

Ignore
1715693816
Reply with quote  #2

1715693816
Report to moderator
1715693816
Hero Member
*
Offline Offline

Posts: 1715693816

View Profile Personal Message (Offline)

Ignore
1715693816
Reply with quote  #2

1715693816
Report to moderator
1715693816
Hero Member
*
Offline Offline

Posts: 1715693816

View Profile Personal Message (Offline)

Ignore
1715693816
Reply with quote  #2

1715693816
Report to moderator
Bitcoin mining is now a specialized and very risky industry, just like gold mining. Amateur miners are unlikely to make much money, and may even lose money. Bitcoin is much more than just mining, though!
Advertised sites are not endorsed by the Bitcoin Forum. They may be unsafe, untrustworthy, or illegal in your jurisdiction.
1715693816
Hero Member
*
Offline Offline

Posts: 1715693816

View Profile Personal Message (Offline)

Ignore
1715693816
Reply with quote  #2

1715693816
Report to moderator
1715693816
Hero Member
*
Offline Offline

Posts: 1715693816

View Profile Personal Message (Offline)

Ignore
1715693816
Reply with quote  #2

1715693816
Report to moderator
1715693816
Hero Member
*
Offline Offline

Posts: 1715693816

View Profile Personal Message (Offline)

Ignore
1715693816
Reply with quote  #2

1715693816
Report to moderator
9inety7even
Member
**
Offline Offline

Activity: 84
Merit: 10


View Profile
February 15, 2014, 12:51:53 AM
 #2

It looks like the asks and bids are ordered already. Together they make up the order book, all of which are unfilled. To get the market price, you could just take the latest order.

Pages: [1]
  Print  
 
Jump to:  

Powered by MySQL Powered by PHP Powered by SMF 1.1.19 | SMF © 2006-2009, Simple Machines Valid XHTML 1.0! Valid CSS!