19 lines
501 B
Python
19 lines
501 B
Python
import requests
|
|
import xmltodict
|
|
|
|
|
|
BASE_URL: str = "https://iss.moex.com/iss"
|
|
|
|
session = requests.Session()
|
|
|
|
|
|
|
|
def bond_sequrities(bond_ticker: str, board: str) -> dict:
|
|
res = requests.get(f"{BASE_URL}/engines/stock/markets/BONDS/boards/{board}/securities.xml?securities={bond_ticker}&iss.meta=off&iss.only=securities")
|
|
|
|
if res.status_code != 200:
|
|
return {"error": True, "status_code": res.status_code}
|
|
|
|
return xmltodict.parse(res.text)["document"]["data"]["rows"]["row"]
|
|
|