Spaces:
Sleeping
Sleeping
| from fastapi import FastAPI | |
| import requests | |
| app = FastAPI() | |
| def greet_json(): | |
| return {"Hello": "World!"} | |
| def get_kline(symbol : str): | |
| res = requests.get("https://api.binance.com/dapi/v1/klines?symbol="+symbol) | |
| if res.status_code == 200: | |
| return res.json() | |
| return {"error":res.text} | |