{"id":15484875,"url":"https://github.com/dblock/iex-ruby-client","last_synced_at":"2025-04-04T17:06:37.086Z","repository":{"id":41297234,"uuid":"126503738","full_name":"dblock/iex-ruby-client","owner":"dblock","description":"IEX Finance API Ruby Client","archived":false,"fork":false,"pushed_at":"2023-09-17T09:33:33.000Z","size":1380,"stargazers_count":119,"open_issues_count":10,"forks_count":60,"subscribers_count":11,"default_branch":"master","last_synced_at":"2024-10-08T23:10:50.373Z","etag":null,"topics":["google-finance-api","iex-api","iextrading","yahoo-finance-api"],"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/dblock.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":"CONTRIBUTING.md","funding":".github/FUNDING.yml","license":"LICENSE.md","code_of_conduct":null,"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},"funding":{"github":["dblock"]}},"created_at":"2018-03-23T15:23:27.000Z","updated_at":"2024-07-29T16:32:33.000Z","dependencies_parsed_at":"2024-06-18T20:13:08.212Z","dependency_job_id":"01183ced-76f9-4ff6-b46c-a36349154bac","html_url":"https://github.com/dblock/iex-ruby-client","commit_stats":{"total_commits":144,"total_committers":25,"mean_commits":5.76,"dds":0.6597222222222222,"last_synced_commit":"70985a77ae69d2818a2b262c39d7e50257ce2749"},"previous_names":[],"tags_count":23,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dblock%2Fiex-ruby-client","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dblock%2Fiex-ruby-client/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dblock%2Fiex-ruby-client/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dblock%2Fiex-ruby-client/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/dblock","download_url":"https://codeload.github.com/dblock/iex-ruby-client/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247217175,"owners_count":20903009,"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","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":["google-finance-api","iex-api","iextrading","yahoo-finance-api"],"created_at":"2024-10-02T05:53:23.620Z","updated_at":"2025-04-04T17:06:37.056Z","avatar_url":"https://github.com/dblock.png","language":"Ruby","funding_links":["https://github.com/sponsors/dblock"],"categories":[],"sub_categories":[],"readme":"# IEX Finance API\n\n[![Gem Version](https://badge.fury.io/rb/iex-ruby-client.svg)](https://badge.fury.io/rb/iex-ruby-client)\n[![Build Status](https://github.com/dblock/iex-ruby-client/actions/workflows/test.yml/badge.svg?branch=master)](https://github.com/dblock/iex-ruby-client/actions/workflows/test.yml)\n\nA Ruby client for the [The IEX Cloud API](https://iexcloud.io/docs/api/).\n\n# Table of Contents\n\n- [Installation](#installation)\n- [Usage](#usage)\n  - [Get an API Token](#get-an-api-token)\n  - [Configure](#configure)\n  - [Get a Single Price](#get-a-single-price)\n  - [Get a Quote](#get-a-quote)\n  - [Get a OHLC (Open, High, Low, Close) price](#get-a-ohlc-open-high-low-close-price)\n  - [Get a Market OHLC (Open, High, Low, Close) prices](#get-a-market-ohlc-open-high-low-close-prices)\n  - [Get Historical Prices](#get-historical-prices)\n  - [Get Company Information](#get-company-information)\n  - [Get a Company Logo](#get-a-company-logo)\n  - [Get Recent News](#get-recent-news)\n  - [Get Chart](#get-chart)\n  - [Get Key Stats](#get-key-stats)\n  - [Get Advanced Stats](#get-advanced-stats)\n  - [Get Dividends](#get-dividends)\n  - [Get Earnings](#get-earnings)\n  - [Get Income Statement](#get-income-statement)\n  - [Get Balance Sheet](#get-balance-sheet)\n  - [Get Cash Flow Statement](#get-cash-flow-statement)\n  - [Get Sector Performance](#get-sector-performance)\n  - [Get Largest Trades](#get-largest-trades)\n  - [Get a Quote for Crypto Currencies](#get-a-quote-for-crypto-currencies)\n  - [ISIN Mapping](#isin-mapping)\n  - [Get Symbols](#get-symbols)\n  - [Get Symbols for an Exchange](#get-symbols-for-an-exchange)\n  - [Get Symbols for a Region](#get-symbols-for-a-region)\n  - [Get Latest Foreign Exchange Rates](#get-latest-foreign-exchange-rates)\n  - [Get List](#get-list)\n  - [Other Requests](#other-requests)\n- [Configuration](#configuration)\n  - [Logging](#logging)\n- [Sandbox Environment](#sandbox-environment)\n- [Errors](#errors)\n  - [SymbolNotFound](#symbolnotfound)\n  - [PermissionDeniedError](#permissiondeniederror)\n  - [ClientError](#clienterror)\n- [Contributing](#contributing)\n- [Copyright and License](#copyright-and-license)\n\n## Installation\n\nAdd to Gemfile.\n\n```\ngem 'iex-ruby-client'\n```\n\nRun `bundle install`.\n\n## Usage\n\n### Get an API Token\n\nCreate an account on [IEX Cloud](https://iexcloud.io) and get a publishable token from the IEX cloud console.\n\n### Configure\n\n```ruby\nIEX::Api.configure do |config|\n  config.publishable_token = 'publishable_token' # defaults to ENV['IEX_API_PUBLISHABLE_TOKEN']\n  config.secret_token = 'secret_token' # defaults to ENV['IEX_API_SECRET_TOKEN']\n  config.endpoint = 'https://cloud.iexapis.com/v1' # use 'https://sandbox.iexapis.com/v1' for Sandbox\nend\n```\n\nYou can also configure an instance of a client directly.\n\n```ruby\nclient = IEX::Api::Client.new(\n  publishable_token: 'publishable_token',\n  secret_token: 'secret_token',\n  endpoint: 'https://cloud.iexapis.com/v1'\n)\n```\n\n### Get a Single Price\n\nFetches a single number, being the IEX real time price, the 15 minute delayed market price, or the previous close price.\n\n```ruby\nclient.price('MSFT') # 93.78\n```\n\nSee [#price](https://iexcloud.io/docs/api/#price) for detailed documentation.\n\n### Get a Quote\n\nFetches a single stock quote.\n\n```ruby\nquote = client.quote('MSFT')\n\nquote.latest_price # 90.165\nquote.change # 0.375\nquote.change_percent # 0.00418\nquote.change_percent_s # '+0.42%'\n```\n\nSee [#quote](https://iexcloud.io/docs/api/#quote) for detailed documentation or [quote.rb](lib/iex/resources/quote.rb) for returned fields.\n\n### Get a OHLC (Open, High, Low, Close) price\n\nFetches a single stock OHLC price. Open and Close prices contain timestamp.\n\n```ruby\nohlc = client.ohlc('MSFT')\n\nohlc.close.price # 90.165\nohlc.close.time #\nohlc.open.price # 0.375\nohlc.open.time\nohlc.high # 0.00418\nohlc.low # '+0.42%'\n```\n\n### Get a Market OHLC (Open, High, Low, Close) prices\n\nFetches a hash market OHLC prices.\n\n```ruby\nmarket = client.market\nmarket['SPY'].close.price # 278.56\nmarket['SPY'].close.time # 2018-06-11 23:00:00 +0300\nmarket['SPY'].open.price # 279.05\nmarket['SPY'].open.time # 2018-06-12 16:30:00 +0300\nmarket['SPY'].high #\nmarket['SPY'].low #\n```\n\n### Get Historical Prices\n\nFetches a list of historical prices.\n\nThere are currently a few limitations of this endpoint compared to the official IEX one.\n\nOptions for `range` include:\n`max, ytd, 5y, 2y, 1y, 6m, 3m, 1m, 5d, date`\n\nNOTE: If you use the `date` value for the `range` parameter:\n\n- The options _must_ include a date entry, `{date: ...}`\n- The date value _must_ be either a Date object, or a string formatted as `YYYYMMDD`. Anything else will result in an `IEX::Errors::ClientError`.\n- The options _must_ include `chartByDay: 'true'` or an `ArgumentError` will be raised.\n- See below for examples.\n\n`Query params` supported include:\n`chartByDay`\n\nThis is a complicated endpoint as there is a lot of granularity over the time period of data returned. See below for a variety of ways to request data, NOTE: this is _NOT_ as exhaustive list.\n\n```ruby\nhistorical_prices = client.historical_prices('MSFT') # One month of data\nhistorical_prices = client.historical_prices('MSFT', {range: 'max'}) # All data up to 15 years\nhistorical_prices = client.historical_prices('MSFT', {range: 'ytd'}) # Year to date data\nhistorical_prices = client.historical_prices('MSFT', {range: '5y'}) # 5 years of data\nhistorical_prices = client.historical_prices('MSFT', {range: '6m'}) # 6 months of data\nhistorical_prices = client.historical_prices('MSFT', {range: '5d'}) # 5 days of data\nhistorical_prices = client.historical_prices('MSFT', {range: 'date', date: '20200930', chartByDay: 'true'}) # One day of data\nhistorical_prices = client.historical_prices('MSFT', {range: 'date', date: Date.parse('2020-09-30'), chartByDay: 'true'}) # One day of data\n...\n```\n\nOnce you have the data over the preferred time period, you can access the following fields\n\n```ruby\nhistorical_prices = client.historical_prices('MSFT') # One month of data\n\nhistorical_price = historical_prices.first\nhistorical_price.date # 2020-10-07\nhistorical_price.open #207.06\nhistorical_price.open_dollar # '$207.06'\nhistorical_price.close # 209.83\nhistorical_price.close_dollar # '$209.83'\nhistorical_price.high # 210.11\nhistorical_price.high_dollar # '$210.11'\nhistorical_price.low # 206.72\nhistorical_price.low_dollar # '$206.72'\nhistorical_price.volume # 25681054\n...\n```\n\nThere are a lot of options here so I would recommend viewing the official IEX documentation [#historical-prices](https://iexcloud.io/docs/api/#historical-prices) or [historical_prices.rb](lib/iex/resources/historical_prices.rb) for returned fields.\n\n### Get Company Information\n\nFetches company information for a symbol.\n\n```ruby\ncompany = client.company('MSFT')\n\ncompany.ceo # 'Satya Nadella'\ncompany.company_name # 'Microsoft Corporation'\n```\n\nSee [#company](https://iexcloud.io/docs/api/#company) for detailed documentation or [company.rb](lib/iex/resources/company.rb) for returned fields.\n\n### Get a Company Logo\n\nFetches company logo for a symbol.\n\n```ruby\nlogo = client.logo('MSFT')\n\nlogo.url # 'https://storage.googleapis.com/iex/api/logos/MSFT.png'\n```\n\nSee [#logo](https://iexcloud.io/docs/api/#logo) for detailed documentation or [logo.rb](lib/iex/resources/logo.rb) for returned fields.\n\n### Get Recent News\n\nFetches news for a symbol.\n\n```ruby\nnews = client.news('MSFT')\n\nnews.size # 10\n\nlatest = news.first\nlatest.headline # 'Smartsheet files for $100M IPO with growing losses'\nlatest.url # 'https://...'\n```\n\nRetrieve a range between 1 and 50.\n\n```ruby\nnews = client.news('MSFT', 5)\n```\n\nSee [#news](https://iexcloud.io/docs/api/#news) for detailed documentation or [news.rb](lib/iex/resources/news.rb) for returned fields.\n\n### Get Chart\n\nFetches charts for a symbol.\n\n```ruby\nchart = client.chart('MSFT')\n\nchart.size # 38510\n\nfirst = chart.first\nfirst.label # '9:30 AM'\nfirst.high # 94.97\n```\n\nYou can specify a chart range and additional options.\n\n```ruby\nclient.chart('MSFT', 'dynamic') # 1d or 1m data depending on the day or week and time of day\nclient.chart('MSFT', Date.new(2018, 3, 26)) # a specific date\nclient.chart('MSFT', '1d', chart_interval: 10) # every n-th data point\n```\n\nNote that calling the chart API weighs more than 1 IEX message (you pay more than 1 call).\n\n```\n# 1 message per minute capped at 50 messages to intraday_prices\nclient.chart('MSFT', '1d')\n\n# 2x22 trading days = 44 messages to historical_close_prices\nclient.chart('MSFT', '1m', chart_close_only: true)\n\n# 2x251 trading days = 502 messages to historical_close_prices\nclient.chart('MSFT', '1y', chart_close_only: true)\n```\n\n### Get Key Stats\n\nFetches company's key stats for a symbol.\n\n```ruby\nkey_stats = client.key_stats('MSFT')\n\nkey_stats.week_52_change_dollar # \"$0.37\"\nkey_stats.week_52_high # 136.04\nkey_stats.week_52_high_dollar # \"$136.04\"\nkey_stats.week_52_low # 95.92,\nkey_stats.week_52_low_dollar # \"$95.92\"\nkey_stats.market_cap # 990869169557\nkey_stats.market_cap_dollar # \"$990,869,169,557\"\nkey_stats.employees # 133074\nkey_stats.day_200_moving_avg # 112.43\nkey_stats.day_50_moving_avg # 121\nkey_stats.float # 7694414092\nkey_stats.avg_10_volume # 25160156.2\nkey_stats.avg_30_volume # 23123700.13\nkey_stats.ttm_eps # 4.66\nkey_stats.ttm_dividend_rate # 1.8\nkey_stats.company_name # \"Microsoft Corp.\"\nkey_stats.shares_outstanding # 7849945172\nkey_stats.max_change_percent # 4.355607\nkey_stats.year_5_change_percent # 2.32987\nkey_stats.year_5_change_percent_s # \"+232.99%\"\nkey_stats.year_2_change_percent # 0.84983\nkey_stats.year_2_change_percent_s # \"+84.98%\"\nkey_stats.year_1_change_percent # 0.383503\nkey_stats.year_1_change_percent_s # \"+38.35%\"\nkey_stats.ytd_change_percent # 0.270151\nkey_stats.ytd_change_percent_s # \"+27.02%\"\nkey_stats.month_6_change_percent # 0.208977\nkey_stats.month_6_change_percent_s # \"+20.90%\"\nkey_stats.month_3_change_percent # 0.212188\nkey_stats.month_3_change_percent_s # \"+21.22%\"\nkey_stats.month_1_change_percent # 0.076335\nkey_stats.month_1_change_percent_s # \"+7.63%\"\nkey_stats.day_30_change_percent # 0.089589\nkey_stats.day_30_change_percent_s # \"+8.96%\"\nkey_stats.day_5_change_percent # -0.010013\nkey_stats.day_5_change_percent_s # \"-1.00%\"\nkey_stats.next_dividend_date # \"2019-05-21\"\nkey_stats.dividend_yield # 0.014087248841960684\nkey_stats.next_earnings_date # \"2019-07-29\"\nkey_stats.ex_dividend_date # \"2019-05-24\"\nkey_stats.pe_ratio # 29.47\nkey_stats.beta # 1.4135449089973444\n```\n\nYou can also fetch a single stat for a symbol. **Note** that IEX uses `lowerCamelCase` for the names of the stats.\n\n```ruby\nclient.key_stat('VTI', 'dividendYield') # 0.01271760965303361\n```\n\nSee [#key-stats](https://iexcloud.io/docs/api/#key-stats) for detailed documentation or [key_stats.rb](lib/iex/resources/key_stats.rb) for returned fields.\n\n### Get Advanced Stats\n\nFetches company's advanced stats for a symbol, this will include all key stats as well.\n\n```ruby\nadvanced_stats = client.advanced_stats('MSFT')\n\nadvanced_stats.total_cash # 66301000000\nadvanced_stats.total_cash_dollars # \"$66,301,000,000\"\nadvanced_stats.current_debt # 20748000000\nadvanced_stats.current_debt_dollars # \"$2,074,8000,000\"\nadvanced_stats.revenue # 265809000000\nadvanced_stats.revenue_dollars # \"$265,809,000,000\"\nadvanced_stats.gross_profit # 101983000000\nadvanced_stats.gross_profit_dollar # \"$101,983,000,000\"\nadvanced_stats.total_revenue # 265809000000\nadvanced_stats.total_revenue_dollar # \"$265,809,000,000\"\nadvanced_stats.ebitda # 80342000000\nadvanced_stats.ebitda_dollar # \"$80,342,000,000\"\nadvanced_stats.revenue_per_share # 0.02\nadvanced_stats.revenue_per_share_dollar # \"$0.02\"\nadvanced_stats.revenue_per_employee # 2013704.55\nadvanced_stats.revenue_per_employee_dollar # \"$2,013,704.55\"\nadvanced_stats.debt_to_equity # 1.07\nadvanced_stats.profit_margin # 22.396157\nadvanced_stats.enterprise_value # 1022460690000\nadvanced_stats.enterprise_value_dollar # \"$1,022,460,690,000\"\nadvanced_stats.enterprise_value_to_revenue # 3.85\nadvanced_stats.price_to_sales # 3.49\nadvanced_stats.price_to_sales_dollar # \"$3.49\"\nadvanced_stats.price_to_book # 8.805916432564608\nadvanced_stats.forward_pe_ratio # 18.14\nadvanced_stats.pe_high # 22.61\nadvanced_stats.pe_low # 11.98\nadvanced_stats.peg_ratio # 2.19\nadvanced_stats.week_52_high_date # \"2019-11-19\"\nadvanced_stats.week_52_low_date # \"2019-01-03\nadvanced_stats.beta # 1.4661365583766115\nadvanced_stats.put_call_ratio # 0.6780362005229779\n...\n```\n\nSee [#advanced-stats](https://iexcloud.io/docs/api/#advanced-stats) for detailed documentation or [advanced_stats.rb](lib/iex/resources/advanced_stats.rb) for returned fields.\n\n### Get Dividends\n\nFetches dividends for a symbol.\n\n```ruby\ndividends = client.dividends('MSFT', '6m') # Options are: 5y, 2y, 1y, ytd, 6m, 3m, 1m\n\ndividends.payment_date # '2018-03-08'\ndividends.record_date # '2018-02-15'\ndividends.declared_date # '2017-11-29'\ndividends.amount # 0.42\n```\n\nSee [#dividends](https://iexcloud.io/docs/api/#dividends) for detailed documentation or [dividends.rb](lib/iex/resources/dividends.rb) for returned fields.\n\n### Get Earnings\n\nFetches earnings for a symbol.\n\n```ruby\nearnings = client.earnings('MSFT')\n\nearnings.actual_eps # 1.13\nearnings.consensus_eps # 1.07\nearnings.announce_time # 'AMC'\nearnings.number_of_estimates # 14\nearnings.eps_surprise_dollar # 0.06\nearnings.eps_report_date # '2018-07-19'\nearnings.fiscal_period # 'Q4 2018'\nearnings.fiscal_end_date # '2018-06-30'\nearnings.year_ago # 0.98\nearnings.year_ago_change_percent # 0.15306122448979584\nearnings.year_ago_change_percent_s # '+15.31%'\n```\n\nSee [#earnings](https://iexcloud.io/docs/api/#earnings) for detailed documentation or [earnings.rb](lib/iex/resources/earnings.rb) for returned fields.\n\n### Get Income Statement\n\nFetches income statements for a symbol.\n\n```ruby\nincome_statements = client.income('MSFT')\n\n# Multiple income statements are returned with 1 API call.\nincome = income_statements.first\nincome.report_date # '2019-03-31'\nincome.fiscal_date # '2019-03-31'\nincome.currency # 'USD'\nincome.total_revenue # 30_505_000_000\nincome.total_revenue_dollar # '$30,505,000,000'\nincome.cost_of_revenue # 10_170_000_000\nincome.cost_of_revenue_dollar # '$10,170,000,000'\nincome.gross_profit # 20_335_000_000\nincome.gross_profit_dollar # '$20,335,000,000'\n...\n```\n\nSee [#income-statement](https://iexcloud.io/docs/api/#income-statement) for detailed documentation or [income.rb](lib/iex/resources/income.rb) for returned fields.\n\n### Get Balance Sheet\n\nFetches balance sheets for a symbol.\n\n```ruby\nbalance_sheets = client.balance_sheet('MSFT')\n\n# Multiple balance sheets are returned with 1 API call.\nbalance_sheet = balance_sheets.first\nbalance_sheet.report_date # '2017-03-31'\nbalance_sheet.fiscal_date # '2017-03-31'\nbalance_sheet.currency # 'USD'\nbalance_sheet.current_cash # 25_913_000_000\nbalance_sheet.current_cash_dollar # '$25,913,000,000'\nbalance_sheet.short_term_investments # 40_388_000_000\nbalance_sheet.short_term_investments_dollar # '$40,388,000,000'\n...\n```\n\nSee [#balance-sheet](https://iexcloud.io/docs/api/#balance-sheet) for detailed documentation or [balance_sheet.rb](lib/iex/resources/balance_sheet.rb) for returned fields.\n\n### Get Cash Flow Statement\n\nFetches cash flow statements for a symbol.\n\n```ruby\ncash_flow_statements = client.cash_flow('MSFT')\n\n# Multiple cash flow statements are returned with 1 API call.\ncash_flow = cash_flow_statements.first\ncash_flow.report_date # '2018-09-30'\ncash_flow.fiscal_date # '2018-09-30'\ncash_flow.currency # 'USD'\ncash_flow.net_income # 14_125_000_000\ncash_flow.net_income_dollar # '$14,125,000,000'\ncash_flow.depreciation # 2_754_000_000\ncash_flow.depreciation_dollar # '$2,754,000,000'\n...\n```\n\nSee [#cash-flow](https://iexcloud.io/docs/api/#cash-flow) for detailed documentation or [cash_flow.rb](lib/iex/resources/cash_flow.rb) for returned fields.\n\n### Get Sector Performance\n\nFetches latest sector's performance.\n\n```ruby\nsectors = client.sectors('MARKET')\n\nsectors.type # sectors\nsectors.name # Industrials\nsectors.performance # 0.00711\nsectors.last_updated # 1533672000437\n```\n\nSee [#sector-performance](https://iexcloud.io/docs/api/#sector-performance) for detailed documentation or [sectors.rb](lib/iex/resources/sectors.rb) for returned fields.\n\n### Get Largest Trades\n\nFetches largest trades in the day for a specific stock. Ordered by largest trade on the top.\n\n```ruby\ntrades = client.largest_trades('aapl')\n\ntrades.first.price # 186.39\ntrades.first.size # 10000 - refers to the number of shares negotiated in the day.\ntrades.first.time # 1527090690175\ntrades.first.time_label # 11:51:30\ntrades.first.venue # EDGX\ntrades.first.venue_name # Cboe EDGX\n```\n\nSee [#largest-trades](https://iexcloud.io/docs/api/#largest-trades) for detailed documentation or [largest_trades.rb](lib/iex/resources/largest_trades.rb) for returned fields.\n\n### Get a Quote for Crypto Currencies\n\nFetches a crypto currency quote.\n\n```ruby\ncrypto = client.crypto('BTCUSDT')\n\ncrypto.symbol #'BTCUSDT'\ncrypto.company_name #'Bitcoin USD'\ncrypto.primary_exchange #'crypto'\ncrypto.sector #'cryptocurrency'\ncrypto.calculation_price #'realtime'\ncrypto.open #3527.79\ncrypto.open_dollar #'$3,527'\ncrypto.open_time #1_548_082_840_296\ncrypto.close #3522.05522498\ncrypto.close_dollar #'$3,522'\ncrypto.close_time #1_548_169_240_296\ncrypto.high #3590.51\ncrypto.high_dollar #'$3,590'\n```\n\nSee [#crypto](https://iexcloud.io/docs/api/#crypto) for detailed documentation or [crypto.rb](lib/iex/resources/crypto.rb) for returned fields.\n\n### ISIN Mapping\n\nConvert ISIN to IEX Cloud symbols.\n\n```ruby\nsymbols = client.ref_data_isin('US0378331005')\n\nsymbols.first.exchange # NAS\nsymbols.first.iex_id # IEX_4D48333344362D52\nsymbols.first.region # US\nsymbols.first.symbol # AAPL\n```\n\nThe API also lets you convert multiple ISINs to IEX Cloud symbols.\n\n```ruby\nsymbols = client.ref_data_isin(['US0378331005', 'US0378331006'])\n```\n\nYou can use `mapped: true` option to receive symbols grouped by their ISINs.\n\n```ruby\nclient.ref_data_isin(['US0378331005', 'US5949181045'], mapped: true) # {'US0378331005' =\u003e [...], 'US5949181045' =\u003e [...]}\n```\n\nSee [#ISIN Mapping](https://iexcloud.io/docs/api/#isin-mapping) for detailed documentation or [isin_mapping.rb](lib/iex/resources/isin_mapping.rb) for returned fields.\n\n### Get Symbols\n\nReturns an array of symbols.\n\n```ruby\nsymbols = client.ref_data_symbols()\n\nsymbol = symbols.first\nsymbol.exchange # NAS\nsymbol.iex_id # IEX_46574843354B2D52\nsymbol.region # US\nsymbol.symbol # A\n```\n\nSee [#symbols](https://iexcloud.io/docs/api/#symbols) for detailed documentation or [symbols.rb](lib/iex/resources/symbols.rb) for returned fields.\n\n### Get Symbols for an Exchange\n\nReturns an array of symbols for an exchange identified by a market identifier code.\n\n```ruby\nsymbols = client.ref_data_symbols_for_exchange('XTSE')\n\nsymbol = symbols.first\nsymbol.exchange # XTSE\nsymbol.iex_id # IEX_4656374258322D52\nsymbol.region # CA\nsymbol.symbol # A-CV\n```\n\nSee [#international-symbols](https://iexcloud.io/docs/api/#international-symbols) for returned fields.\n\n### Get Symbols for a Region\n\nReturns an array of symbols for a region.\n\n```ruby\nsymbols = client.ref_data_symbols_for_region('ca')\n\nsymbol = symbols.first\nsymbol.exchange # XTSE\nsymbol.iex_id # IEX_4656374258322D53\nsymbol.region # CA\nsymbol.symbol # A-CT\n```\n\n### Get Latest Foreign Exchange Rates\n\nReturns an array of foreign exchange rates for a given list of symbols.\n\n```ruby\nrates = client.fx_latest(['USDCAD', 'USDGBP', 'USDJPY'])\n\nrate = rates.first\nrate.symbol # USDCAD\nrate.rate # 1.25674\nrate.timestamp # \u003cDate: 2021-07-23 ((2459419j,0s,0n),+0s,2299161j)\u003e\n```\n\nSee [#latest-currency-rates](https://iexcloud.io/docs/api/#latest-currency-rates) for returned fields.\n\n### Get List\n\nReturns an array of quotes for the top 10 symbols in a specified list.\n\n```ruby\nclient.stock_market_list(:mostactive) # [{symbol: 'AAPL', ...}, {...}]\n```\n\nSee [#list](https://iexcloud.io/docs/api/#list) for detailed documentation or [quote.rb](lib/iex/resources/quote.rb) for returned fields.\n\n### Other Requests\n\nPublic endpoints that aren't yet supported by the client can be called using `client.get`, `client.post`, `client.put`\nand `client.delete` methods. Pass the required token explicitly:\n\n```ruby\nclient.post('ref-data/isin', isin: ['US0378331005'], token: 'secret_token') # [{'exchange' =\u003e 'NAS', ..., 'symbol' =\u003e 'AAPL'}, {'exchange' =\u003e 'ETR', ..., 'symbol' =\u003e 'APC-GY']\n```\n\n## Configuration\n\nYou can configure client options globally or directly with a `IEX::Api::Client` instance.\n\n```ruby\nIEX::Api.configure do |config|\n  config.publishable_token = ENV['IEX_API_PUBLISHABLE_TOKEN']\n  config.endpoint = 'https://sandbox.iexapis.com/v1' # use sandbox environment\nend\n```\n\n```ruby\nclient = IEX::Api::Client.new(\n  publishable_token: ENV['IEX_API_PUBLISHABLE_TOKEN'],\n  endpoint: 'https://cloud.iexapis.com/v1'\n)\n```\n\nThe following settings are supported.\n\n| setting           | description                                                                 |\n| ----------------- | --------------------------------------------------------------------------- |\n| user_agent        | User-agent, defaults to _IEX Ruby Client/version_.                          |\n| proxy             | Optional HTTP proxy.                                                        |\n| ca_path           | Optional SSL certificates path.                                             |\n| ca_file           | Optional SSL certificates file.                                             |\n| logger            | Optional `Logger` instance or logger configuration to log HTTP requests.    |\n| timeout           | Optional open/read timeout in seconds.                                      |\n| open_timeout      | Optional connection open timeout in seconds.                                |\n| publishable_token | IEX Cloud API publishable token.                                            |\n| endpoint          | Defaults to `https://cloud.iexapis.com/v1`.                                 |\n| referer           | Optional string for HTTP `Referer` header, enables token domain management. |\n\n### Logging\n\nFaraday will not log HTTP requests by default. In order to do this you can either provide a `logger` instance or configuration attributes to `IEX::Api::Client`. Configuration allows you to supply the `instance`, `options`, and `proc` to [Faraday](https://lostisland.github.io/faraday/middleware/logger#include-and-exclude-headersbodies).\n\n```ruby\nlogger_instance = Logger.new(STDOUT)\n\nIEX::Api.configure do |config|\n  config.logger.instance = logger_instance\n  config.logger.options = { bodies: true }\n  config.logger.proc = proc { |logger| logger.filter(/T?[sp]k_\\w+/i, '[REMOVED]') }\nend\n# or\nIEX::Api.logger do |logger|\n  logger.instance = logger_instance\n  logger.options = …\n  logger.proc = …\nend\n# or\nIEX::Api.logger = logger_instance\n# or\nIEX::Api::Client.new(logger: logger_instance)\n```\n\n## Sandbox Environment\n\nIEX recommends you use a sandbox token and endpoint for testing.\n\nHowever, please note that data in the IEX sandbox environment is scrambled. Therefore elements such as company and people names, descriptions, tags, and website URLs don't render any coherent data. In addition, results, such as closing market prices and dividend yield, are not accurate and vary on every call.\n\nSee [IEX sandbox environment](https://intercom.help/iexcloud/en/articles/2915433-testing-with-the-iex-cloud-sandbox) for more information.\n\n## Errors\n\n### SymbolNotFound\n\nIf a symbol cannot be found an [IEX::Errors::SymbolNotFound](lib/iex/errors/symbol_not_found_error.rb) exception is raised.\n\n### PermissionDeniedError\n\nAll errors that return HTTP code 403 result in a [IEX::Errors::PermissionDeniedError](lib/iex/errors/permission_denied_error.rb) exception.\n\n### ClientError\n\nAll errors that return HTTP codes 400-600 result in a [IEX::Errors::ClientError](lib/iex/errors/client_error.rb) exception.\n\n## Contributing\n\nSee [CONTRIBUTING](CONTRIBUTING.md).\n\n## Copyright and License\n\nCopyright (c) 2018-2019, [Daniel Doubrovkine](https://twitter.com/dblockdotorg) and [Contributors](CHANGELOG.md).\n\nThis project is licensed under the [MIT License](LICENSE.md).\n\nData provided for free by [IEX](https://iexcloud.io), see [terms](https://iexcloud.io/terms/).\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdblock%2Fiex-ruby-client","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdblock%2Fiex-ruby-client","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdblock%2Fiex-ruby-client/lists"}