Python package to communicate with bitstamp.net API.
Compatible with Python v2, v3.3 and higher.
RRN: be sure to check if the author updates the repo before October 30th due to changes in the API https://bitcointalk.org/index.php?topic=38711.msg3218202#msg3218202
There are two classes. One for public part of API and second for trading part. Public class doesn't need user credentials, because API commands which this class implements are not bound to bitstamp user account.
Description of API: https://www.bitstamp.net/api/
- requests (pip install requests)
sudo pip install git+git://github.com/kmadac/bitstamp-python-client.git
- Login your bitstamp Account.
- Click on Security -> Api Access.
- Select permissions which you want to have for you access key (If you don't check any box, you will get error message 'No permission found' after each API call)
- Click 'Generate key' button and don't forget to write down your Secret!
- Click Activate
- Goto your Inbox and click on link sent by Bitstamp service
- Your account is activated Now and you can use API
import bitstamp.client
bs_client_public = bitstamp.client.public()
ticker = bs_client_public.ticker()
bs_client_trading = bitstamp.client.trading(username='999999', key='xxx', secret='xxx')
account_balance = bs_client_trading.account_balance()
# Dictionary result
{ u'btc_reserved': u'0',
u'fee': u'0.5000',
u'btc_available': u'2.30856098',
u'usd_reserved': u'0',
u'btc_balance': u'2.30856098',
u'usd_balance': u'114.64',
u'usd_available': u'114.64'
}
If this code is usable for you, here is my wallet id where you can contribute to my work with few micro BCs:
This fork is maintained by Bitmymoney to avoid unpleasant surprise updates, if you want to use this code we advise to use the original product instead!