Stock Market Open Times API - Ruby Gem

Stock Market Open Times is a simple tool for getting the open times of the stock market. It returns the open times of the stock market for each day of the week.

Installation

Add this line to your application's Gemfile:

gem 'apiverve_stockmarketopentimes'

And then execute:

$ bundle install

Or install it yourself as:

$ gem install apiverve_stockmarketopentimes

Getting Started

Get your API key at APIVerve

Basic Usage

require 'apiverve_stockmarketopentimes'

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

# Make a request
response = client.execute({ exchange: "NYSE" })

# Print the response
puts response

Error Handling

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

Debug Mode

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

Example Response

{
  "status": "ok",
  "error": null,
  "data": {
    "timezone": "America/New_York",
    "exchange": "NYSE",
    "fullName": "New York Stock Exchange",
    "isOpen": false,
    "openingTime": "2025-12-16 09:30:00",
    "closingTime": "2025-12-16 16:00:00"
  }
}

Documentation

For more information, visit the API Documentation.

Support

License

This gem is available under the MIT License.