Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

fxapi

Package Overview
Dependencies
Maintainers
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

fxapi

  • 1.0.0
  • Rubygems
  • Socket score

Version published
Maintainers
1
Created
Source

fxapi-ruby

fxapi-ruby is the official Ruby Wrapper around the fxapi.

Installation

Add this line to your application's Gemfile:

gem 'fxapi'

And then execute:

$ bundle

Or install it yourself as:

$ gem install fxapi

Configuration

You will need your apikey to use fxapi, you can get one https://app.fxapi.com/register here.

Create an instance and pass your api key like here:

fx = Fxapi::Endpoints.new(:apikey => 'APIKEY')

Usage & Endpoints

Use the instance to call the endpoints

Status

Returns your current quota

fx.status()
Currencies

Returns all our supported currencies

fx.currencies(currencies)
ParameterData typeMandatoryDescription
currenciesstringnoA list of comma seperated currency codes which you want to get (EUR,USD,CAD). By default all available currencies will be shown
Latest Exchange Rates

Returns the latest exchange rates. The default base currency is USD.

fx.latest(base_currency, currencies)    
ParameterData typeMandatoryDescription
base_currencystringnoBy default all values are based on USD. By default all values are based on USD
currenciesstringnoA list of comma seperated currency codes which you want to get (EUR,USD,CAD). By default all available currencies will be shown
Historical Exchange Rates

Returns the latest exchange rates. The default base currency is USD.

fx.historical(date, base_currency, currencies)    
ParameterData typeMandatoryDescription
datestringyesDate to retrieve historical rates from (format: 2021-12-31)
base_currencystringnoBy default all values are based on USD. By default all values are based on USD
currenciesstringnoA list of comma seperated currency codes which you want to get (EUR,USD,CAD). By default all available currencies will be shown
Range Historical Exchange Rates

Returns a range of exchange rates. Generally, we provide data going back to 1999.

fx.range(datetime_start, datetime_end, accuracy, baseCurrency, currencies)    
ParameterData typeMandatoryDescription
datetime_startstringyesDatetime for the start of your requested range (format: 2021-12-31T23:59:59Z / ISO8601 Datetime)
datetime_endstringyesDatetime for the start of your requested range (format: 2021-12-31T23:59:59Z / ISO8601 Datetime)
accuracystringnoThe accuracy you want to receive. Possible Values: day, hour, quarter_hour, minute Default: day For valid time ranges see below
base_currencystringnoBy default all values are based on USD. By default all values are based on USD
currenciesstringnoA list of comma seperated currency codes which you want to get (EUR,USD,CAD). By default all available currencies will be shown
Convert Exchange Rates

Returns calculated values for today or any given date for all currencies.

fx.convert(value, date, baseCurrency, currencies)
ParameterData typeMandatoryDescription
valuestringyesThe value you want to convert
datestringnoDate to retrieve historical rates from (format: 2021-12-31)
base_currencystringnoBy default all values are based on USD. By default all values are based on USD
currenciesstringnoA list of comma seperated currency codes which you want to get (EUR,USD,CAD). By default all available currencies will be shown

You can find further information on https://fxapi.com/docs/

Contributing

  1. Fork it
  2. Create your feature branch (git checkout -b my-new-feature)
  3. Commit your changes (git commit -am 'Added some feature')
  4. Push to the branch (git push origin my-new-feature)
  5. Create new Pull Request

Bug reports and pull requests are welcome on GitHub at https://github.com/everapihq/fxapi. This project is intended to be a safe, welcoming space for collaboration, and contributors are expected to adhere to the code of conduct.

License

The gem is available as open source under the terms of the MIT License.

Code of Conduct

Everyone interacting in the fxapi project's codebases, issue trackers, chat rooms and mailing lists is expected to follow the code of conduct.

FAQs

Package last updated on 23 May 2023

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc