Bitcoin Forum
December 06, 2016, 08:34:59 AM *
News: To be able to use the next phase of the beta forum software, please ensure that your email address is correct/functional.
 
   Home   Help Search Donate Login Register  
Pages: [1]
  Print  
Author Topic: Bitcoinica API Python Interface  (Read 1409 times)
area
Full Member
***
Offline Offline

Activity: 176


View Profile
January 22, 2012, 11:23:56 AM
 #1

As I mentioned here, I've written an interface for the Bitcoinica API in Python, after not finding one out in the wild. I've now cleaned it up a little, and put it up on GitHub for all to use. It's fairly bare-bones, but hopefully some people here will find it useful. Any suggestions to improve it will be welcomed.

Mine the best coin, all the time, using Cryptoswitcher
Advertised sites are not endorsed by the Bitcoin Forum. They may be unsafe, untrustworthy, or illegal in your jurisdiction. Advertise here.
1481013299
Hero Member
*
Offline Offline

Posts: 1481013299

View Profile Personal Message (Offline)

Ignore
1481013299
Reply with quote  #2

1481013299
Report to moderator
1481013299
Hero Member
*
Offline Offline

Posts: 1481013299

View Profile Personal Message (Offline)

Ignore
1481013299
Reply with quote  #2

1481013299
Report to moderator
1481013299
Hero Member
*
Offline Offline

Posts: 1481013299

View Profile Personal Message (Offline)

Ignore
1481013299
Reply with quote  #2

1481013299
Report to moderator
stochastic
Hero Member
*****
Offline Offline

Activity: 532


View Profile
January 25, 2012, 07:57:17 AM
 #2

I have been playing around with this.  It works fine.  I have not found any bugs.

I wanted to know how would you extract the returned objects.  For example:

Code:
quotes = exchange.get_quotes
quotes
(200, {u'pair': u'BTCUSD', u'selling': 6.3806, u'buying': 6.25541})

I am am just learning python, so how would you extract the selling and buying prices?

Introducing constraints to the economy only serves to limit what can be economical.
Qoheleth
Legendary
*
Offline Offline

Activity: 882


Spurn wild goose chases. Seek that which endures.


View Profile WWW
January 25, 2012, 08:12:45 AM
 #3

I have been playing around with this.  It works fine.  I have not found any bugs.

I wanted to know how would you extract the returned objects.  For example:

Code:
quotes = exchange.get_quotes
quotes
(200, {u'pair': u'BTCUSD', u'selling': 6.3806, u'buying': 6.25541})

I am am just learning python, so how would you extract the selling and buying prices?
"quotes" here is a tuple, which means it has numbered entries. for instance, quotes[0] is 200, and quotes[1] is {u'pair': u'BTCUSD', u'selling': 6.3806, u'buying': 6.25541}
the thing in braces is a dictionary, which means it has named entries. for instance, quotes[1]['selling'] will give you 6.3806, and quotes[1]['buying'] will give you 6.25541

If there is something that will make Bitcoin succeed, it is growth of utility - greater quantity and variety of goods and services offered for BTC. If there is something that will make Bitcoin fail, it is the culture of naive fools and conmen, the former convinced that BTC is a magic box that will turn them into millionaires, and the latter arriving by the busload to devour them.
stochastic
Hero Member
*****
Offline Offline

Activity: 532


View Profile
January 25, 2012, 08:17:10 AM
 #4

I have been playing around with this.  It works fine.  I have not found any bugs.

I wanted to know how would you extract the returned objects.  For example:

Code:
quotes = exchange.get_quotes
quotes
(200, {u'pair': u'BTCUSD', u'selling': 6.3806, u'buying': 6.25541})

I am am just learning python, so how would you extract the selling and buying prices?
"quotes" here is a tuple, which means it has numbered entries. for instance, quotes[0] is 200, and quotes[1] is {u'pair': u'BTCUSD', u'selling': 6.3806, u'buying': 6.25541}
the thing in braces is a dictionary, which means it has named entries. for instance, quotes[1]['selling'] will give you 6.3806, and quotes[1]['buying'] will give you 6.25541

Thanks Qoheleth!

Introducing constraints to the economy only serves to limit what can be economical.
take5
Jr. Member
*
Offline Offline

Activity: 41



View Profile
February 03, 2012, 03:08:16 AM
 #5

Just what I was looking for! I've been learning python on and off for awhile, maybe this is what I needed to give me some motivation.  Grin Thanks for posting this!
Pages: [1]
  Print  
 
Jump to:  

Sponsored by , a Bitcoin-accepting VPN.
Powered by MySQL Powered by PHP Powered by SMF 1.1.19 | SMF © 2006-2009, Simple Machines Valid XHTML 1.0! Valid CSS!