Created
August 17, 2024 02:30
-
-
Save brulint/93b26d9cd16110dd2db07574b1f4bb49 to your computer and use it in GitHub Desktop.
Trade wih Blockchain
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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