{"id":29418452,"url":"https://github.com/ethauvin/frankfurter4j","last_synced_at":"2026-06-30T15:31:52.782Z","repository":{"id":301940241,"uuid":"987297696","full_name":"ethauvin/frankfurter4j","owner":"ethauvin","description":"Retrieve Reference Exchange Rates","archived":false,"fork":false,"pushed_at":"2026-05-28T00:03:28.000Z","size":658,"stargazers_count":3,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2026-05-28T00:22:24.260Z","etag":null,"topics":["currency","currency-api","currency-converter","currency-data","currency-exchange","currency-exchange-rates","exchange","exchange-rates","frankfurter","money","rates"],"latest_commit_sha":null,"homepage":"","language":"Java","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"bsd-3-clause","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/ethauvin.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE.txt","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2025-05-20T21:47:04.000Z","updated_at":"2026-05-28T00:03:32.000Z","dependencies_parsed_at":"2025-07-27T23:20:00.796Z","dependency_job_id":"0ba47678-6dea-42df-8cbf-1f5f914615a3","html_url":"https://github.com/ethauvin/frankfurter4j","commit_stats":null,"previous_names":["ethauvin/frankfurter4j"],"tags_count":2,"template":false,"template_full_name":null,"purl":"pkg:github/ethauvin/frankfurter4j","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ethauvin%2Ffrankfurter4j","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ethauvin%2Ffrankfurter4j/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ethauvin%2Ffrankfurter4j/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ethauvin%2Ffrankfurter4j/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/ethauvin","download_url":"https://codeload.github.com/ethauvin/frankfurter4j/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ethauvin%2Ffrankfurter4j/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":34973610,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-26T15:22:16.424Z","status":"online","status_checked_at":"2026-06-30T02:00:05.919Z","response_time":92,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["currency","currency-api","currency-converter","currency-data","currency-exchange","currency-exchange-rates","exchange","exchange-rates","frankfurter","money","rates"],"created_at":"2025-07-11T23:06:32.607Z","updated_at":"2026-06-30T15:31:52.773Z","avatar_url":"https://github.com/ethauvin.png","language":"Java","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Frankfurter for Java: Retrieve Reference Exchange Rates\n\n[![License (3-Clause BSD)](https://img.shields.io/badge/license-BSD%203--Clause-blue.svg?style=flat-square)](http://opensource.org/licenses/BSD-3-Clause)\n[![Java](https://img.shields.io/badge/java-17%2B-blue)](https://www.oracle.com/java/technologies/javase/jdk17-archive-downloads.html)\n[![bld](https://img.shields.io/badge/2.3.0-FA9052?label=bld\u0026labelColor=2392FF)](https://rife2.com/bld)\n[![release](https://img.shields.io/github/release/ethauvin/frankfurter4j.svg?color=blue)](https://github.com/ethauvin/frankfurter4j/releases/latest)\n[![Maven Central](https://img.shields.io/maven-central/v/net.thauvin.erik/frankfurter4j.svg?color=blue)](https://central.sonatype.com/artifact/net.thauvin.erik/frankfurter4j)\n[![Maven metadata URL](https://img.shields.io/maven-metadata/v?metadataUrl=https%3A%2F%2Fcentral.sonatype.com%2Frepository%2Fmaven-snapshots%2Fnet%2Fthauvin%2Ferik%2Ffrankfurter4j%2Fmaven-metadata.xml\u0026label=snapshot)](https://github.com/ethauvin/frankfurter4j/packages/2561141/versions)\n\n[![Known Vulnerabilities](https://snyk.io/test/github/ethauvin/frankfurter4j/badge.svg?targetFile=pom.xml)](https://snyk.io/test/github/ethauvin/frankfurter4j?targetFile=pom.xml)\n[![Quality Gate Status](https://sonarcloud.io/api/project_badges/measure?project=ethauvin_frankfurter4j\u0026metric=alert_status)](https://sonarcloud.io/summary/new_code?id=ethauvin_frankfurter4j)\n[![GitHub CI](https://github.com/ethauvin/frankfurter4j/actions/workflows/bld.yml/badge.svg)](https://github.com/ethauvin/frankfurter4j/actions/workflows/bld.yml)\n[![CircleCI](https://circleci.com/gh/ethauvin/frankfurter4j/tree/main.svg?style=shield)](https://circleci.com/gh/ethauvin/frankfurter4j/tree/main)\n\nRetrieve reference exchange rates from\n[Frankfurter.dev](https://frankfurter.dev/), a free, open-source currency data\nAPI (v2)\n\n## Examples (TL;DR)\n\n```java\nvar client = new Frankfurter();\n\nvar latestRates = client.getRates();\nif (latestRates instanceof ExchangeRates latest) {\n    var pound = latest.find(\"GBP\");\n    pound.ifPresent(rate -\u003e\n        System.out.println(\"1 GBP: \" + rate.exchangeRate() + \" EUR\"));\n}\n\nvar rate = client.getRate(\"USD\", \"EUR\");\nif (rate instanceof Rate dollar) {\n    System.out.println(\"1 USD: \" + dollar.exchangeRate() + \" EUR\");\n}\n```\n\nTo get the latest exchange rates for the British Pound and\nUnited States Dollar in Euro.\n\n## bld\n\nTo use with [bld](https://rife2.com/bld), include the following dependency\nin your build file:\n\n```java\nrepositories = List.of(MAVEN_CENTRAL, CENTRAL_SNAPSHOTS);\n\nscope(compile)\n    .include(dependency(\"net.thauvin.erik:frankfurter4j:1.0.0-SNAPSHOT\"));\n```\n\n## Gradle, Maven, etc\n\nTo use with [Gradle](https://gradle.org/), include the following dependency\nin your build file:\n\n```gradle\nrepositories {\n    maven {\n        name = 'Central Portal Snapshots'\n        url = 'https://central.sonatype.com/repository/maven-snapshots/'\n    }\n    mavenCentral()\n}\n\ndependencies {\n    implementation(\"net.thauvin.erik:frankfurter4j:1.0.0-SNAPSHOT\")\n}\n```\n\nInstructions for using with Maven, Ivy, etc. can be found\non [Maven Central](https://central.sonatype.com/artifact/net.thauvin.erik/frankfurter4j).\n\n## Latest Rates\n\nFetch the latest exchange rates.\n\n```java\nvar client = new Frankfurter();\nvar latestRates = client.getRates();\n```\n\nThe latest exchange rates are stored in the\n[ExchangeRates](https://ethauvin.github.io/frankfurter4j/net/thauvin/erik/frankfurter/models/ExchangeRates.html)\nclass.\n\nFind a specific rate.\n\n```java\nif (latestRates instanceof ExchangeRates rates) {\n   var gbp = rates.find(\"GBP\").orElse(null);\n}\n```\n\nThe rate is stored in the [Rate](https://ethauvin.github.io/frankfurter4j/net/thauvin/erik/frankfurter/models/Rate.html)\nclass.\n\nChange the base currency with base. Filter target currencies with quotes.\n\n```java\nvar client = new Frankfurter();\nvar latestResult = client.getRates(\n        new RatesConfig.Builder()\n                .base(\"USD\")\n                .quotes(\"EUR\", \"GBP\")\n                .build()\n    );\n```\n\n## Historical Rates\n\nLook up rates for a specific date.\n\n```java\nvar client = new Frankfurter();\nvar historicalRates = client.getRates(\n        new RatesConfig.Builder()\n                .date(LocalDate.parse(\"1999-01-04\"))\n                .build()\n        );\n```\n\n**Note**: As mentioned on the website, Frankfurter stores dates in UTC.\nIf you use a different time zone, be aware that you may be querying\nwith a different calendar date than intended. Also, data returned\nfor today is not stable and will update if new rates are published.\n\n## Time Series Data\n\nFetch rates over a period with from and to.\n\n```java\nvar client = new Frankfurter();\nvar timeSeries = client.getRates(\n        new RatesConfig.Builder()\n                .from(LocalDate.parse(\"2024-01-01\"))\n                .to(LocalDate.parse(\"2024-01-10\"))\n                .build()\n        );\n\n```\n\n## Grouping\n\nDownsample a time series with group.\n\n```java\nvar client = new Frankfurter();\nvar group = client.getRates(\n        new RatesConfig.Builder()\n                .from(LocalDate.of(2024, 1, 1))\n                .group(Group.MONTH)\n                .build()\n        );\n```\n\n## Filter by Provider\n\nScope to specific providers with providers.\n\n```java\nvar client = new Frankfurter();\nvar filtered = client.getRates(\n            new RatesConfig.Builder()\n                    .providers(\"ECB\", \"BAM\")\n                    .build()\n    );\n\n```\n\n## Rate\n\nGet the rate for a single currency pair.\n\n```java\nvar client = new Frankfurter();\nvar rate = client.getRate(\"USD\", \"EUR\");\n```\n\nOptionally add date or providers.\n\n```java\nvar rate = client.getRate(\n        new RateConfig.Builder()\n        .base(\"USD\")\n        .quote(\"EUR\")\n        .date(LocalDate.of(2026, 1, 1))\n        .build()\n    );\n```\n\n## Currency\n\nGet details and provider coverage for a single currency.\n\n```java\nvar client = new Frankfurter();\nvar currency = client.getCurrency(\"EUR\");\n\nif (currency instanceof Currency eur) {\n    var name = eur.name();\n}\n```\n\n## Providers\n\nList the data sources behind the API.\n\n```java\nvar client = new Frankfurter();\nvar providers = client.getProviders();\n\nif (providers instanceof Providers p) {\n        var ecb = p.find(\"ECB\");\n}\n\n```\n\n## Currencies\n\nGet available currencies with provider coverage.\n\n```java\nvar client = new Frankfurter();\nvar currencies = client.getCurrencies();\n\nif (currencies instanceof Currencies c) {\n        var usd = c.find(\"USD\");\n}\n```\n\n## Currency Format\n\nFormat amounts to specific local currencies.\n\n```java\nvar rate = client.getRate(\"USD\", \"GBP\");\n\nif (rate instanceof Rate r) {\n    var amount = 12;\n    var usd = CurrencyFormatter.format(amount, \"USD\");\n    var gbp = CurrencyFormatter.format(r.exchangeRate() * amount, \"GBP\");\n    System.out.println(usd + \": \" + gbp); // e.g. $12.00: £9.00468\n}\n```\n\n## Error\n\nThe API returns standard HTTP status codes with an error message.\n\n```java\nvar rate = client.getRate(\"FOO\", \"BAR\");\n\nif (rate instanceof ErrorResponse error) {\n    // 422: invalid currency: FOO,BAR\n    System.out.println(error.status() + \": \" + error.message());\n}\n```\n\n## Contributing\n\nSee [CONTRIBUTING.md](https://github.com/ethauvin/frankfurter4j?tab=contributing-ov-file#readme) for information about\ncontributing to this project.\n\n## More…\n\nIf all else fails, there's always more\n[Documentation](https://ethauvin.github.io/frankfurter4j/).\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fethauvin%2Ffrankfurter4j","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fethauvin%2Ffrankfurter4j","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fethauvin%2Ffrankfurter4j/lists"}