0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

OIを取得してみた(自分用備忘録)

Posted at

単なる備忘録なので詳細は省きます。

python openInterest/sample.py
import requests

api_key = 'my api'
symbols = 'BTCUSDT_PERP.A,BTCUSD_PERP.0'
url = 'actual endpoint'

params = {
    'symbols': symbols,
    'api_key': api_key
}

response = requests.get(url, params=params)

if response.status_code == 200:
    data = response.json()
    print("Open Interest Data:", data)
else:
    print(f"Failed to retrieve data. Status code: {response.status_code}, Message: {response.text}")

結果

Open Interest Data: [{'symbol': 'BTCUSD_PERP.0', 'value': 236370700, 'update': 1707826545124}, {'symbol': 'BTCUSDT_PERP.A', 'value': 92707.774, 'update': 1707826547840}]
0
0
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
0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?