SWIFT Code Lookup API - Ruby Gem
SWIFT Code Lookup is a simple tool for looking up SWIFT code information. It returns information such as the bank, branch, and more based on the SWIFT code provided.
Installation
Add this line to your application's Gemfile:
gem 'apiverve_swiftlookup'
And then execute:
$ bundle install
Or install it yourself as:
$ gem install apiverve_swiftlookup
Getting Started
Get your API key at APIVerve
Basic Usage
require 'apiverve_swiftlookup'
# Initialize the client
client = APIVerve::Swiftlookup::Client.new(api_key: "YOUR_API_KEY")
# Make a request
response = client.execute({ swift: "CHASUS33ARP" })
# Print the response
puts response
Error Handling
begin
response = client.execute({ swift: "CHASUS33ARP" })
puts response["data"]
rescue APIVerve::Swiftlookup::ValidationError => e
puts "Validation error: #{e.errors.join(', ')}"
rescue APIVerve::Swiftlookup::APIError => e
puts "API error: #{e.}"
puts "Status code: #{e.status_code}"
end
Debug Mode
# Enable debug logging
client = APIVerve::Swiftlookup::Client.new(
api_key: "YOUR_API_KEY",
debug: true
)
Example Response
{
"status": "ok",
"error": null,
"data": {
"count": 1,
"banks": [
{
"bank": "JPMORGAN CHASE BANK, N.A.",
"city": "NEW YORK,NY",
"branch": "ACCOUNT RECONCILIATION PROCESSING",
"swift_code": "CHASUS33ARP",
"country": "United States",
"country_code": "US"
}
]
}
}
Documentation
For more information, visit the API Documentation.
Support
- Website: https://apiverve.com/marketplace/swiftlookup?utm_source=ruby&utm_medium=readme
- Email: hello@apiverve.com
License
This gem is available under the MIT License.