{"id":16060419,"url":"https://github.com/maful/currency-conversion-ruby","last_synced_at":"2025-04-05T08:16:21.816Z","repository":{"id":61272366,"uuid":"548148022","full_name":"maful/currency-conversion-ruby","owner":"maful","description":"Currency Conversion Ruby","archived":false,"fork":false,"pushed_at":"2023-03-15T01:25:16.000Z","size":52,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-04-03T11:21:51.642Z","etag":null,"topics":["api","faraday","hacktoberfest","ruby","rubygems"],"latest_commit_sha":null,"homepage":"","language":"Ruby","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/maful.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":"CODE_OF_CONDUCT.md","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}},"created_at":"2022-10-09T02:11:00.000Z","updated_at":"2022-10-09T10:57:06.000Z","dependencies_parsed_at":"2024-10-22T22:57:43.909Z","dependency_job_id":null,"html_url":"https://github.com/maful/currency-conversion-ruby","commit_stats":{"total_commits":17,"total_committers":1,"mean_commits":17.0,"dds":0.0,"last_synced_commit":"7381ce3612dbeadd28432a7816107dead5951390"},"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/maful%2Fcurrency-conversion-ruby","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/maful%2Fcurrency-conversion-ruby/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/maful%2Fcurrency-conversion-ruby/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/maful%2Fcurrency-conversion-ruby/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/maful","download_url":"https://codeload.github.com/maful/currency-conversion-ruby/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247305946,"owners_count":20917208,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","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":["api","faraday","hacktoberfest","ruby","rubygems"],"created_at":"2024-10-09T04:04:04.584Z","updated_at":"2025-04-05T08:16:21.794Z","avatar_url":"https://github.com/maful.png","language":"Ruby","funding_links":[],"categories":[],"sub_categories":[],"readme":"# CurrencyAPI\n\n[![Test](https://github.com/maful/currency-conversion-ruby/actions/workflows/test.yml/badge.svg?branch=main)](https://github.com/maful/currency-conversion-ruby/actions/workflows/test.yml)\n[![Gem Version](https://badge.fury.io/rb/currency-conversion-api.svg)](https://badge.fury.io/rb/currency-conversion-api)\n\n\u003e [Libur.run](https://github.com/maful/libur.run) - Empower Your HR with Next-Gen Open Source Self-Serve Platform\n\n## Installation\n\nAdd this line to your application's Gemfile:\n\n```ruby\ngem 'currency-conversion-api'\n```\n\nAnd then execute:\n\n    $ bundle install\n\nOr install it yourself as:\n\n    $ gem install currency-conversion-api\n\n## Usage\n\nCreate a new client, grab the API key on [Currency Conversion API](https://currencyapi.com/) website.\n\n[API Documentation](https://rubydoc.info/gems/currency-conversion-api)\n\n```ruby\nclient = CurrencyConversion::Client.new(api_key: ENV['API_KEY'])\n```\n\n## Endpoints\n\n### Status\n\n```ruby\nresponse = client.status.retrieve\n# =\u003e #\u003cCurrencyConversion::Status quotas=#\u003cOpenStruct month=#\u003cOpenStruct total=300, used=1, remaining=299\u003e, grace=#\u003cOpenStruct ...\nquotas = response.quotas\n# =\u003e #\u003cOpenStruct month=#\u003cOpenStruct total=300, used=1, remaining=299\u003e, grace=#\u003cOpenStruct total=0, used=0, remaining=0\u003e\u003e\nquotas.month.total\n# =\u003e 300\n```\n\n### List available currencies\n\n```ruby\nresponse = client.currencies.retrieve\nresponse.data\n# =\u003e\n# {\"AED\"=\u003e\n#   {\"symbol\"=\u003e\"AED\",\n#    \"name\"=\u003e\"United Arab Emirates Dirham\",\n#    \"symbol_native\"=\u003e\"د.إ\",\n#    \"decimal_digits\"=\u003e2,\n#    \"rounding\"=\u003e0,\n#    \"code\"=\u003e\"AED\",\n#    \"name_plural\"=\u003e\"UAE dirhams\"},\n# {...}\n# }\n\n# retrieve specific currencies\nresponse = client.currencies.retrieve(currencies: ['IDR', 'SGD'])\nresponse.data\n# =\u003e\n# {\"IDR\"=\u003e\n#   {\"symbol\"=\u003e\"Rp\",\n#    \"name\"=\u003e\"Indonesian Rupiah\",\n#    \"symbol_native\"=\u003e\"Rp\",\n#    \"decimal_digits\"=\u003e0,\n#    \"rounding\"=\u003e0,\n#    \"code\"=\u003e\"IDR\",\n#    \"name_plural\"=\u003e\"Indonesian rupiahs\"},\n#  \"SGD\"=\u003e\n#   {\"symbol\"=\u003e\"S$\",\n#    \"name\"=\u003e\"Singapore Dollar\",\n#    \"symbol_native\"=\u003e\"$\",\n#    \"decimal_digits\"=\u003e2,\n#    \"rounding\"=\u003e0,\n#    \"code\"=\u003e\"SGD\",\n#    \"name_plural\"=\u003e\"Singapore dollars\"}}\n```\n\n### Exchange Rates\n\n#### Convert Exchange Rates\n\n```ruby\nresponse = client.exchange_rates.convert(value: 10, currencies: %w[IDR EUR], date: Date.new(2022, 10, 11))\nresponse.data\n```\n\n#### Latest Exchange Rates\n\n```ruby\nresponse = client.exchange_rates.latest(base_currency: 'USD', currencies: %w[IDR EUR])\nresponse.body\n# =\u003e {\"meta\"=\u003e{\"last_updated_at\"=\u003e\"2022-10-10T23:59:59Z\"}, \"data\"=\u003e{\"EUR\"=\u003e{\"code\"=\u003e\"EUR\", \"value\"=\u003e1.029906}, \"IDR\"=\u003e{\"code\"=\u003e\"IDR\", \"value\"=\u003e15350.189946}}}\nresponse.meta\n# =\u003e {\"last_updated_at\"=\u003e\"2022-10-10T23:59:59Z\"}\nresponse.last_updated_at\n# =\u003e \"2022-10-10T23:59:59Z\"\n```\n\n#### Historical Exchange Rates\n\n```ruby\nresponse = client.exchange_rates.historical(date: Date.new(2022, 6, 6), currencies: %w[SGD IDR])\nresponse.data\n# =\u003e {\"IDR\"=\u003e{\"code\"=\u003e\"IDR\", \"value\"=\u003e14438.00731}, \"SGD\"=\u003e{\"code\"=\u003e\"SGD\", \"value\"=\u003e1.37705}}\nresponse.last_updated_at\n# =\u003e \"2022-06-06T23:59:59Z\"\n```\n\n## Development\n\nAfter checking out the repo, run `bin/setup` to install dependencies. Then, run `rake spec` to run the tests. You can also run `bin/console` for an interactive prompt that will allow you to experiment.\n\nTo install this gem onto your local machine, run `bundle exec rake install`. To release a new version, update the version number in `version.rb`, and then run `bundle exec rake release`, which will create a git tag for the version, push git commits and the created tag, and push the `.gem` file to [rubygems.org](https://rubygems.org).\n\n## Contributing\n\nBug reports and pull requests are welcome on GitHub at https://github.com/maful/currency-conversion-ruby. This project is intended to be a safe, welcoming space for collaboration, and contributors are expected to adhere to the [code of conduct](https://github.com/maful/currency-conversion-ruby/blob/main/CODE_OF_CONDUCT.md).\n\n## Code of Conduct\n\nEveryone interacting in the Currency::Conversion project's codebases, issue trackers, chat rooms and mailing lists is expected to follow the [code of conduct](https://github.com/maful/currency-conversion-ruby/blob/main/CODE_OF_CONDUCT.md).\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmaful%2Fcurrency-conversion-ruby","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmaful%2Fcurrency-conversion-ruby","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmaful%2Fcurrency-conversion-ruby/lists"}