Skip to content

Official Java SDK for OpenExchangeAPI — access global currency data and perform conversions in JVM-based applications.

License

Notifications You must be signed in to change notification settings

OpenExchangeAPI/sdk-java

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

OpenExchangeAPI Java SDK

Minimal, idiomatic Java client for OpenExchangeAPI

  • All endpoints supported
  • API key is optional
  • Strong types and precise decimal support

Installation

Add to your Maven/Gradle project, or copy OpenExchangeApiClient.java into your codebase.

Usage

import com.openexchangeapi.OpenExchangeApiClient;

OpenExchangeApiClient client = new OpenExchangeApiClient("YOUR_API_KEY"); // API key optional

// Get latest rates
var latest = client.getLatest();

// Convert currency
var result = client.convert("USD", "EUR", 100);

// List currencies
var currencies = client.listCurrencies();

// Get currency details
var eur = client.getCurrency("EUR");

API Reference

  • getLatest(base)
  • getLatestPrecise(base)
  • getHistorical(date, base)
  • getHistoricalPrecise(date, base)
  • convert(from, to, amount)
  • convertPrecise(from, to, amount)
  • listCurrencies(type)
  • getCurrency(code)

All methods throw OpenExchangeApiException on error.

Error Handling

try {
    var data = client.getLatest();
} catch (OpenExchangeApiException e) {
    // Handle error
}

License

MIT

About

Official Java SDK for OpenExchangeAPI — access global currency data and perform conversions in JVM-based applications.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages