Port Number Lookup API - Ruby Gem
Port Number Lookup is a tool for looking up well-known port numbers and network services. It provides information about ports including service name, protocol, description, and category for common network services.
Installation
Add this line to your application's Gemfile:
gem 'apiverve_portnumberlookup'
And then execute:
$ bundle install
Or install it yourself as:
$ gem install apiverve_portnumberlookup
Getting Started
Get your API key at APIVerve
Basic Usage
require 'apiverve_portnumberlookup'
# Initialize the client
client = APIVerve::Portnumberlookup::Client.new(api_key: "YOUR_API_KEY")
# Make a request
response = client.execute({ port: 443 })
# Print the response
puts response
Error Handling
begin
response = client.execute({ port: 443 })
puts response["data"]
rescue APIVerve::Portnumberlookup::ValidationError => e
puts "Validation error: #{e.errors.join(', ')}"
rescue APIVerve::Portnumberlookup::APIError => e
puts "API error: #{e.}"
puts "Status code: #{e.status_code}"
end
Debug Mode
# Enable debug logging
client = APIVerve::Portnumberlookup::Client.new(
api_key: "YOUR_API_KEY",
debug: true
)
Example Response
{
"status": "ok",
"error": null,
"data": {
"port": 443,
"service": "HTTPS",
"protocol": "TCP",
"description": "HTTP Secure (HTTP over TLS/SSL)",
"category": "Web",
"is_well_known": true,
"is_registered": false,
"is_dynamic": false
}
}
Documentation
For more information, visit the API Documentation.
Support
- Website: https://apiverve.com/marketplace/portnumberlookup?utm_source=ruby&utm_medium=readme
- Email: hello@apiverve.com
License
This gem is available under the MIT License.