Bitcoin Forum

Economy => Speculation => Topic started by: area on January 22, 2012, 11:23:56 AM



Title: Bitcoinica API Python Interface
Post by: area on January 22, 2012, 11:23:56 AM
As I mentioned here (https://bitcointalk.org/index.php?topic=57286.msg683088#msg683088), 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 (https://github.com/area/bitcoinica.py) 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.


Title: Re: Bitcoinica API Python Interface
Post by: stochastic on January 25, 2012, 07:57:17 AM
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?


Title: Re: Bitcoinica API Python Interface
Post by: Qoheleth on January 25, 2012, 08:12:45 AM
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


Title: Re: Bitcoinica API Python Interface
Post by: stochastic on January 25, 2012, 08:17:10 AM
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!


Title: Re: Bitcoinica API Python Interface
Post by: take5 on February 03, 2012, 03:08:16 AM
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.  ;D Thanks for posting this!


Title: Re: Bitcoinica API Python Interface
Post by: jc01480 on March 12, 2017, 07:54:57 PM
So how has this been working for everyone?  Haven't gotten the code yet.  Learning python myself and its kind of fun. 


Title: Re: Bitcoinica API Python Interface
Post by: notme on March 12, 2017, 09:24:29 PM
So how has this been working for everyone?  Haven't gotten the code yet.  Learning python myself and its kind of fun. 

Bitcoinica went tits up years ago, so it probably didn't work out well at all.