SuperAI_Forecast / backend /find_any_suffix.py
Thang6822
Update Kronos Platform: New UI, enhanced backend stability and restored Dockerfile
85d632d
Raw
History Blame
1.11 kB
import httpx
import asyncio
import os
import time
import hmac
import hashlib
from dotenv import load_dotenv
load_dotenv()
async def find_any_dot_s():
api_key = os.getenv("BYBIT_API_KEY")
api_secret = os.getenv("BYBIT_API_SECRET")
url = "https://api.bybit.com/v5/market/instruments-info"
params = {"category": "linear", "limit": 1000}
async with httpx.AsyncClient() as client:
resp = await client.get(url, params=params)
data = resp.json()
if data.get("retCode") == 0:
symbols = [item["symbol"] for item in data["result"]["list"]]
dot_s = [s for s in symbols if ".s" in s]
plus = [s for s in symbols if "+" in s]
print(f"Total symbols: {len(symbols)}")
print(f"Symbols with .s: {dot_s}")
print(f"Symbols with +: {plus}")
# Search for XAU specifically
xau = [s for s in symbols if "XAU" in s]
print(f"XAU matches: {xau}")
else:
print(f"Error: {data}")
if __name__ == "__main__":
asyncio.run(find_any_dot_s())