import requests


def get_nobitex_usdt_irl_rate():
    url = 'https://api.nobitex.ir/market/stats?srcCurrency=btc,usdt&dstCurrency=rls,usdt'
    json_resp = requests.get(url).json()
    if json_resp.get('status') == 'ok':
        return json_resp
    else:
        return {}

def get_currencyapi_euro_usdt_rate():
    # https://currencyapi.com/
    url = 'https://api.currencyapi.com/v3/latest?base_currency=EUR&currencies=USDT'
    json_resp = requests.get(url, headers={'apikey': 'cur_live_vYkYNA7iP5r94hvevZ1uBZ8lYRPdrV0HprxqzJ0d'}).json()
    if json_resp.get('data'):
        return json_resp.get('data')
    else:
        return {}