Airline Lookup API - Ruby Gem
Airline Lookup is a simple tool for getting information on airlines. It returns information on various airlines.
Installation
Add this line to your application's Gemfile:
gem 'apiverve_airlinelookup'
And then execute:
$ bundle install
Or install it yourself as:
$ gem install apiverve_airlinelookup
Getting Started
Get your API key at APIVerve
Basic Usage
require 'apiverve_airlinelookup'
# Initialize the client
client = APIVerve::Airlinelookup::Client.new(api_key: "YOUR_API_KEY")
# Make a request
response = client.execute({ iata: "AA" })
# Print the response
puts response
Error Handling
begin
response = client.execute({ iata: "AA" })
puts response["data"]
rescue APIVerve::Airlinelookup::ValidationError => e
puts "Validation error: #{e.errors.join(', ')}"
rescue APIVerve::Airlinelookup::APIError => e
puts "API error: #{e.}"
puts "Status code: #{e.status_code}"
end
Debug Mode
# Enable debug logging
client = APIVerve::Airlinelookup::Client.new(
api_key: "YOUR_API_KEY",
debug: true
)
Example Response
{
"status": "ok",
"error": null,
"data": [
{
"name": "American Airlines",
"alias": null,
"iata": "AA",
"icao": "AAL",
"callsign": "AMERICAN",
"country": "United States",
"id": "AA",
"islowcost": false,
"logourl": "https://storage.googleapis.com/apiverve/APIResources/arlinelookup/logos/AA.png?X-Goog-Algorithm=..."
}
]
}
Documentation
For more information, visit the API Documentation.
Support
- Website: https://airlinelookup.apiverve.com?utm_source=ruby&utm_medium=readme
- Email: hello@apiverve.com
License
This gem is available under the MIT License.