openapi_iplocation
OpenApiIplocationClient - the Ruby gem for the iplocation.net API
OpenAPI v3 specification and a set of generated API clients for iplocation.net
This SDK is automatically generated by the OpenAPI Generator project:
- API version: 1.1.0
- Package version: 1.1.0
- Generator version: 7.9.0
- Build package: org.openapitools.codegen.languages.RubyClientCodegen For more information, please visit https://github.com/oapicf/openapi-iplocation
Installation
Build a gem
To build the Ruby code into a gem:
gem build openapi_iplocation.gemspec
Then either install the gem locally:
gem install ./openapi_iplocation-1.1.0.gem
(for development, run gem install --dev ./openapi_iplocation-1.1.0.gem
to install the development dependencies)
or publish the gem to a gem hosting service, e.g. RubyGems.
Finally add this to the Gemfile:
gem 'openapi_iplocation', '~> 1.1.0'
Install from Git
If the Ruby gem is hosted at a git repository: https://github.com/GIT_USER_ID/GIT_REPO_ID, then add the following in the Gemfile:
gem 'openapi_iplocation', :git => 'https://github.com/GIT_USER_ID/GIT_REPO_ID.git'
Include the Ruby code directly
Include the Ruby code directly using -I
as follows:
ruby -Ilib script.rb
Getting Started
Please follow the installation procedure and then run the following code:
# Load the gem
require 'openapi_iplocation'
api_instance = OpenApiIplocationClient::DefaultApi.new
ip = 'ip_example' # String | An IPv4 or IPv6 address that you would like to lookup.
opts = {
format: 'format_example', # String | Output format, the following formats are supported: plain xml json jsonp php csv serialized
delimiter: 'delimiter_example' # String | Delimiter between proxies. Can be used only with format plain. The following types are supported: 1 for \"\\n\", 2 for \"<br>\".
}
begin
#Get geolocation of an IP address
result = api_instance.root_get(ip, opts)
p result
rescue OpenApiIplocationClient::ApiError => e
puts "Exception when calling DefaultApi->root_get: #{e}"
end
Documentation for API Endpoints
All URIs are relative to https://api.iplocation.net
Class | Method | HTTP request | Description |
---|---|---|---|
OpenApiIplocationClient::DefaultApi | root_get | GET / | Get geolocation of an IP address |
Documentation for Models
Documentation for Authorization
Endpoints do not require authorization.