LocationIQClient - the Ruby gem for the LocationIQ
LocationIQ provides flexible enterprise-grade location based solutions. We work with developers, startups and enterprises worldwide serving billions of requests everyday. This page provides an overview of the technical aspects of our API and will help you get started.
This SDK is automatically generated by the OpenAPI Generator project:
- API version: 1.0.0
- Package version: 1.0.0
- Build package: org.openapitools.codegen.languages.RubyClientCodegen
To build the Ruby code into a gem:
gem build locationiq-ruby-client.gemspecThen either install the gem locally:
gem install ./locationiq-ruby-client-1.0.0.gem(for development, run gem install --dev ./locationiq-ruby-client-1.0.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 'locationiq-ruby-client', '~> 1.0.0' If the Ruby gem is hosted at a git repository: https://github.com/location-iq/locationiq-ruby-client, then add the following in the Gemfile:
gem 'locationiq-ruby-client', :git => 'https://github.com/location-iq/locationiq-ruby-client.git' Include the Ruby code directly using -I as follows:
ruby -Ilib script.rbPlease follow the installation procedure and then run the following code:
# Load the gem require 'locationiq-ruby-client' # Setup authorization LocationIQClient.configure do |config| # Configure API key authorization: key config.api_key['key'] = 'YOUR API KEY' # Uncomment the following line to set a prefix for the API key, e.g. 'Bearer' (defaults to nil) #config.api_key_prefix['key'] = 'Bearer' end api_instance = LocationIQClient::BalanceApi.new begin result = api_instance.balance p result rescue LocationIQClient::ApiError => e puts "Exception when calling BalanceApi->balance: #{e}" endAll URIs are relative to https://eu1.locationiq.com/v1
| Class | Method | HTTP request | Description |
|---|---|---|---|
| LocationIQClient::BalanceApi | balance | GET /balance.php | |
| LocationIQClient::ReverseApi | reverse | GET /reverse.php | Reverse Geocoding |
| LocationIQClient::SearchApi | search | GET /search.php | Forward Geocoding |
- LocationIQClient::Address
- LocationIQClient::Balance
- LocationIQClient::Daybalance
- LocationIQClient::Error
- LocationIQClient::Location
- LocationIQClient::Namedetails
- Type: API key
- API key parameter name: key
- Location: URL query string