From 82d9be5fb369283c01dd21bb3fcbd24893c667f6 Mon Sep 17 00:00:00 2001 From: "Minha, Jeong" <60059706+PzaThief@users.noreply.github.com> Date: Mon, 9 May 2022 08:36:45 +0900 Subject: [PATCH] fix coindix api call error (#1786) * fix coindix api call error * black formatter apply --- openbb_terminal/cryptocurrency/defi/coindix_model.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/openbb_terminal/cryptocurrency/defi/coindix_model.py b/openbb_terminal/cryptocurrency/defi/coindix_model.py index 92e798cb1ff..360a0cc76a7 100644 --- a/openbb_terminal/cryptocurrency/defi/coindix_model.py +++ b/openbb_terminal/cryptocurrency/defi/coindix_model.py @@ -8,6 +8,7 @@ import pandas as pd import requests from openbb_terminal.decorators import log_start_end +from openbb_terminal.helper_funcs import get_user_agent logger = logging.getLogger(__name__) @@ -142,8 +143,11 @@ def get_defi_vaults( Top 100 DeFi Vaults for given chain/protocol sorted by APY. """ + headers = {"User-Agent": get_user_agent()} params = _prepare_params(chain=chain, protocol=protocol, kind=kind) - response = requests.get("https://apiv2.coindix.com/search", params=params) + response = requests.get( + "https://apiv2.coindix.com/search", headers=headers, params=params, verify=False + ) if not 200 <= response.status_code < 300: raise Exception(f"Coindix api exception: {response.text}")