Weather Seasons API - Ruby Gem

Weather Seasons is a simple tool for getting the dates of the solstice and equinox. It returns the dates of the solstice and equinox for a given year.

Installation

Add this line to your application's Gemfile:

gem 'apiverve_weatherseasons'

And then execute:

$ bundle install

Or install it yourself as:

$ gem install apiverve_weatherseasons

Getting Started

Get your API key at APIVerve

Basic Usage

require 'apiverve_weatherseasons'

# Initialize the client
client = APIVerve::Weatherseasons::Client.new(api_key: "YOUR_API_KEY")

# Make a request
response = client.execute({ year: 2025 })

# Print the response
puts response

Error Handling

begin
  response = client.execute({ year: 2025 })
  puts response["data"]
rescue APIVerve::Weatherseasons::ValidationError => e
  puts "Validation error: #{e.errors.join(', ')}"
rescue APIVerve::Weatherseasons::APIError => e
  puts "API error: #{e.message}"
  puts "Status code: #{e.status_code}"
end

Debug Mode

# Enable debug logging
client = APIVerve::Weatherseasons::Client.new(
  api_key: "YOUR_API_KEY",
  debug: true
)

Example Response

{
  "status": "ok",
  "error": null,
  "data": {
    "year": 2024,
    "timezone": "UTC",
    "march_equinox": "2024-03-20 03:06:24",
    "june_solstice": "2024-06-20 20:50:58",
    "september_equinox": "2024-09-22 12:43:55",
    "december_solstice": "2024-12-21 09:20:18"
  }
}

Documentation

For more information, visit the API Documentation.

Support

License

This gem is available under the MIT License.