MAC Address Lookup API - Ruby Gem
MAC Address Lookup is a simple tool for looking up MAC address data. It returns the MAC address vendor, conversions, and more.
Installation
Add this line to your application's Gemfile:
gem 'apiverve_macaddresslookup'
And then execute:
$ bundle install
Or install it yourself as:
$ gem install apiverve_macaddresslookup
Getting Started
Get your API key at APIVerve
Basic Usage
require 'apiverve_macaddresslookup'
# Initialize the client
client = APIVerve::Macaddresslookup::Client.new(api_key: "YOUR_API_KEY")
# Make a request
response = client.execute({ mac: "00-B0-D0-63-C2-26" })
# Print the response
puts response
Error Handling
begin
response = client.execute({ mac: "00-B0-D0-63-C2-26" })
puts response["data"]
rescue APIVerve::Macaddresslookup::ValidationError => e
puts "Validation error: #{e.errors.join(', ')}"
rescue APIVerve::Macaddresslookup::APIError => e
puts "API error: #{e.}"
puts "Status code: #{e.status_code}"
end
Debug Mode
# Enable debug logging
client = APIVerve::Macaddresslookup::Client.new(
api_key: "YOUR_API_KEY",
debug: true
)
Example Response
{
"status": "ok",
"error": null,
"data": {
"mac": "00:B0:D0:63:C2:26",
"isValid": true,
"vendor": "Dell Inc.",
"oui": "00B0D0",
"formats": {
"colon": "00:B0:D0:63:C2:26",
"dash": "00-B0-D0-63-C2-26",
"dot": "00.B0.D0.63.C2.26",
"raw": "00B0D063C226"
}
}
}
Documentation
For more information, visit the API Documentation.
Support
- Website: https://apiverve.com/marketplace/macaddresslookup?utm_source=ruby&utm_medium=readme
- Email: hello@apiverve.com
License
This gem is available under the MIT License.