Python package to communicate with bitstamp.net API.
Compatible with Python v2, v3.3 and higher.
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'
}