Meteorite Landings API - Ruby Gem
Meteorites is a simple tool for getting meteorite data. It returns a list of meteorites that have fallen to Earth.
Installation
Add this line to your application's Gemfile:
gem 'apiverve_meteorites'
And then execute:
$ bundle install
Or install it yourself as:
$ gem install apiverve_meteorites
Getting Started
Get your API key at APIVerve
Basic Usage
require 'apiverve_meteorites'
# Initialize the client
client = APIVerve::Meteorites::Client.new(api_key: "YOUR_API_KEY")
# Make a request
response = client.execute({
name: "Allende",
mass: 100,
year: 1969
})
# Print the response
puts response
Error Handling
begin
response = client.execute({ name: "Allende", mass: 100, year: 1969 })
puts response["data"]
rescue APIVerve::Meteorites::ValidationError => e
puts "Validation error: #{e.errors.join(', ')}"
rescue APIVerve::Meteorites::APIError => e
puts "API error: #{e.}"
puts "Status code: #{e.status_code}"
end
Debug Mode
# Enable debug logging
client = APIVerve::Meteorites::Client.new(
api_key: "YOUR_API_KEY",
debug: true
)
Example Response
{
"status": "ok",
"error": null,
"data": {
"count": 1,
"filteredOn": [
"name"
],
"meteors": [
{
"name": "Allende",
"recclass": "CV3",
"mass": "2000000",
"year": "1969",
"geolocation": {
"type": "Point",
"coordinates": [
-105.31667,
26.96667
]
}
}
]
}
}
Documentation
For more information, visit the API Documentation.
Support
- Website: https://apiverve.com/marketplace/meteorites?utm_source=ruby&utm_medium=readme
- Email: hello@apiverve.com
License
This gem is available under the MIT License.