Project

avantage

0.0
No commit activity in last 3 years
No release in over 3 years
A Ruby client to the Alpha Vantage API https://www.alphavantage.co/documentation/
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
2025
2026
 Dependencies

Development

~> 3.8
 Project Readme

avantage

Gem Version

A Ruby library to query the Alpha Vantage API.

usage

The first step is to instantiate a client:

require 'avantage'

client = Avantage::Client.new('6SAMPLEWO0KLUG55')
  # or more something like
client = Avantage::Client.new(File.read('.api.key').strip)

Functions may be called directly:

require 'pp'

pp client.get(:global_quote, symbol: 'GOOG')
  #
  # ==>
  #
  # {"Global Quote"=>
  #   {"01. symbol"=>"GOOG",
  #    "02. open"=>"1109.6900",
  #    "03. high"=>"1116.3900",
  #    "04. low"=>"1098.9995",
  #    "05. price"=>"1103.6000",
  #    "06. volume"=>"1386684",
  #    "07. latest trading day"=>"2019-06-18",
  #    "08. previous close"=>"1092.5000",
  #    "09. change"=>"11.1000",
  #    "10. change percent"=>"1.0160%"}}

GLOBAL_QUOTE, SYMBOL_SEARCH, CURRENCY_EXCHANGE_RATE, and SECTOR can be called directly:

client.global_quote('GOOG')
client.global_quote(symbol: 'GOOG')
client.global_quote(symbol: 'GOOG', datatype: 'csv')
client.quote('GOOG')
# ...

client.symbol_search(keywords: 'IBM')
client.symbol_search('IBM')
client.search(keywords: 'IBM')
client.search('IBM')
client.search(keywords: 'IBM', datatype: 'csv')
# ...

client.currency_exchange_rate('USD', 'JPY')
client.exchange_rate('USD', 'JPY')
client.exchange_rate(from: 'USD', to: 'JPY')
client.exchange_rate(from_currency: 'USD', to_currency: 'JPY')
client.forex(from: 'USD', to: 'JPY')
client.forex('USD', 'JPY')
client.forex(from: 'USD', to: 'JPY', datatype: 'csv')
# ...

client.sectors
client.sector
client.sectors(datatype: 'csv')
# ...

license

MIT, see LICENSE.txt