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