From 5e401c06aed30a6d7755b2614a8225aad6f0b9b7 Mon Sep 17 00:00:00 2001 From: Steven Polley Date: Mon, 9 Sep 2024 17:47:17 -0600 Subject: [PATCH] switch to free api --- providers/bitcoin/fiat.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/providers/bitcoin/fiat.go b/providers/bitcoin/fiat.go index a8c970e..44442b4 100644 --- a/providers/bitcoin/fiat.go +++ b/providers/bitcoin/fiat.go @@ -5,7 +5,7 @@ import ( "net/http" ) -const fiatConvertURL = "https://pro-api.coingecko.com/api/v3/coins/bitcoin?localization=false&tickers=false&market_data=true&community_data=false&developer_data=false&sparkline=false" +const fiatConvertURL = "https://api.coingecko.com/api/v3/coins/bitcoin?localization=false&tickers=false&market_data=true&community_data=false&developer_data=false&sparkline=false" type coinGeckoResponse struct { MarketData struct { @@ -18,7 +18,7 @@ type coinGeckoResponse struct { func (c *client) convertBTCToCAD(amount int) (int, error) { coinGeckoData := &coinGeckoResponse{} - req, err := http.NewRequest("GET", fmt.Sprintf("%s&x_cg_pro_api_key=%s", fiatConvertURL, c.coinGeckoApiKey), nil) + req, err := http.NewRequest("GET", fmt.Sprintf("%s&x-cg-demo-api-key=%s", fiatConvertURL, c.coinGeckoApiKey), nil) if err != nil { return 0, fmt.Errorf("failed to create new GET request: %v", err) }