Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Official Ruby SDK for OpenExchangeAPI — easy access to FX rates and currency info in Ruby scripts, Rails, and CLI tools.

License

Notifications You must be signed in to change notification settings

OpenExchangeAPI/sdk-ruby

Folders and files

NameName
Last commit message
Last commit date

Latest commit

History

2 Commits

Repository files navigation

OpenExchangeAPI Ruby SDK

Minimal, idiomatic Ruby client for OpenExchangeAPI

  • All endpoints supported
  • API key is optional
  • Returns hashes for all responses

Installation

Add open_exchange_api_client.rb to your project, or use Bundler:

gem 'open_exchange_api_client', git: 'https://github.com/OpenExchangeAPI/sdk-ruby'

Usage

require_relative 'open_exchange_api_client'
client = OpenExchangeApiClient.new('YOUR_API_KEY') # API key optional
latest = client.get_latest('EUR')
puts latest['rates']['USD']
precise = client.get_latest_precise('EUR')
puts precise['rates']['USD']

API Reference

  • get_latest(base = nil)
  • get_latest_precise(base = nil)
  • get_historical(date, base = nil)
  • get_historical_precise(date, base = nil)
  • convert(from, to, amount)
  • convert_precise(from, to, amount)
  • list_currencies(type = nil)
  • get_currency(code)

All methods raise on error.

License

MIT

About

Official Ruby SDK for OpenExchangeAPI — easy access to FX rates and currency info in Ruby scripts, Rails, and CLI tools.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

AltStyle によって変換されたページ (->オリジナル) /