Skip to content

Instantly share code, notes, and snippets.

@brulint
Created August 17, 2024 02:30
Show Gist options
  • Save brulint/93b26d9cd16110dd2db07574b1f4bb49 to your computer and use it in GitHub Desktop.
Save brulint/93b26d9cd16110dd2db07574b1f4bb49 to your computer and use it in GitHub Desktop.
Trade wih Blockchain
import requests
url = 'https://api.blockchain.com/v3/exchange/'
# Public requests
requests.get(url + 'tickers/BTC-EUR').json()
# Private requests
api_key = 'YOUR API KEY'
order = {'clOrdId':1,'ordType': 'LIMIT', 'symbol': 'BTC-EUR', 'side': 'BUY', 'orderQty': 10, 'price': 100}
requests.post(url + 'orders', json = order, headers = {'X-API-Token': api}).json()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment