From fb97449c2aa82c74c2fd29aeccd15498a8351cae Mon Sep 17 00:00:00 2001 From: aglkm <39521015+aglkm@users.noreply.github.com> Date: Wed, 21 Jan 2026 01:43:55 +0300 Subject: [PATCH] Coinecko API adjustments --- src/requests.rs | 4 +++- templates/base.html.tera | 7 +++++++ 2 files changed, 10 insertions(+), 1 deletion(-) diff --git a/src/requests.rs b/src/requests.rs index 3786aa4..325ca1b 100644 --- a/src/requests.rs +++ b/src/requests.rs @@ -202,7 +202,9 @@ pub async fn get_market(dashboard: Arc>) -> Result<(), anyhow:: // Call CG API only once every 20 calls (15sec * 20) if CONFIG.coingecko_api == "enabled" && count % 20 == 0 { client = reqwest::Client::new(); - result = client.get("https://api.coingecko.com/api/v3/simple/price?ids=grin&vs_currencies=usd%2Cbtc&include_24hr_vol=true").send().await?; + result = client.get("https://api.coingecko.com/api/v3/simple/price?ids=grin&vs_currencies=usd%2Cbtc&include_24hr_vol=true") + .header("User-Agent", "https://github.com/aglkm/grin-explorer") + .send().await?; val = serde_json::from_str(&result.text().await?)?; } diff --git a/templates/base.html.tera b/templates/base.html.tera index 93703a0..11ba851 100644 --- a/templates/base.html.tera +++ b/templates/base.html.tera @@ -353,6 +353,13 @@ + {% if cg_api == "enabled" %} +
+
+ Price data by CoinGecko +
+
+ {% endif %}