Benchmark Rate API - Ruby Gem
Benchmark Rate is a tool for retrieving current risk-free reference rates that replaced LIBOR. It returns rates for SOFR (US), SONIA (UK), ESTR (EU), TONA (Japan), and SARON (Switzerland).
Installation
Add this line to your application's Gemfile:
gem 'apiverve_benchmarkrate'
And then execute:
$ bundle install
Or install it yourself as:
$ gem install apiverve_benchmarkrate
Getting Started
Get your API key at APIVerve
Basic Usage
require 'apiverve_benchmarkrate'
# Initialize the client
client = APIVerve::Benchmarkrate::Client.new(api_key: "YOUR_API_KEY")
# Make a request
response = client.execute({ rate: "SOFR" })
# Print the response
puts response
Error Handling
begin
response = client.execute({ rate: "SOFR" })
puts response["data"]
rescue APIVerve::Benchmarkrate::ValidationError => e
puts "Validation error: #{e.errors.join(', ')}"
rescue APIVerve::Benchmarkrate::APIError => e
puts "API error: #{e.}"
puts "Status code: #{e.status_code}"
end
Debug Mode
# Enable debug logging
client = APIVerve::Benchmarkrate::Client.new(
api_key: "YOUR_API_KEY",
debug: true
)
Example Response
{
"status": "ok",
"error": null,
"data": {
"rate": "SOFR",
"name": "Secured Overnight Financing Rate",
"currency": "USD",
"region": "United States",
"administrator": "Federal Reserve Bank of New York",
"value": 4.32,
"date": "2026-02-04",
"lastUpdated": "2026-02-05T05:00:00.000Z",
"change1d": -0.01,
"changeDirection": "down",
"previousValue": 4.33,
"previousDate": "2026-02-03"
}
}
Documentation
For more information, visit the API Documentation.
Support
- Website: https://benchmarkrate.apiverve.com?utm_source=ruby&utm_medium=readme
- Email: hello@apiverve.com
License
This gem is available under the MIT License.