Skip to content

fix: COINGECKO_API_KEY optional — fall back to public CoinGecko#2

Open
zatsch wants to merge 1 commit into
luxfi:mainfrom
zatsch:fix/optional-coingecko-key
Open

fix: COINGECKO_API_KEY optional — fall back to public CoinGecko#2
zatsch wants to merge 1 commit into
luxfi:mainfrom
zatsch:fix/optional-coingecko-key

Conversation

@zatsch
Copy link
Copy Markdown

@zatsch zatsch commented Apr 29, 2026

Summary

The pricing service refused to start without COINGECKO_API_KEY set, and even with an empty key it sent the literal x-cg-demo-api-key: header which CoinGecko rejects with 401 — API Key Missing.

This change makes the key optional — when unset, the binary boots, logs a notice, and the upstream HTTP requests omit the auth header so CoinGecko's bare public API responds (with the public/anonymous rate limit). Suitable for dev/staging deployments where pulling a real key into the cluster isn't worth it.

Test plan

  • Pod starts with COINGECKO_API_KEY unset → no log.Fatal.
  • GET /simple/price?ids=bitcoin&vs_currencies=usd returns real prices via public CoinGecko.
  • When COINGECKO_API_KEY is set, behavior unchanged (header sent, demo URL used).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants