mirror of
https://github.com/OpenBB-finance/OpenBB.git
synced 2026-10-30 05:52:23 +00:00
fix coindix api call error (#1786)
* fix coindix api call error * black formatter apply
This commit is contained in:
@@ -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}")
|
||||
|
||||
|
||||
Reference in New Issue
Block a user