LoginSignup
1
1

More than 5 years have passed since last update.

PythonでbitFlyer/Zaif/coincheck/からビットコインの価格を取ってくる方法

Posted at

PythonでbitFlyer/Zaif/coincheck/からビットコインの価格を取ってくる方法

import requests

#bitFlyerからビットコインの価格を取得する
r = requests.get('https://api.bitflyer.jp/v1/ticker?product_code=BTC_JPY')
json = r.json()
print('bitFlyer  btc_jpy: ' + str(json["ltp"]))

# Zaifからビットコインの価格を取得する
r = requests.get('https://api.zaif.jp/api/1/ticker/btc_jpy')
json = r.json()
print('Zaif      btc_jpy: ' + str(json["last"]))

# coincheckからビットコインの価格を取得する
r = requests.get('https://coincheck.com/api/ticker')
json = r.json()
print('coincheck btc_jpy: ' + str(json["last"]))
1
1
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
1
1