Currency API

Historical exchange rate ingestion from the free, no-API-key fawazahmed0 Exchange API (@fawazahmed0/currency-api).

This module incrementally scans daily historical exchange rates for a configurable set of named currencies (default: EUR, GBP, JPY, AUD, SGD, HKD, TRY, CHF, CAD, BTC, ETH against USD) and stores them in DuckDB:

  • One HTTP request per date returns the base currency against ~200 fiat and crypto currencies, with a jsDelivr → Cloudflare Pages host fallback

  • Completeness-driven incremental resume (backfills holes and newly added currencies; tracks permanently missing cells)

  • A source column so additional rate sources can be added later behind the same schema

No authentication is required – all data comes from a public endpoint.

For architecture details, the DuckDB schema, environment variables and the incremental scanning model, see README-currency-api.md.

eth_defi.currency_api.scanner

Incremental, gap-aware exchange rate scanner.

eth_defi.currency_api.client

HTTP client for the fawazahmed0 Exchange API.

eth_defi.currency_api.database

DuckDB persistence for historical exchange rates.

eth_defi.currency_api.cleaning

Cleaning step for currency_api exchange rate data.

eth_defi.currency_api.session

HTTP session factory for the fawazahmed0 Exchange API.

eth_defi.currency_api.constants

Constants for the fawazahmed0 Exchange API integration.

eth_defi.currency_api.cli

Command-line entry point for the currency_api exchange rate scanner.