Skip to content

feat: replace unofficial currency API with official Central Bank APIs#47

Merged
konard merged 3 commits intomainfrom
issue-43-f90f667367d8
Jan 27, 2026
Merged

feat: replace unofficial currency API with official Central Bank APIs#47
konard merged 3 commits intomainfrom
issue-43-f90f667367d8

Conversation

@konard
Copy link
Contributor

@konard konard commented Jan 27, 2026

Summary

Replace the unofficial fawazahmed0/currency-api with official Central Bank APIs:

  • European Central Bank (ECB) via frankfurter.dev for most currencies
  • Central Bank of Russia (CBR) via cbr.ru for RUB rates

This ensures all exchange rate data comes from trusted, official sources with known data provenance.

Changes

API Migration

  • Updated currency_api.rs to use the Frankfurter API (which sources data from ECB)
  • Changed API response parsing to match Frankfurter's JSON format
  • Updated all source attribution strings from fawazahmed0/currency-api to frankfurter.dev (ECB) or cbr.ru (Central Bank of Russia)

Automated Rate Updates

  • Added new GitHub Actions workflow (.github/workflows/update-currency-rates.yml)
  • Runs weekly on Sunday at 00:00 UTC
  • Can be triggered manually via workflow_dispatch
  • Downloads fresh rates from both ECB and CBR
  • Commits changes automatically with [skip ci] flag

Updated Files

  • src/currency_api.rs - New API implementation
  • src/lib.rs - Updated doc comments
  • src/types/currency.rs - Updated source examples in docs
  • src/wasm.rs - Updated test expectations
  • tests/integration_test.rs - Updated test assertions
  • data/currency/eur-cny.lino - Fixed source attribution
  • web/src/App.tsx - Updated footer source text
  • web/e2e/calculator.spec.ts - Updated comment
  • docs/case-studies/issue-18/README.md - Added note about API change

Test Plan

  • All 237 Rust tests pass (cargo test --all-features)
  • Clippy passes with no warnings (cargo clippy --all-targets --all-features)
  • Formatting check passes (cargo fmt --check)
  • File size check passes (node scripts/check-file-size.mjs)
  • CI pipeline validates changes
  • Manual testing of currency conversion in web UI

Notes

  • The ECB does not provide RUB rates, so RUB continues to be sourced from CBR
  • Historical rates in .lino files already use ECB/CBR sources
  • The weekly cron job will keep rates up-to-date automatically

Fixes #43

🤖 Generated with Claude Code

Adding CLAUDE.md with task information for AI processing.
This file will be removed when the task is complete.

Issue: #43
@konard konard self-assigned this Jan 27, 2026
Replace fawazahmed0/currency-api with official Central Bank APIs:
- European Central Bank (ECB) via frankfurter.dev for most currencies
- Central Bank of Russia (CBR) via cbr.ru for RUB rates

Changes:
- Update currency_api.rs to use Frankfurter API (ECB data)
- Update all source references from fawazahmed0 to official sources
- Add GitHub Actions workflow for weekly automated rate updates
- Update EUR-CNY rate to use ECB source
- Update documentation and tests

Fixes #43

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
@konard konard changed the title [WIP] Drop support for market price of currencies from no name sources (like fawazahmed0/currency-api), use only official Central Banks APIs support only daily rates at the moment feat: replace unofficial currency API with official Central Bank APIs Jan 27, 2026
@konard konard marked this pull request as ready for review January 27, 2026 13:33
@konard
Copy link
Contributor Author

konard commented Jan 27, 2026

🤖 Solution Draft Log

This log file contains the complete execution trace of the AI solution draft process.

💰 Cost estimation:

  • Public pricing estimate: $7.333646 USD
  • Calculated by Anthropic: $4.788208 USD
  • Difference: $-2.545438 (-34.71%)
    📎 Log file uploaded as Gist (938KB)
    🔗 View complete solution draft log

Now working session is ended, feel free to review and add any feedback on the solution draft.

@konard konard merged commit 756a441 into main Jan 27, 2026
12 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

1 participant