Кривой API запрос python
функция дает кривой запрос. код взят из библиотеки csgo_market_api Вопрос: Как "склеить" ссылку
class CSGOMarket:
***https://market.csgo.com/docs-v2***
def __init__(self, api_key: str, timeout: int = 15):
self.params = {'key': api_key}
self.timeout = timeout
self.url = 'https://market.csgo.com/api/v2/'
def history(self, date_start: Union[str, int], date_end: Union[str, int] = None):
api_url = self.url + 'history'
api_params = dict(self.params)
api_params.update({'date': date_start})
if date_end:
api_params.update({'date_end': date_end})
return api_url, api_params, self.timeout
когда вызываю функцию history - она отвечает
('https://market.csgo.com/api/v2/history', {'key': '9Z8n5cUPCG5e50h754G91Hyq0xChRvR', 'date': '01-01-2022'}, 15)
Есть и похожая функция, но она дает нормальную ссылку.
def buy(self, hash_name: str, price: Union[str, int], custom_id: Union[str, int] = None):
api_url = self.url + 'buy'
api_params = dict(self.params)
api_params.update({'hash_name': hash_name, 'price': price})
if custom_id:
api_params.update({'custom_id': custom_id})
return api_url, api_params, self.timeout
ps. Если не сложно дайте ссылки на хорошие статьи про API \ websocket