{"id":14956014,"url":"https://github.com/codespore/alphavantage_ruby","last_synced_at":"2025-11-11T18:38:30.112Z","repository":{"id":50757288,"uuid":"360924119","full_name":"codespore/alphavantage_ruby","owner":"codespore","description":"Ruby library for the Alpha Vantage API, a leading provider of stock APIs as well as forex (FX) and cryptocurrency data feeds.","archived":false,"fork":false,"pushed_at":"2023-09-29T19:54:46.000Z","size":292,"stargazers_count":14,"open_issues_count":2,"forks_count":9,"subscribers_count":0,"default_branch":"main","last_synced_at":"2025-10-08T18:50:38.504Z","etag":null,"topics":["alphavantage","alphavantage-rest-api","api-rest","ruby","ruby-on-rails"],"latest_commit_sha":null,"homepage":"","language":"Ruby","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/codespore.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.txt","code_of_conduct":"CODE_OF_CONDUCT.md","threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2021-04-23T15:13:18.000Z","updated_at":"2025-09-12T22:59:35.000Z","dependencies_parsed_at":"2024-09-24T13:24:50.882Z","dependency_job_id":null,"html_url":"https://github.com/codespore/alphavantage_ruby","commit_stats":{"total_commits":47,"total_committers":5,"mean_commits":9.4,"dds":"0.21276595744680848","last_synced_commit":"eea765d2bbb8c69f9b42b930c58c210ff38d38e6"},"previous_names":[],"tags_count":3,"template":false,"template_full_name":null,"purl":"pkg:github/codespore/alphavantage_ruby","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/codespore%2Falphavantage_ruby","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/codespore%2Falphavantage_ruby/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/codespore%2Falphavantage_ruby/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/codespore%2Falphavantage_ruby/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/codespore","download_url":"https://codeload.github.com/codespore/alphavantage_ruby/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/codespore%2Falphavantage_ruby/sbom","scorecard":{"id":297762,"data":{"date":"2025-08-11","repo":{"name":"github.com/codespore/alphavantage_ruby","commit":"eea765d2bbb8c69f9b42b930c58c210ff38d38e6"},"scorecard":{"version":"v5.2.1-40-gf6ed084d","commit":"f6ed084d17c9236477efd66e5b258b9d4cc7b389"},"score":3.3,"checks":[{"name":"Code-Review","score":2,"reason":"Found 3/15 approved changesets -- score normalized to 2","details":null,"documentation":{"short":"Determines if the project requires human code review before pull requests (aka merge requests) are merged.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#code-review"}},{"name":"Token-Permissions","score":-1,"reason":"No tokens found","details":null,"documentation":{"short":"Determines if the project's workflows follow the principle of least privilege.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#token-permissions"}},{"name":"Dangerous-Workflow","score":-1,"reason":"no workflows found","details":null,"documentation":{"short":"Determines if the project's GitHub Action workflows avoid dangerous patterns.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#dangerous-workflow"}},{"name":"Packaging","score":-1,"reason":"packaging workflow not detected","details":["Warn: no GitHub/GitLab publishing workflow detected."],"documentation":{"short":"Determines if the project is published as a package that others can easily download, install, easily update, and uninstall.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#packaging"}},{"name":"Maintained","score":0,"reason":"0 commit(s) and 0 issue activity found in the last 90 days -- score normalized to 0","details":null,"documentation":{"short":"Determines if the project is \"actively maintained\".","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#maintained"}},{"name":"Binary-Artifacts","score":10,"reason":"no binaries found in the repo","details":null,"documentation":{"short":"Determines if the project has generated executable (binary) artifacts in the source repository.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#binary-artifacts"}},{"name":"Pinned-Dependencies","score":-1,"reason":"no dependencies found","details":null,"documentation":{"short":"Determines if the project has declared and pinned the dependencies of its build process.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#pinned-dependencies"}},{"name":"CII-Best-Practices","score":0,"reason":"no effort to earn an OpenSSF best practices badge detected","details":null,"documentation":{"short":"Determines if the project has an OpenSSF (formerly CII) Best Practices Badge.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#cii-best-practices"}},{"name":"Security-Policy","score":0,"reason":"security policy file not detected","details":["Warn: no security policy file detected","Warn: no security file to analyze","Warn: no security file to analyze","Warn: no security file to analyze"],"documentation":{"short":"Determines if the project has published a security policy.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#security-policy"}},{"name":"Vulnerabilities","score":10,"reason":"0 existing vulnerabilities detected","details":null,"documentation":{"short":"Determines if the project has open, known unfixed vulnerabilities.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#vulnerabilities"}},{"name":"Fuzzing","score":0,"reason":"project is not fuzzed","details":["Warn: no fuzzer integrations found"],"documentation":{"short":"Determines if the project uses fuzzing.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#fuzzing"}},{"name":"License","score":10,"reason":"license file detected","details":["Info: project has a license file: LICENSE.txt:0","Info: FSF or OSI recognized license: MIT License: LICENSE.txt:0"],"documentation":{"short":"Determines if the project has defined a license.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#license"}},{"name":"Signed-Releases","score":-1,"reason":"no releases found","details":null,"documentation":{"short":"Determines if the project cryptographically signs release artifacts.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#signed-releases"}},{"name":"Branch-Protection","score":0,"reason":"branch protection not enabled on development/release branches","details":["Warn: branch protection not enabled for branch 'main'"],"documentation":{"short":"Determines if the default and release branches are protected with GitHub's branch protection settings.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#branch-protection"}},{"name":"SAST","score":0,"reason":"SAST tool is not run on all commits -- score normalized to 0","details":["Warn: 0 commits out of 19 are checked with a SAST tool"],"documentation":{"short":"Determines if the project uses static code analysis.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#sast"}}]},"last_synced_at":"2025-08-17T19:57:26.222Z","repository_id":50757288,"created_at":"2025-08-17T19:57:26.222Z","updated_at":"2025-08-17T19:57:26.222Z"},"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":283668038,"owners_count":26874159,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-11-10T02:00:06.292Z","response_time":53,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["alphavantage","alphavantage-rest-api","api-rest","ruby","ruby-on-rails"],"created_at":"2024-09-24T13:12:10.932Z","updated_at":"2025-11-11T18:38:30.093Z","avatar_url":"https://github.com/codespore.png","language":"Ruby","readme":"[![Gem Version](https://badge.fury.io/rb/alphavantage.svg)](https://badge.fury.io/rb/alphavantage)\n# Alpha Vantage Ruby Library\n\nThe Alpha Vantage Ruby library provides convenient access to the [Alpha Vantage API](https://www.alphavantage.co/documentation/) from applications written in the Ruby language.\n\n## Installation\n\nAdd this line to your application's Gemfile:\n\n```ruby\ngem 'alphavantage'\n```\n\nAnd then execute:\n\n    $ bundle\n\nOr install it yourself as:\n\n    $ gem install alphavantage\n\n## Usage\n\nThe library needs to be configured with your account's api key which you can obtain from https://www.alphavantage.co/support/#api-key.\nSet the `Alphavantage.configuration.api_key` to its value. If you are using Rails, you can configure this in an initializer.\n\n```ruby\nrequire 'alphavantage'\n\nAlphavantage.configure do |config|\n  config.api_key = 'your-api-key'\nend\n```\n\n### Accessing a response object\nAll JSON responses are converted to pseudo-objects that have method-like accessors for hash keys\n```ruby\nquote = Alphavantage::TimeSeries.new(symbol: 'TSLA').quote\nquote.previous_close #=\u003e \"719.6900\"\nquote.volume         #=\u003e \"27879033\"\n```\n\nAll hash keys are also normalized to provide clean and consistent access to values since the Alphavantage API returns arbitrarily formatted keys with numbers, spaces, letters and symbols (i.e. \"Crypto Rating (FCAS)\", \"3. fcas rating\", \"4. Last Refreshed\", \"Time Series FX (5min)\", \"1a. open (CNY)\")\n\nWith this normalization, you can now access via\n\n`intraday.time_series_fx_5min`\n\ninstead of\n\n`intraday[\"Time Series FX (5min)\"]`\n\n### Stock Time Series\n\n```ruby\nAlphavantage::TimeSeries.search(keywords: 'Tesla')\n\nstock_timeseries = Alphavantage::TimeSeries.new(symbol: 'TSLA')\nstock_timeseries.quote\nstock_timeseries.monthly\nstock_timeseries.monthly(adjusted: true)\nstock_timeseries.weekly\nstock_timeseries.weekly(adjusted: true)\nstock_timeseries.daily(outputsize: 'compact')\nstock_timeseries.daily(adjusted: true, outputsize: 'full')\nstock_timeseries.intraday(adjusted: true, outputsize: 'compact', interval: '5min')\nstock_timeseries.intraday_extended_history(adjusted: true, outputsize: 'compact', interval: '5min', slice: 'year1month1')\n```\n### Fundamental Data\n```ruby\ncompany = Alphavantage::Fundamental.new(symbol: 'TSLA')\ncompany.overview\ncompany.earnings\ncompany.income_statement\ncompany.balance_sheet\ncompany.cash_flow\n```\n### Forex\n```ruby\nforex = Alphavantage::Forex.new(from_symbol: 'USD', to_symbol: 'JPY')\nforex.exchange_rates\nforex.intraday(interval: '5min', outputsize: 'compact')\nforex.daily(outputsize: 'compact')\nforex.weekly\nforex.monthly\n```\n### Crypto Currencies\n```ruby\nAlphavantage::Crypto.health_index(symbol: 'BTC')\n\ncrypto = Alphavantage::Crypto.new(symbol: 'BTC', market: 'USD')\ncrypto.intraday(interval: '5min')\ncrypto.daily\ncrypto.weekly\ncrypto.monthly\n```\n\n### Technical Indicators\nYou can access all available indicators by simply using the actual technical indicator name listed on the [Alpha Vantage Documenetation](https://www.alphavantage.co/documentation/#technical-indicators) as the method name (i.e. `.stoch`, `.rsi`, `.plus_dm`, `.ht_trendline`, etc.).\n\nYou can also dig into [alphavantage/indicator.rb](https://github.com/codespore/alphavantage_ruby/blob/main/lib/alphavantage/indicator.rb) to view the list of available indicators.\n\n```ruby\nindicator = Alphavantage::Indicator.new(symbol: 'TSLA', interval: '5min')\nindicator.sma(time_period: 7, series_type: 'close')\nindicator.macd(series_type: 'open', fastperiod: 12, slowperiod: 26, signalperiod: 9)\n\nindicator.macdext(\n  series_type:,\n  fastperiod: 12,\n  slowperiod: 26,\n  signalperiod: 9,\n  fastmatype: 'sma',\n  slowmatype: 'sma',\n  signalmatype: 'sma'\n)\n```\n\nMoving average indicator as parameters have been mapped to allow you to simply provide the actual indicator name rather than the number value specified in the Alpha Vantage Documentation. Below is the mapping available that I've used in the above `.macdext` example for the `fastmatype`, `slowmatype` and `signalmatype` parameters\n\n```ruby\nMOVING_AVERAGE_TYPES = {\n  sma: 0,\n  ema: 1,\n  wma: 2,\n  dema: 3,\n  tema: 4,\n  trima: 5,\n  t3: 6,\n  kama: 7,\n  mama: 8\n}\n```\n\nValidations are also implemented to ensure correct values are provided for the various parameters. You can view a list of the validations in [alphavantage/validations.rb](https://github.com/codespore/alphavantage_ruby/blob/main/lib/alphavantage/validations.rb)\n\n### Other Functions\n\nTo get functions not implemented in the gem you can use the `Alphavantage::Client` class:\n\nIf you want to get the news sentiments:\n\n```ruby\nAlphavantage::Client.new(function: 'NEWS_SENTIMENT').json\n```\n\nIf you want to get the list of all listed US stocks and ETFs (Only supports CSV):\n\n```ruby\nAlphavantage::Client.new(function: 'LISTING_STATUS').csv\n```\n\n## Development\n\nAfter checking out the repo, run `bin/setup` to install dependencies. Then, run `rake spec` to run the tests. You can also run `bin/console` for an interactive prompt that will allow you to experiment.\n\nTo install this gem onto your local machine, run `bundle exec rake install`. To release a new version, update the version number in `version.rb`, and then run `bundle exec rake release`, which will create a git tag for the version, push git commits and tags, and push the `.gem` file to [rubygems.org](https://rubygems.org).\n\n## Contributing\n\nBug reports and pull requests are welcome on GitHub at https://github.com/codespore/alphavantage_ruby. This project is intended to be a safe, welcoming space for collaboration, and contributors are expected to adhere to the [Contributor Covenant](http://contributor-covenant.org) code of conduct.\n\n## License\n\nThe gem is available as open source under the terms of the [MIT License](https://opensource.org/licenses/MIT).\n\n## Code of Conduct\n\nEveryone interacting in the Alphavantage project’s codebases, issue trackers, chat rooms and mailing lists is expected to follow the [code of conduct](https://github.com/codespore/alphavantage_ruby/blob/master/CODE_OF_CONDUCT.md).\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcodespore%2Falphavantage_ruby","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fcodespore%2Falphavantage_ruby","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcodespore%2Falphavantage_ruby/lists"}