View Source FinnhubAPI.Api.Default (finnhub_api v1.0.0)

API calls for all endpoints tagged Default.

Summary

Functions

Aggregate Indicators Get aggregate signal of multiple technical indicators such as MACD, RSI, Moving Average v.v. A full list of indicators can be found <a href="https://docs.google.com/spreadsheets/d/1MWuy0WuT2yVlxr1KbPdggVygMZtJfunDnhe-C0GEXYM/edit?usp=sharing" target="_blank">here</a>.

Bond Profile Get general information of a bond. You can query by FIGI, ISIN or CUSIP. A list of supported bonds can be found <a href="/api/v1/bond/list?token=" target="_blank">here</a>.

Bond Yield Curve Get yield curve data for Treasury bonds.

Basic Financials Get company basic financials such as margin, P/E ratio, 52-week high/low etc.

Earnings Surprises Get company historical quarterly earnings surprise going back to 2000.

EBIT Estimates Get company's ebit estimates.

EBITDA Estimates Get company's ebitda estimates.

Earnings Estimates Get company's EPS estimates.

Company Executive Get a list of company's executives and members of the Board.

Company News List latest company news by symbol. This endpoint is only available for North American companies.

Peers Get company peers. Return a list of peers operating in the same country and sector/industry.

Company Profile 2 Get general information of a company. You can query by symbol, ISIN or CUSIP. This is the free version of <a href="#company-profile">Company Profile</a>.

Company Profile Get general information of a company. You can query by symbol, ISIN or CUSIP

Revenue Estimates Get company's revenue estimates.

Congressional Trading Get stock trades data disclosed by members of congress.

Country Metadata List all countries and metadata.

COVID-19 Get real-time updates on the number of COVID-19 (Corona virus) cases in the US with a state-by-state breakdown. Data is sourced from CDC and reputable sources. You can also access this API <a href="https://rapidapi.com/Finnhub/api/finnhub-real-time-covid-19" target="_blank" rel="nofollow">here</a>

Crypto Candles Get candlestick data for crypto symbols.

Crypto Exchanges List supported crypto exchanges

Crypto Profile Get crypto's profile.

Crypto Symbol List supported crypto symbols by exchange

Earnings Calendar Get historical and coming earnings release. EPS and Revenue in this endpoint are non-GAAP, which means they are adjusted to exclude some one-time or unusual items. This is the same data investors usually react to and talked about on the media. Estimates are sourced from both sell-side and buy-side analysts.

Economic Code List codes of supported economic data.

Economic Data Get economic data.

ETFs Country Exposure Get ETF country exposure data.

ETFs Holdings Get full ETF holdings/constituents. This endpoint has global coverage. Widget only shows top 10 holdings. A list of supported ETFs can be found <a href="/api/v1/etf/list?token=" target="_blank">here</a>.

ETFs Profile Get ETF profile information. This endpoint has global coverage. A list of supported ETFs can be found <a href="/api/v1/etf/list?token=" target="_blank">here</a>.

ETFs Sector Exposure Get ETF sector exposure data.

FDA Committee Meeting Calendar FDA's advisory committees are established to provide functions which support the agency's mission of protecting and promoting the public health, while meeting the requirements set forth in the Federal Advisory Committee Act. Committees are either mandated by statute or established at the discretion of the Department of Health and Human Services. Each committee is subject to renewal at two-year intervals unless the committee charter states otherwise.

SEC Filings List company's filing. Limit to 250 documents at a time. This data is available for bulk download on <a href="https://www.kaggle.com/finnhub/sec-filings" target="_blank">Kaggle SEC Filings database</a>.

SEC Sentiment Analysis Get sentiment analysis of 10-K and 10-Q filings from SEC. An abnormal increase in the number of positive/negative words in filings can signal a significant change in the company's stock price in the upcoming 4 quarters. We make use of <a href= "https://sraf.nd.edu/textual-analysis/resources/" target="_blank">Loughran and McDonald Sentiment Word Lists</a> to calculate the sentiment for each filing.

Financials As Reported Get financials as reported. This data is available for bulk download on <a href="https://www.kaggle.com/finnhub/reported-financials" target="_blank">Kaggle SEC Financials database</a>.

Forex Candles Get candlestick data for forex symbols.

Forex Exchanges List supported forex exchanges

Forex rates Get rates for all forex pairs. Ideal for currency conversion

Forex Symbol List supported forex symbols.

Fund Ownership Get a full list fund and institutional investors of a company in descending order of the number of shares held. Data is sourced from <code>13F form</code>, <code>Schedule 13D</code> and <code>13G</code> for US market, <code>UK Share Register</code> for UK market, <code>SEDI</code> for Canadian market and equivalent filings for other international markets.

Indices Constituents Get a list of index's constituents. A list of supported indices for this endpoint can be found <a href="/api/v1/index/list?token=" target="_blank">here</a>.

Indices Historical Constituents Get full history of index's constituents including symbols and dates of joining and leaving the Index. Currently support <code>^GSPC</code>, <code>^NDX</code>, <code>^DJI</code>

Insider Sentiment Get insider sentiment data for US companies calculated using method discussed <a href="https://medium.com/@stock-api/finnhub-insiders-sentiment-analysis-cc43f9f64b3a" target="_blank">here</a>. The MSPR ranges from -100 for the most negative to 100 for the most positive which can signal price changes in the coming 30-90 days.

Insider Transactions Company insider transactions data sourced from <code>Form 3,4,5</code>, SEDI and relevant companies' filings. This endpoint covers US, UK, Canada, Australia, India, and all major EU markets. Limit to 100 transactions per API call.

Institutional Ownership Get a list institutional investors' positions for a particular stock overtime. Data from 13-F filings. Limit to 1 year of data at a time.

Institutional Portfolio Get the holdings/portfolio data of institutional investors from 13-F filings. Limit to 1 year of data at a time. You can get a list of supported CIK <a href="/api/v1/institutional/list?token=" target="_blank">here</a>.

Institutional Profile Get a list of well-known institutional investors. Currently support 60+ profiles.

International Filings List filings for international companies. Limit to 250 documents at a time. These are the documents we use to source our fundamental data. Only support SEDAR and UK Companies House for normal usage. Enterprise clients who need access to the full filings for global markets should contact us for the access.

Investment Themes (Thematic Investing)

IPO Calendar Get recent and upcoming IPO.

ISIN Change Get a list of ISIN changes for EU-listed securities. Limit to 2000 events at a time.

Market Holiday Get a list of holidays for global exchanges.

Market News Get latest market news.

Market Status Get current market status for global exchanges (whether exchanges are open or close).

Mutual Funds Country Exposure Get Mutual Funds country exposure data.

Mutual Funds EET Get EET data for EU funds. For PAIs data, please see the EET PAI endpoint.

Mutual Funds EET PAI Get EET PAI data for EU funds.

Mutual Funds Holdings Get full Mutual Funds holdings/constituents. This endpoint covers both US and global mutual funds. For international funds, you must query the data using ISIN. A list of supported funds can be found <a href="/api/v1/mutual-fund/list?token=" target="_blank">here</a>.

Mutual Funds Profile Get mutual funds profile information. This endpoint covers both US and global mutual funds. For international funds, you must query the data using ISIN. A list of supported funds can be found <a href="/api/v1/mutual-fund/list?token=" target="_blank">here</a>.

Mutual Funds Sector Exposure Get Mutual Funds sector exposure data.

News Sentiment Get company's news sentiment and statistics. This endpoint is only available for US companies.

Ownership Get a full list of shareholders of a company in descending order of the number of shares held. Data is sourced from <code>13F form</code>, <code>Schedule 13D</code> and <code>13G</code> for US market, <code>UK Share Register</code> for UK market, <code>SEDI</code> for Canadian market and equivalent filings for other international markets.

Pattern Recognition Run pattern recognition algorithm on a symbol. Support double top/bottom, triple top/bottom, head and shoulders, triangle, wedge, channel, flag, and candlestick patterns.

Price Metrics Get company price performance statistics such as 52-week high/low, YTD return and much more.

Price Target Get latest price target consensus.

Recommendation Trends Get latest analyst recommendation trends for a company.

Revenue Breakdown Get revenue breakdown by product. This dataset is only available for US companies which disclose their revenue breakdown in the annual or quarterly reports.

Sector Metrics Get ratios for different sectors and regions/indices.

Dividends 2 (Basic) Get global dividends data.

Last Bid-Ask Get last bid/ask data for US stocks.

Dividends Get dividends data for common stocks going back 30 years.

Senate Lobbying Get a list of reported lobbying activities in the Senate and the House.

Splits Get splits data for stocks.

Stock Symbol List supported stocks. We use the following symbology to identify stocks on Finnhub <code>Exchange_Ticker.Exchange_Code</code>. A list of supported exchange codes can be found <a href="https://docs.google.com/spreadsheets/d/1I3pBxjfXB056-g_JYf_6o3Rns3BV2kMGG1nCatb91ls/edit?usp=sharing" target="_blank">here</a>.

USA Spending Get a list of government's spending activities from USASpending dataset for public companies. This dataset can help you identify companies that win big government contracts which is extremely important for industries such as Defense, Aerospace, and Education.

USPTO Patents List USPTO patents for companies. Limit to 250 records per API call.

H1-B Visa Application Get a list of H1-B and Permanent visa applications for companies from the DOL. The data is updated quarterly.

Support/Resistance Get support and resistance levels for a symbol.

Symbol Change Get a list of symbol changes for US-listed, EU-listed, NSE and ASX securities. Limit to 2000 events at a time.

Symbol Lookup Search for best-matching symbols based on your query. You can input anything from symbol, security's name to ISIN and Cusip.

Technical Indicators Return technical indicator with price data. List of supported indicators can be found <a href="https://docs.google.com/spreadsheets/d/1ylUvKHVYN2E87WdwIza8ROaCpd48ggEl1k5i5SgA29k/edit?usp=sharing" target="_blank">here</a>.

Earnings Call Transcripts

Earnings Call Transcripts List List earnings call transcripts' metadata. This endpoint is available for US, UK, European, Australian and Canadian companies.

Stock Upgrade/Downgrade Get latest stock upgrade and downgrade.

Functions

Link to this function

aggregate_indicator(connection, symbol, resolution, opts \\ [])

View Source
@spec aggregate_indicator(Tesla.Env.client(), String.t(), String.t(), keyword()) ::
  {:ok, FinnhubAPI.Model.AggregateIndicators.t()} | {:error, Tesla.Env.t()}

Aggregate Indicators Get aggregate signal of multiple technical indicators such as MACD, RSI, Moving Average v.v. A full list of indicators can be found <a href="https://docs.google.com/spreadsheets/d/1MWuy0WuT2yVlxr1KbPdggVygMZtJfunDnhe-C0GEXYM/edit?usp=sharing" target="_blank">here</a>.

Parameters

  • connection (FinnhubAPI.Connection): Connection to server
  • symbol (String.t): symbol
  • resolution (String.t): Supported resolution includes <code>1, 5, 15, 30, 60, D, W, M </code>.Some timeframes might not be available depending on the exchange.
  • opts (keyword): Optional parameters

Returns

  • {:ok, FinnhubAPI.Model.AggregateIndicators.t} on success
  • {:error, Tesla.Env.t} on failure
Link to this function

bond_price(connection, isin, from, to, opts \\ [])

View Source
@spec bond_price(Tesla.Env.client(), String.t(), integer(), integer(), keyword()) ::
  {:ok, FinnhubAPI.Model.BondCandles.t()} | {:error, Tesla.Env.t()}

Bond price data

Get bond's price data. The following datasets are supported:

Parameters

  • connection (FinnhubAPI.Connection): Connection to server
  • isin (String.t): ISIN.
  • from (integer()): UNIX timestamp. Interval initial value.
  • to (integer()): UNIX timestamp. Interval end value.
  • opts (keyword): Optional parameters

Returns

  • {:ok, FinnhubAPI.Model.BondCandles.t} on success
  • {:error, Tesla.Env.t} on failure
Link to this function

bond_profile(connection, opts \\ [])

View Source
@spec bond_profile(
  Tesla.Env.client(),
  keyword()
) :: {:ok, FinnhubAPI.Model.BondProfile.t()} | {:error, Tesla.Env.t()}

Bond Profile Get general information of a bond. You can query by FIGI, ISIN or CUSIP. A list of supported bonds can be found <a href="/api/v1/bond/list?token=" target="_blank">here</a>.

Parameters

  • connection (FinnhubAPI.Connection): Connection to server
  • opts (keyword): Optional parameters
    • :isin (String.t): ISIN
    • :cusip (String.t): CUSIP
    • :figi (String.t): FIGI

Returns

  • {:ok, FinnhubAPI.Model.BondProfile.t} on success
  • {:error, Tesla.Env.t} on failure
Link to this function

bond_tick(connection, isin, date, limit, skip, exchange, opts \\ [])

View Source
@spec bond_tick(
  Tesla.Env.client(),
  String.t(),
  Date.t(),
  integer(),
  integer(),
  String.t(),
  keyword()
) :: {:ok, FinnhubAPI.Model.BondTickData.t()} | {:error, Tesla.Env.t()}

Bond Tick Data

Get trade-level data for bonds. The following datasets are supported:

Parameters

  • connection (FinnhubAPI.Connection): Connection to server
  • isin (String.t): ISIN.
  • date (Date.t): Date: 2020-04-02.
  • limit (integer()): Limit number of ticks returned. Maximum value: <code>25000</code>
  • skip (integer()): Number of ticks to skip. Use this parameter to loop through the entire data.
  • exchange (String.t): Currently support the following values: <code>trace</code>.
  • opts (keyword): Optional parameters

Returns

  • {:ok, FinnhubAPI.Model.BondTickData.t} on success
  • {:error, Tesla.Env.t} on failure
Link to this function

bond_yield_curve(connection, code, opts \\ [])

View Source
@spec bond_yield_curve(Tesla.Env.client(), String.t(), keyword()) ::
  {:ok, FinnhubAPI.Model.BondYieldCurve.t()} | {:error, Tesla.Env.t()}

Bond Yield Curve Get yield curve data for Treasury bonds.

Parameters

Returns

  • {:ok, FinnhubAPI.Model.BondYieldCurve.t} on success
  • {:error, Tesla.Env.t} on failure
Link to this function

company_basic_financials(connection, symbol, metric, opts \\ [])

View Source
@spec company_basic_financials(Tesla.Env.client(), String.t(), String.t(), keyword()) ::
  {:ok, FinnhubAPI.Model.BasicFinancials.t()} | {:error, Tesla.Env.t()}

Basic Financials Get company basic financials such as margin, P/E ratio, 52-week high/low etc.

Parameters

  • connection (FinnhubAPI.Connection): Connection to server
  • symbol (String.t): Symbol of the company: AAPL.
  • metric (String.t): Metric type. Can be 1 of the following values <code>all</code>
  • opts (keyword): Optional parameters

Returns

  • {:ok, FinnhubAPI.Model.BasicFinancials.t} on success
  • {:error, Tesla.Env.t} on failure
Link to this function

company_earnings(connection, symbol, opts \\ [])

View Source
@spec company_earnings(Tesla.Env.client(), String.t(), keyword()) ::
  {:ok, [FinnhubAPI.Model.EarningResult.t()]} | {:error, Tesla.Env.t()}

Earnings Surprises Get company historical quarterly earnings surprise going back to 2000.

Parameters

  • connection (FinnhubAPI.Connection): Connection to server
  • symbol (String.t): Symbol of the company: AAPL.
  • opts (keyword): Optional parameters
    • :limit (integer()): Limit number of period returned. Leave blank to get the full history.

Returns

  • {:ok, [%EarningResult{}, ...]} on success
  • {:error, Tesla.Env.t} on failure
Link to this function

company_earnings_quality_score(connection, symbol, freq, opts \\ [])

View Source
@spec company_earnings_quality_score(
  Tesla.Env.client(),
  String.t(),
  String.t(),
  keyword()
) ::
  {:ok, FinnhubAPI.Model.CompanyEarningsQualityScore.t()}
  | {:error, Tesla.Env.t()}

Company Earnings Quality Score

This endpoint provides Earnings Quality Score for global companies.

Parameters

  • connection (FinnhubAPI.Connection): Connection to server
  • symbol (String.t): Symbol.
  • freq (String.t): Frequency. Currently support <code>annual</code> and <code>quarterly</code>
  • opts (keyword): Optional parameters

Returns

  • {:ok, FinnhubAPI.Model.CompanyEarningsQualityScore.t} on success
  • {:error, Tesla.Env.t} on failure
Link to this function

company_ebit_estimates(connection, symbol, opts \\ [])

View Source
@spec company_ebit_estimates(Tesla.Env.client(), String.t(), keyword()) ::
  {:ok, FinnhubAPI.Model.EbitEstimates.t()} | {:error, Tesla.Env.t()}

EBIT Estimates Get company's ebit estimates.

Parameters

  • connection (FinnhubAPI.Connection): Connection to server
  • symbol (String.t): Symbol of the company: AAPL.
  • opts (keyword): Optional parameters
    • :freq (String.t): Can take 1 of the following values: <code>annual, quarterly</code>. Default to <code>quarterly</code>

Returns

  • {:ok, FinnhubAPI.Model.EbitEstimates.t} on success
  • {:error, Tesla.Env.t} on failure
Link to this function

company_ebitda_estimates(connection, symbol, opts \\ [])

View Source
@spec company_ebitda_estimates(Tesla.Env.client(), String.t(), keyword()) ::
  {:ok, FinnhubAPI.Model.EbitdaEstimates.t()} | {:error, Tesla.Env.t()}

EBITDA Estimates Get company's ebitda estimates.

Parameters

  • connection (FinnhubAPI.Connection): Connection to server
  • symbol (String.t): Symbol of the company: AAPL.
  • opts (keyword): Optional parameters
    • :freq (String.t): Can take 1 of the following values: <code>annual, quarterly</code>. Default to <code>quarterly</code>

Returns

  • {:ok, FinnhubAPI.Model.EbitdaEstimates.t} on success
  • {:error, Tesla.Env.t} on failure
Link to this function

company_eps_estimates(connection, symbol, opts \\ [])

View Source
@spec company_eps_estimates(Tesla.Env.client(), String.t(), keyword()) ::
  {:ok, FinnhubAPI.Model.EarningsEstimates.t()} | {:error, Tesla.Env.t()}

Earnings Estimates Get company's EPS estimates.

Parameters

  • connection (FinnhubAPI.Connection): Connection to server
  • symbol (String.t): Symbol of the company: AAPL.
  • opts (keyword): Optional parameters
    • :freq (String.t): Can take 1 of the following values: <code>annual, quarterly</code>. Default to <code>quarterly</code>

Returns

  • {:ok, FinnhubAPI.Model.EarningsEstimates.t} on success
  • {:error, Tesla.Env.t} on failure
Link to this function

company_esg_score(connection, symbol, opts \\ [])

View Source
@spec company_esg_score(Tesla.Env.client(), String.t(), keyword()) ::
  {:ok, FinnhubAPI.Model.CompanyEsg.t()} | {:error, Tesla.Env.t()}

Company ESG Scores

This endpoint provides ESG scores and important indicators for 7000+ global companies. The data is collected through company's public ESG disclosure and public sources.

Parameters

  • connection (FinnhubAPI.Connection): Connection to server
  • symbol (String.t): Symbol.
  • opts (keyword): Optional parameters

Returns

  • {:ok, FinnhubAPI.Model.CompanyEsg.t} on success
  • {:error, Tesla.Env.t} on failure
Link to this function

company_executive(connection, symbol, opts \\ [])

View Source
@spec company_executive(Tesla.Env.client(), String.t(), keyword()) ::
  {:ok, FinnhubAPI.Model.CompanyExecutive.t()} | {:error, Tesla.Env.t()}

Company Executive Get a list of company's executives and members of the Board.

Parameters

  • connection (FinnhubAPI.Connection): Connection to server
  • symbol (String.t): Symbol of the company: AAPL.
  • opts (keyword): Optional parameters

Returns

  • {:ok, FinnhubAPI.Model.CompanyExecutive.t} on success
  • {:error, Tesla.Env.t} on failure
Link to this function

company_news(connection, symbol, from, to, opts \\ [])

View Source
@spec company_news(Tesla.Env.client(), String.t(), Date.t(), Date.t(), keyword()) ::
  {:ok, [FinnhubAPI.Model.CompanyNews.t()]} | {:error, Tesla.Env.t()}

Company News List latest company news by symbol. This endpoint is only available for North American companies.

Parameters

  • connection (FinnhubAPI.Connection): Connection to server
  • symbol (String.t): Company symbol.
  • from (Date.t): From date <code>YYYY-MM-DD</code>.
  • to (Date.t): To date <code>YYYY-MM-DD</code>.
  • opts (keyword): Optional parameters

Returns

  • {:ok, [%CompanyNews{}, ...]} on success
  • {:error, Tesla.Env.t} on failure
Link to this function

company_peers(connection, symbol, opts \\ [])

View Source
@spec company_peers(Tesla.Env.client(), String.t(), keyword()) ::
  {:ok, [String.t()]} | {:error, Tesla.Env.t()}

Peers Get company peers. Return a list of peers operating in the same country and sector/industry.

Parameters

  • connection (FinnhubAPI.Connection): Connection to server
  • symbol (String.t): Symbol of the company: AAPL.
  • opts (keyword): Optional parameters
    • :grouping (String.t): Specify the grouping criteria for choosing peers.Supporter values: <code>sector</code>, <code>industry</code>, <code>subIndustry</code>. Default to <code>subIndustry</code>.

Returns

  • {:ok, [%String{}, ...]} on success
  • {:error, Tesla.Env.t} on failure
Link to this function

company_profile2(connection, opts \\ [])

View Source
@spec company_profile2(
  Tesla.Env.client(),
  keyword()
) :: {:ok, FinnhubAPI.Model.CompanyProfile2.t()} | {:error, Tesla.Env.t()}

Company Profile 2 Get general information of a company. You can query by symbol, ISIN or CUSIP. This is the free version of <a href="#company-profile">Company Profile</a>.

Parameters

  • connection (FinnhubAPI.Connection): Connection to server
  • opts (keyword): Optional parameters
    • :symbol (String.t): Symbol of the company: AAPL e.g.
    • :isin (String.t): ISIN
    • :cusip (String.t): CUSIP

Returns

  • {:ok, FinnhubAPI.Model.CompanyProfile2.t} on success
  • {:error, Tesla.Env.t} on failure
Link to this function

company_profile(connection, opts \\ [])

View Source
@spec company_profile(
  Tesla.Env.client(),
  keyword()
) :: {:ok, FinnhubAPI.Model.CompanyProfile.t()} | {:error, Tesla.Env.t()}

Company Profile Get general information of a company. You can query by symbol, ISIN or CUSIP

Parameters

  • connection (FinnhubAPI.Connection): Connection to server
  • opts (keyword): Optional parameters
    • :symbol (String.t): Symbol of the company: AAPL e.g.
    • :isin (String.t): ISIN
    • :cusip (String.t): CUSIP

Returns

  • {:ok, FinnhubAPI.Model.CompanyProfile.t} on success
  • {:error, Tesla.Env.t} on failure
Link to this function

company_revenue_estimates(connection, symbol, opts \\ [])

View Source
@spec company_revenue_estimates(Tesla.Env.client(), String.t(), keyword()) ::
  {:ok, FinnhubAPI.Model.RevenueEstimates.t()} | {:error, Tesla.Env.t()}

Revenue Estimates Get company's revenue estimates.

Parameters

  • connection (FinnhubAPI.Connection): Connection to server
  • symbol (String.t): Symbol of the company: AAPL.
  • opts (keyword): Optional parameters
    • :freq (String.t): Can take 1 of the following values: <code>annual, quarterly</code>. Default to <code>quarterly</code>

Returns

  • {:ok, FinnhubAPI.Model.RevenueEstimates.t} on success
  • {:error, Tesla.Env.t} on failure
Link to this function

congressional_trading(connection, symbol, from, to, opts \\ [])

View Source
@spec congressional_trading(
  Tesla.Env.client(),
  String.t(),
  Date.t(),
  Date.t(),
  keyword()
) ::
  {:ok, FinnhubAPI.Model.CongressionalTrading.t()} | {:error, Tesla.Env.t()}

Congressional Trading Get stock trades data disclosed by members of congress.

Parameters

  • connection (FinnhubAPI.Connection): Connection to server
  • symbol (String.t): Symbol of the company: AAPL.
  • from (Date.t): From date <code>YYYY-MM-DD</code>.
  • to (Date.t): To date <code>YYYY-MM-DD</code>.
  • opts (keyword): Optional parameters

Returns

  • {:ok, FinnhubAPI.Model.CongressionalTrading.t} on success
  • {:error, Tesla.Env.t} on failure
Link to this function

country(connection, opts \\ [])

View Source
@spec country(
  Tesla.Env.client(),
  keyword()
) :: {:ok, [FinnhubAPI.Model.CountryMetadata.t()]} | {:error, Tesla.Env.t()}

Country Metadata List all countries and metadata.

Parameters

  • connection (FinnhubAPI.Connection): Connection to server
  • opts (keyword): Optional parameters

Returns

  • {:ok, [%CountryMetadata{}, ...]} on success
  • {:error, Tesla.Env.t} on failure
Link to this function

covid19(connection, opts \\ [])

View Source
@spec covid19(
  Tesla.Env.client(),
  keyword()
) :: {:ok, [FinnhubAPI.Model.CovidInfo.t()]} | {:error, Tesla.Env.t()}

COVID-19 Get real-time updates on the number of COVID-19 (Corona virus) cases in the US with a state-by-state breakdown. Data is sourced from CDC and reputable sources. You can also access this API <a href="https://rapidapi.com/Finnhub/api/finnhub-real-time-covid-19" target="_blank" rel="nofollow">here</a>

Parameters

  • connection (FinnhubAPI.Connection): Connection to server
  • opts (keyword): Optional parameters

Returns

  • {:ok, [%CovidInfo{}, ...]} on success
  • {:error, Tesla.Env.t} on failure
Link to this function

crypto_candles(connection, symbol, resolution, from, to, opts \\ [])

View Source
@spec crypto_candles(
  Tesla.Env.client(),
  String.t(),
  String.t(),
  integer(),
  integer(),
  keyword()
) :: {:ok, FinnhubAPI.Model.CryptoCandles.t()} | {:error, Tesla.Env.t()}

Crypto Candles Get candlestick data for crypto symbols.

Parameters

  • connection (FinnhubAPI.Connection): Connection to server
  • symbol (String.t): Use symbol returned in <code>/crypto/symbol</code> endpoint for this field.
  • resolution (String.t): Supported resolution includes <code>1, 5, 15, 30, 60, D, W, M </code>.Some timeframes might not be available depending on the exchange.
  • from (integer()): UNIX timestamp. Interval initial value.
  • to (integer()): UNIX timestamp. Interval end value.
  • opts (keyword): Optional parameters

Returns

  • {:ok, FinnhubAPI.Model.CryptoCandles.t} on success
  • {:error, Tesla.Env.t} on failure
Link to this function

crypto_exchanges(connection, opts \\ [])

View Source
@spec crypto_exchanges(
  Tesla.Env.client(),
  keyword()
) :: {:ok, [String.t()]} | {:error, Tesla.Env.t()}

Crypto Exchanges List supported crypto exchanges

Parameters

  • connection (FinnhubAPI.Connection): Connection to server
  • opts (keyword): Optional parameters

Returns

  • {:ok, [%String{}, ...]} on success
  • {:error, Tesla.Env.t} on failure
Link to this function

crypto_profile(connection, symbol, opts \\ [])

View Source
@spec crypto_profile(Tesla.Env.client(), String.t(), keyword()) ::
  {:ok, FinnhubAPI.Model.CryptoProfile.t()} | {:error, Tesla.Env.t()}

Crypto Profile Get crypto's profile.

Parameters

  • connection (FinnhubAPI.Connection): Connection to server
  • symbol (String.t): Crypto symbol such as BTC or ETH.
  • opts (keyword): Optional parameters

Returns

  • {:ok, FinnhubAPI.Model.CryptoProfile.t} on success
  • {:error, Tesla.Env.t} on failure
Link to this function

crypto_symbols(connection, exchange, opts \\ [])

View Source
@spec crypto_symbols(Tesla.Env.client(), String.t(), keyword()) ::
  {:ok, [FinnhubAPI.Model.CryptoSymbol.t()]} | {:error, Tesla.Env.t()}

Crypto Symbol List supported crypto symbols by exchange

Parameters

  • connection (FinnhubAPI.Connection): Connection to server
  • exchange (String.t): Exchange you want to get the list of symbols from.
  • opts (keyword): Optional parameters

Returns

  • {:ok, [%CryptoSymbol{}, ...]} on success
  • {:error, Tesla.Env.t} on failure
Link to this function

earnings_calendar(connection, opts \\ [])

View Source
@spec earnings_calendar(
  Tesla.Env.client(),
  keyword()
) :: {:ok, FinnhubAPI.Model.EarningsCalendar.t()} | {:error, Tesla.Env.t()}

Earnings Calendar Get historical and coming earnings release. EPS and Revenue in this endpoint are non-GAAP, which means they are adjusted to exclude some one-time or unusual items. This is the same data investors usually react to and talked about on the media. Estimates are sourced from both sell-side and buy-side analysts.

Parameters

  • connection (FinnhubAPI.Connection): Connection to server
  • opts (keyword): Optional parameters
    • :from (Date.t): From date: 2020-03-15.
    • :to (Date.t): To date: 2020-03-16.
    • :symbol (String.t): Filter by symbol: AAPL.
    • :international (boolean()): Set to <code>true</code> to include international markets. Default value is <code>false</code>

Returns

  • {:ok, FinnhubAPI.Model.EarningsCalendar.t} on success
  • {:error, Tesla.Env.t} on failure
Link to this function

economic_calendar(connection, opts \\ [])

View Source
@spec economic_calendar(
  Tesla.Env.client(),
  keyword()
) :: {:ok, FinnhubAPI.Model.EconomicCalendar.t()} | {:error, Tesla.Env.t()}

Economic Calendar

Get recent and upcoming economic releases.

Parameters

  • connection (FinnhubAPI.Connection): Connection to server
  • opts (keyword): Optional parameters
    • :from (Date.t): From date <code>YYYY-MM-DD</code>.
    • :to (Date.t): To date <code>YYYY-MM-DD</code>.

Returns

  • {:ok, FinnhubAPI.Model.EconomicCalendar.t} on success
  • {:error, Tesla.Env.t} on failure
Link to this function

economic_code(connection, opts \\ [])

View Source
@spec economic_code(
  Tesla.Env.client(),
  keyword()
) :: {:ok, [FinnhubAPI.Model.EconomicCode.t()]} | {:error, Tesla.Env.t()}

Economic Code List codes of supported economic data.

Parameters

  • connection (FinnhubAPI.Connection): Connection to server
  • opts (keyword): Optional parameters

Returns

  • {:ok, [%EconomicCode{}, ...]} on success
  • {:error, Tesla.Env.t} on failure
Link to this function

economic_data(connection, code, opts \\ [])

View Source
@spec economic_data(Tesla.Env.client(), String.t(), keyword()) ::
  {:ok, FinnhubAPI.Model.EconomicData.t()} | {:error, Tesla.Env.t()}

Economic Data Get economic data.

Parameters

  • connection (FinnhubAPI.Connection): Connection to server
  • code (String.t): Economic code.
  • opts (keyword): Optional parameters

Returns

  • {:ok, FinnhubAPI.Model.EconomicData.t} on success
  • {:error, Tesla.Env.t} on failure
Link to this function

etfs_country_exposure(connection, opts \\ [])

View Source
@spec etfs_country_exposure(
  Tesla.Env.client(),
  keyword()
) :: {:ok, FinnhubAPI.Model.EtfsCountryExposure.t()} | {:error, Tesla.Env.t()}

ETFs Country Exposure Get ETF country exposure data.

Parameters

  • connection (FinnhubAPI.Connection): Connection to server
  • opts (keyword): Optional parameters
    • :symbol (String.t): ETF symbol.
    • :isin (String.t): ETF isin.

Returns

  • {:ok, FinnhubAPI.Model.EtfsCountryExposure.t} on success
  • {:error, Tesla.Env.t} on failure
Link to this function

etfs_holdings(connection, opts \\ [])

View Source
@spec etfs_holdings(
  Tesla.Env.client(),
  keyword()
) :: {:ok, FinnhubAPI.Model.EtfsHoldings.t()} | {:error, Tesla.Env.t()}

ETFs Holdings Get full ETF holdings/constituents. This endpoint has global coverage. Widget only shows top 10 holdings. A list of supported ETFs can be found <a href="/api/v1/etf/list?token=" target="_blank">here</a>.

Parameters

  • connection (FinnhubAPI.Connection): Connection to server
  • opts (keyword): Optional parameters
    • :symbol (String.t): ETF symbol.
    • :isin (String.t): ETF isin.
    • :skip (integer()): Skip the first n results. You can use this parameter to query historical constituents data. The latest result is returned if skip=0 or not set.
    • :date (String.t): Query holdings by date. You can use either this param or <code>skip</code> param, not both.

Returns

  • {:ok, FinnhubAPI.Model.EtfsHoldings.t} on success
  • {:error, Tesla.Env.t} on failure
Link to this function

etfs_profile(connection, opts \\ [])

View Source
@spec etfs_profile(
  Tesla.Env.client(),
  keyword()
) :: {:ok, FinnhubAPI.Model.EtfsProfile.t()} | {:error, Tesla.Env.t()}

ETFs Profile Get ETF profile information. This endpoint has global coverage. A list of supported ETFs can be found <a href="/api/v1/etf/list?token=" target="_blank">here</a>.

Parameters

  • connection (FinnhubAPI.Connection): Connection to server
  • opts (keyword): Optional parameters
    • :symbol (String.t): ETF symbol.
    • :isin (String.t): ETF isin.

Returns

  • {:ok, FinnhubAPI.Model.EtfsProfile.t} on success
  • {:error, Tesla.Env.t} on failure
Link to this function

etfs_sector_exposure(connection, opts \\ [])

View Source
@spec etfs_sector_exposure(
  Tesla.Env.client(),
  keyword()
) :: {:ok, FinnhubAPI.Model.EtfsSectorExposure.t()} | {:error, Tesla.Env.t()}

ETFs Sector Exposure Get ETF sector exposure data.

Parameters

  • connection (FinnhubAPI.Connection): Connection to server
  • opts (keyword): Optional parameters
    • :symbol (String.t): ETF symbol.
    • :isin (String.t): ETF isin.

Returns

  • {:ok, FinnhubAPI.Model.EtfsSectorExposure.t} on success
  • {:error, Tesla.Env.t} on failure
Link to this function

fda_committee_meeting_calendar(connection, opts \\ [])

View Source
@spec fda_committee_meeting_calendar(
  Tesla.Env.client(),
  keyword()
) :: {:ok, [FinnhubAPI.Model.FdaComitteeMeeting.t()]} | {:error, Tesla.Env.t()}

FDA Committee Meeting Calendar FDA's advisory committees are established to provide functions which support the agency's mission of protecting and promoting the public health, while meeting the requirements set forth in the Federal Advisory Committee Act. Committees are either mandated by statute or established at the discretion of the Department of Health and Human Services. Each committee is subject to renewal at two-year intervals unless the committee charter states otherwise.

Parameters

  • connection (FinnhubAPI.Connection): Connection to server
  • opts (keyword): Optional parameters

Returns

  • {:ok, [%FdaComitteeMeeting{}, ...]} on success
  • {:error, Tesla.Env.t} on failure
Link to this function

filings(connection, opts \\ [])

View Source
@spec filings(
  Tesla.Env.client(),
  keyword()
) :: {:ok, [FinnhubAPI.Model.Filing.t()]} | {:error, Tesla.Env.t()}

SEC Filings List company's filing. Limit to 250 documents at a time. This data is available for bulk download on <a href="https://www.kaggle.com/finnhub/sec-filings" target="_blank">Kaggle SEC Filings database</a>.

Parameters

  • connection (FinnhubAPI.Connection): Connection to server
  • opts (keyword): Optional parameters
    • :symbol (String.t): Symbol. Leave <code>symbol</code>,<code>cik</code> and <code>accessNumber</code> empty to list latest filings.
    • :cik (String.t): CIK.
    • :accessNumber (String.t): Access number of a specific report you want to retrieve data from.
    • :form (String.t): Filter by form. You can use this value <code>NT 10-K</code> to find non-timely filings for a company.
    • :from (Date.t): From date: 2020-03-15.
    • :to (Date.t): To date: 2020-03-16.

Returns

  • {:ok, [%Filing{}, ...]} on success
  • {:error, Tesla.Env.t} on failure
Link to this function

filings_sentiment(connection, access_number, opts \\ [])

View Source
@spec filings_sentiment(Tesla.Env.client(), String.t(), keyword()) ::
  {:ok, FinnhubAPI.Model.SecSentimentAnalysis.t()} | {:error, Tesla.Env.t()}

SEC Sentiment Analysis Get sentiment analysis of 10-K and 10-Q filings from SEC. An abnormal increase in the number of positive/negative words in filings can signal a significant change in the company's stock price in the upcoming 4 quarters. We make use of <a href= "https://sraf.nd.edu/textual-analysis/resources/" target="_blank">Loughran and McDonald Sentiment Word Lists</a> to calculate the sentiment for each filing.

Parameters

  • connection (FinnhubAPI.Connection): Connection to server
  • access_number (String.t): Access number of a specific report you want to retrieve data from.
  • opts (keyword): Optional parameters

Returns

  • {:ok, FinnhubAPI.Model.SecSentimentAnalysis.t} on success
  • {:error, Tesla.Env.t} on failure
Link to this function

financials(connection, symbol, statement, freq, opts \\ [])

View Source
@spec financials(Tesla.Env.client(), String.t(), String.t(), String.t(), keyword()) ::
  {:ok, FinnhubAPI.Model.FinancialStatements.t()} | {:error, Tesla.Env.t()}

Financial Statements

Get standardized balance sheet, income statement and cash flow for global companies going back 30+ years. Data is sourced from original filings most of which made available through SEC Filings and International Filings endpoints.

Parameters

  • connection (FinnhubAPI.Connection): Connection to server
  • symbol (String.t): Symbol of the company: AAPL.
  • statement (String.t): Statement can take 1 of these values <code>bs, ic, cf</code> for Balance Sheet, Income Statement, Cash Flow respectively.
  • freq (String.t): Frequency can take 1 of these values <code>annual, quarterly, ttm, ytd</code>. TTM (Trailing Twelve Months) option is available for Income Statement and Cash Flow. YTD (Year To Date) option is only available for Cash Flow.
  • opts (keyword): Optional parameters

Returns

  • {:ok, FinnhubAPI.Model.FinancialStatements.t} on success
  • {:error, Tesla.Env.t} on failure
Link to this function

financials_reported(connection, opts \\ [])

View Source
@spec financials_reported(
  Tesla.Env.client(),
  keyword()
) :: {:ok, FinnhubAPI.Model.FinancialsAsReported.t()} | {:error, Tesla.Env.t()}

Financials As Reported Get financials as reported. This data is available for bulk download on <a href="https://www.kaggle.com/finnhub/reported-financials" target="_blank">Kaggle SEC Financials database</a>.

Parameters

  • connection (FinnhubAPI.Connection): Connection to server
  • opts (keyword): Optional parameters
    • :symbol (String.t): Symbol.
    • :cik (String.t): CIK.
    • :accessNumber (String.t): Access number of a specific report you want to retrieve financials from.
    • :freq (String.t): Frequency. Can be either <code>annual</code> or <code>quarterly</code>. Default to <code>annual</code>.
    • :from (Date.t): From date <code>YYYY-MM-DD</code>. Filter for endDate.
    • :to (Date.t): To date <code>YYYY-MM-DD</code>. Filter for endDate.

Returns

  • {:ok, FinnhubAPI.Model.FinancialsAsReported.t} on success
  • {:error, Tesla.Env.t} on failure
Link to this function

forex_candles(connection, symbol, resolution, from, to, opts \\ [])

View Source
@spec forex_candles(
  Tesla.Env.client(),
  String.t(),
  String.t(),
  integer(),
  integer(),
  keyword()
) ::
  {:ok, FinnhubAPI.Model.ForexCandles.t()} | {:error, Tesla.Env.t()}

Forex Candles Get candlestick data for forex symbols.

Parameters

  • connection (FinnhubAPI.Connection): Connection to server
  • symbol (String.t): Use symbol returned in <code>/forex/symbol</code> endpoint for this field.
  • resolution (String.t): Supported resolution includes <code>1, 5, 15, 30, 60, D, W, M </code>.Some timeframes might not be available depending on the exchange.
  • from (integer()): UNIX timestamp. Interval initial value.
  • to (integer()): UNIX timestamp. Interval end value.
  • opts (keyword): Optional parameters

Returns

  • {:ok, FinnhubAPI.Model.ForexCandles.t} on success
  • {:error, Tesla.Env.t} on failure
Link to this function

forex_exchanges(connection, opts \\ [])

View Source
@spec forex_exchanges(
  Tesla.Env.client(),
  keyword()
) :: {:ok, [String.t()]} | {:error, Tesla.Env.t()}

Forex Exchanges List supported forex exchanges

Parameters

  • connection (FinnhubAPI.Connection): Connection to server
  • opts (keyword): Optional parameters

Returns

  • {:ok, [%String{}, ...]} on success
  • {:error, Tesla.Env.t} on failure
Link to this function

forex_rates(connection, opts \\ [])

View Source
@spec forex_rates(
  Tesla.Env.client(),
  keyword()
) :: {:ok, FinnhubAPI.Model.Forexrates.t()} | {:error, Tesla.Env.t()}

Forex rates Get rates for all forex pairs. Ideal for currency conversion

Parameters

  • connection (FinnhubAPI.Connection): Connection to server
  • opts (keyword): Optional parameters
    • :base (String.t): Base currency. Default to EUR.
    • :date (String.t): Date. Leave blank to get the latest data.

Returns

  • {:ok, FinnhubAPI.Model.Forexrates.t} on success
  • {:error, Tesla.Env.t} on failure
Link to this function

forex_symbols(connection, exchange, opts \\ [])

View Source
@spec forex_symbols(Tesla.Env.client(), String.t(), keyword()) ::
  {:ok, [FinnhubAPI.Model.ForexSymbol.t()]} | {:error, Tesla.Env.t()}

Forex Symbol List supported forex symbols.

Parameters

  • connection (FinnhubAPI.Connection): Connection to server
  • exchange (String.t): Exchange you want to get the list of symbols from.
  • opts (keyword): Optional parameters

Returns

  • {:ok, [%ForexSymbol{}, ...]} on success
  • {:error, Tesla.Env.t} on failure
Link to this function

fund_ownership(connection, symbol, opts \\ [])

View Source
@spec fund_ownership(Tesla.Env.client(), String.t(), keyword()) ::
  {:ok, FinnhubAPI.Model.FundOwnership.t()} | {:error, Tesla.Env.t()}

Fund Ownership Get a full list fund and institutional investors of a company in descending order of the number of shares held. Data is sourced from <code>13F form</code>, <code>Schedule 13D</code> and <code>13G</code> for US market, <code>UK Share Register</code> for UK market, <code>SEDI</code> for Canadian market and equivalent filings for other international markets.

Parameters

  • connection (FinnhubAPI.Connection): Connection to server
  • symbol (String.t): Symbol of the company: AAPL.
  • opts (keyword): Optional parameters
    • :limit (integer()): Limit number of results. Leave empty to get the full list.

Returns

  • {:ok, FinnhubAPI.Model.FundOwnership.t} on success
  • {:error, Tesla.Env.t} on failure
Link to this function

global_filings_download(connection, document_id, opts \\ [])

View Source
@spec global_filings_download(Tesla.Env.client(), String.t(), keyword()) ::
  {:error, Tesla.Env.t()}

Download Filings

Download filings using document ids.

Parameters

  • connection (FinnhubAPI.Connection): Connection to server
  • document_id (String.t): Document's id. Note that this is different from filingId as 1 filing can contain multiple documents.
  • opts (keyword): Optional parameters

Returns

  • {:ok, nil} on success
  • {:error, Tesla.Env.t} on failure
Link to this function

global_filings_search(connection, opts \\ [])

View Source
@spec global_filings_search(
  Tesla.Env.client(),
  keyword()
) :: {:ok, FinnhubAPI.Model.SearchResponse.t()} | {:error, Tesla.Env.t()}

Global Filings Search

Search for best-matched filings across global companies' filings, transcripts and press releases. You can filter by anything from symbol, ISIN to form type, and document sources.

Parameters

  • connection (FinnhubAPI.Connection): Connection to server
  • opts (keyword): Optional parameters
    • :body (SearchBody): Search body

Returns

  • {:ok, FinnhubAPI.Model.SearchResponse.t} on success
  • {:error, Tesla.Env.t} on failure
Link to this function

global_filings_search_filter(connection, field, opts \\ [])

View Source
@spec global_filings_search_filter(Tesla.Env.client(), String.t(), keyword()) ::
  {:ok, FinnhubAPI.Model.SearchFilter.t()} | {:error, Tesla.Env.t()}

Search Filter

Get available values for each filter in search body.

Parameters

  • connection (FinnhubAPI.Connection): Connection to server
  • field (String.t): Field to get available filters. Available filters are "countries", "exchanges", "exhibits", "forms", "gics", "naics", "caps", "acts", and "sort".
  • opts (keyword): Optional parameters
    • :source (String.t): Get available forms for each source.

Returns

  • {:ok, FinnhubAPI.Model.SearchFilter.t} on success
  • {:error, Tesla.Env.t} on failure
Link to this function

indices_constituents(connection, symbol, opts \\ [])

View Source
@spec indices_constituents(Tesla.Env.client(), String.t(), keyword()) ::
  {:ok, FinnhubAPI.Model.IndicesConstituents.t()} | {:error, Tesla.Env.t()}

Indices Constituents Get a list of index's constituents. A list of supported indices for this endpoint can be found <a href="/api/v1/index/list?token=" target="_blank">here</a>.

Parameters

  • connection (FinnhubAPI.Connection): Connection to server
  • symbol (String.t): symbol
  • opts (keyword): Optional parameters

Returns

  • {:ok, FinnhubAPI.Model.IndicesConstituents.t} on success
  • {:error, Tesla.Env.t} on failure
Link to this function

indices_historical_constituents(connection, symbol, opts \\ [])

View Source
@spec indices_historical_constituents(Tesla.Env.client(), String.t(), keyword()) ::
  {:ok, FinnhubAPI.Model.IndicesHistoricalConstituents.t()}
  | {:error, Tesla.Env.t()}

Indices Historical Constituents Get full history of index's constituents including symbols and dates of joining and leaving the Index. Currently support <code>^GSPC</code>, <code>^NDX</code>, <code>^DJI</code>

Parameters

  • connection (FinnhubAPI.Connection): Connection to server
  • symbol (String.t): symbol
  • opts (keyword): Optional parameters

Returns

  • {:ok, FinnhubAPI.Model.IndicesHistoricalConstituents.t} on success
  • {:error, Tesla.Env.t} on failure
Link to this function

insider_sentiment(connection, symbol, from, to, opts \\ [])

View Source
@spec insider_sentiment(Tesla.Env.client(), String.t(), Date.t(), Date.t(), keyword()) ::
  {:ok, FinnhubAPI.Model.InsiderSentiments.t()} | {:error, Tesla.Env.t()}

Insider Sentiment Get insider sentiment data for US companies calculated using method discussed <a href="https://medium.com/@stock-api/finnhub-insiders-sentiment-analysis-cc43f9f64b3a" target="_blank">here</a>. The MSPR ranges from -100 for the most negative to 100 for the most positive which can signal price changes in the coming 30-90 days.

Parameters

  • connection (FinnhubAPI.Connection): Connection to server
  • symbol (String.t): Symbol of the company: AAPL.
  • from (Date.t): From date: 2020-03-15.
  • to (Date.t): To date: 2020-03-16.
  • opts (keyword): Optional parameters

Returns

  • {:ok, FinnhubAPI.Model.InsiderSentiments.t} on success
  • {:error, Tesla.Env.t} on failure
Link to this function

insider_transactions(connection, symbol, opts \\ [])

View Source
@spec insider_transactions(Tesla.Env.client(), String.t(), keyword()) ::
  {:ok, FinnhubAPI.Model.InsiderTransactions.t()} | {:error, Tesla.Env.t()}

Insider Transactions Company insider transactions data sourced from <code>Form 3,4,5</code>, SEDI and relevant companies' filings. This endpoint covers US, UK, Canada, Australia, India, and all major EU markets. Limit to 100 transactions per API call.

Parameters

  • connection (FinnhubAPI.Connection): Connection to server
  • symbol (String.t): Symbol of the company: AAPL. Leave this param blank to get the latest transactions.
  • opts (keyword): Optional parameters
    • :from (Date.t): From date: 2020-03-15.
    • :to (Date.t): To date: 2020-03-16.

Returns

  • {:ok, FinnhubAPI.Model.InsiderTransactions.t} on success
  • {:error, Tesla.Env.t} on failure
Link to this function

institutional_ownership(connection, symbol, cusip, from, to, opts \\ [])

View Source
@spec institutional_ownership(
  Tesla.Env.client(),
  String.t(),
  String.t(),
  String.t(),
  String.t(),
  keyword()
) ::
  {:ok, FinnhubAPI.Model.InstitutionalOwnership.t()} | {:error, Tesla.Env.t()}

Institutional Ownership Get a list institutional investors' positions for a particular stock overtime. Data from 13-F filings. Limit to 1 year of data at a time.

Parameters

  • connection (FinnhubAPI.Connection): Connection to server
  • symbol (String.t): Filter by symbol.
  • cusip (String.t): Filter by CUSIP.
  • from (String.t): From date <code>YYYY-MM-DD</code>.
  • to (String.t): To date <code>YYYY-MM-DD</code>.
  • opts (keyword): Optional parameters

Returns

  • {:ok, FinnhubAPI.Model.InstitutionalOwnership.t} on success
  • {:error, Tesla.Env.t} on failure
Link to this function

institutional_portfolio(connection, cik, from, to, opts \\ [])

View Source
@spec institutional_portfolio(
  Tesla.Env.client(),
  String.t(),
  String.t(),
  String.t(),
  keyword()
) ::
  {:ok, FinnhubAPI.Model.InstitutionalPortfolio.t()} | {:error, Tesla.Env.t()}

Institutional Portfolio Get the holdings/portfolio data of institutional investors from 13-F filings. Limit to 1 year of data at a time. You can get a list of supported CIK <a href="/api/v1/institutional/list?token=" target="_blank">here</a>.

Parameters

  • connection (FinnhubAPI.Connection): Connection to server
  • cik (String.t): Fund's CIK.
  • from (String.t): From date <code>YYYY-MM-DD</code>.
  • to (String.t): To date <code>YYYY-MM-DD</code>.
  • opts (keyword): Optional parameters

Returns

  • {:ok, FinnhubAPI.Model.InstitutionalPortfolio.t} on success
  • {:error, Tesla.Env.t} on failure
Link to this function

institutional_profile(connection, opts \\ [])

View Source
@spec institutional_profile(
  Tesla.Env.client(),
  keyword()
) :: {:ok, FinnhubAPI.Model.InstitutionalProfile.t()} | {:error, Tesla.Env.t()}

Institutional Profile Get a list of well-known institutional investors. Currently support 60+ profiles.

Parameters

  • connection (FinnhubAPI.Connection): Connection to server
  • opts (keyword): Optional parameters
    • :cik (String.t): Filter by CIK. Leave blank to get the full list.

Returns

  • {:ok, FinnhubAPI.Model.InstitutionalProfile.t} on success
  • {:error, Tesla.Env.t} on failure
Link to this function

international_filings(connection, opts \\ [])

View Source
@spec international_filings(
  Tesla.Env.client(),
  keyword()
) :: {:ok, [FinnhubAPI.Model.InternationalFiling.t()]} | {:error, Tesla.Env.t()}

International Filings List filings for international companies. Limit to 250 documents at a time. These are the documents we use to source our fundamental data. Only support SEDAR and UK Companies House for normal usage. Enterprise clients who need access to the full filings for global markets should contact us for the access.

Parameters

  • connection (FinnhubAPI.Connection): Connection to server
  • opts (keyword): Optional parameters
    • :symbol (String.t): Symbol. Leave empty to list latest filings.
    • :country (String.t): Filter by country using country's 2-letter code.

Returns

  • {:ok, [%InternationalFiling{}, ...]} on success
  • {:error, Tesla.Env.t} on failure
Link to this function

investment_themes(connection, theme, opts \\ [])

View Source
@spec investment_themes(Tesla.Env.client(), String.t(), keyword()) ::
  {:ok, FinnhubAPI.Model.InvestmentThemes.t()} | {:error, Tesla.Env.t()}

Investment Themes (Thematic Investing)

Thematic investing involves creating a portfolio (or portion of a portfolio) by gathering together a collection of companies involved in certain areas that you predict will generate above-market returns over the long term. Themes can be based on a concept such as ageing populations or a sub-sector such as robotics, and drones. Thematic investing focuses on predicted long-term trends rather than specific companies or sectors, enabling investors to access structural, one-off shifts that can change an entire industry.

Parameters

Returns

  • {:ok, FinnhubAPI.Model.InvestmentThemes.t} on success
  • {:error, Tesla.Env.t} on failure
Link to this function

ipo_calendar(connection, from, to, opts \\ [])

View Source
@spec ipo_calendar(Tesla.Env.client(), Date.t(), Date.t(), keyword()) ::
  {:ok, FinnhubAPI.Model.IpoCalendar.t()} | {:error, Tesla.Env.t()}

IPO Calendar Get recent and upcoming IPO.

Parameters

  • connection (FinnhubAPI.Connection): Connection to server
  • from (Date.t): From date: 2020-03-15.
  • to (Date.t): To date: 2020-03-16.
  • opts (keyword): Optional parameters

Returns

  • {:ok, FinnhubAPI.Model.IpoCalendar.t} on success
  • {:error, Tesla.Env.t} on failure
Link to this function

isin_change(connection, from, to, opts \\ [])

View Source
@spec isin_change(Tesla.Env.client(), String.t(), String.t(), keyword()) ::
  {:ok, FinnhubAPI.Model.IsinChange.t()} | {:error, Tesla.Env.t()}

ISIN Change Get a list of ISIN changes for EU-listed securities. Limit to 2000 events at a time.

Parameters

  • connection (FinnhubAPI.Connection): Connection to server
  • from (String.t): From date <code>YYYY-MM-DD</code>.
  • to (String.t): To date <code>YYYY-MM-DD</code>.
  • opts (keyword): Optional parameters

Returns

  • {:ok, FinnhubAPI.Model.IsinChange.t} on success
  • {:error, Tesla.Env.t} on failure
Link to this function

market_holiday(connection, exchange, opts \\ [])

View Source
@spec market_holiday(Tesla.Env.client(), String.t(), keyword()) ::
  {:ok, FinnhubAPI.Model.MarketHoliday.t()} | {:error, Tesla.Env.t()}

Market Holiday Get a list of holidays for global exchanges.

Parameters

  • connection (FinnhubAPI.Connection): Connection to server
  • exchange (String.t): Exchange code.
  • opts (keyword): Optional parameters

Returns

  • {:ok, FinnhubAPI.Model.MarketHoliday.t} on success
  • {:error, Tesla.Env.t} on failure
Link to this function

market_news(connection, category, opts \\ [])

View Source
@spec market_news(Tesla.Env.client(), String.t(), keyword()) ::
  {:ok, [FinnhubAPI.Model.MarketNews.t()]} | {:error, Tesla.Env.t()}

Market News Get latest market news.

Parameters

  • connection (FinnhubAPI.Connection): Connection to server
  • category (String.t): This parameter can be 1 of the following values <code>general, forex, crypto, merger</code>.
  • opts (keyword): Optional parameters
    • :minId (integer()): Use this field to get only news after this ID. Default to 0

Returns

  • {:ok, [%MarketNews{}, ...]} on success
  • {:error, Tesla.Env.t} on failure
Link to this function

market_status(connection, exchange, opts \\ [])

View Source
@spec market_status(Tesla.Env.client(), String.t(), keyword()) ::
  {:ok, FinnhubAPI.Model.MarketStatus.t()} | {:error, Tesla.Env.t()}

Market Status Get current market status for global exchanges (whether exchanges are open or close).

Parameters

  • connection (FinnhubAPI.Connection): Connection to server
  • exchange (String.t): Exchange code.
  • opts (keyword): Optional parameters

Returns

  • {:ok, FinnhubAPI.Model.MarketStatus.t} on success
  • {:error, Tesla.Env.t} on failure
Link to this function

mutual_fund_country_exposure(connection, opts \\ [])

View Source
@spec mutual_fund_country_exposure(
  Tesla.Env.client(),
  keyword()
) ::
  {:ok, FinnhubAPI.Model.MutualFundCountryExposure.t()}
  | {:error, Tesla.Env.t()}

Mutual Funds Country Exposure Get Mutual Funds country exposure data.

Parameters

  • connection (FinnhubAPI.Connection): Connection to server
  • opts (keyword): Optional parameters
    • :symbol (String.t): Symbol.
    • :isin (String.t): Fund's isin.

Returns

  • {:ok, FinnhubAPI.Model.MutualFundCountryExposure.t} on success
  • {:error, Tesla.Env.t} on failure
Link to this function

mutual_fund_eet(connection, isin, opts \\ [])

View Source
@spec mutual_fund_eet(Tesla.Env.client(), String.t(), keyword()) ::
  {:ok, FinnhubAPI.Model.MutualFundEet.t()} | {:error, Tesla.Env.t()}

Mutual Funds EET Get EET data for EU funds. For PAIs data, please see the EET PAI endpoint.

Parameters

  • connection (FinnhubAPI.Connection): Connection to server
  • isin (String.t): ISIN.
  • opts (keyword): Optional parameters

Returns

  • {:ok, FinnhubAPI.Model.MutualFundEet.t} on success
  • {:error, Tesla.Env.t} on failure
Link to this function

mutual_fund_eet_pai(connection, isin, opts \\ [])

View Source
@spec mutual_fund_eet_pai(Tesla.Env.client(), String.t(), keyword()) ::
  {:ok, FinnhubAPI.Model.MutualFundEetPai.t()} | {:error, Tesla.Env.t()}

Mutual Funds EET PAI Get EET PAI data for EU funds.

Parameters

  • connection (FinnhubAPI.Connection): Connection to server
  • isin (String.t): ISIN.
  • opts (keyword): Optional parameters

Returns

  • {:ok, FinnhubAPI.Model.MutualFundEetPai.t} on success
  • {:error, Tesla.Env.t} on failure
Link to this function

mutual_fund_holdings(connection, opts \\ [])

View Source
@spec mutual_fund_holdings(
  Tesla.Env.client(),
  keyword()
) :: {:ok, FinnhubAPI.Model.MutualFundHoldings.t()} | {:error, Tesla.Env.t()}

Mutual Funds Holdings Get full Mutual Funds holdings/constituents. This endpoint covers both US and global mutual funds. For international funds, you must query the data using ISIN. A list of supported funds can be found <a href="/api/v1/mutual-fund/list?token=" target="_blank">here</a>.

Parameters

  • connection (FinnhubAPI.Connection): Connection to server
  • opts (keyword): Optional parameters
    • :symbol (String.t): Fund's symbol.
    • :isin (String.t): Fund's isin.
    • :skip (integer()): Skip the first n results. You can use this parameter to query historical constituents data. The latest result is returned if skip=0 or not set.

Returns

  • {:ok, FinnhubAPI.Model.MutualFundHoldings.t} on success
  • {:error, Tesla.Env.t} on failure
Link to this function

mutual_fund_profile(connection, opts \\ [])

View Source
@spec mutual_fund_profile(
  Tesla.Env.client(),
  keyword()
) :: {:ok, FinnhubAPI.Model.MutualFundProfile.t()} | {:error, Tesla.Env.t()}

Mutual Funds Profile Get mutual funds profile information. This endpoint covers both US and global mutual funds. For international funds, you must query the data using ISIN. A list of supported funds can be found <a href="/api/v1/mutual-fund/list?token=" target="_blank">here</a>.

Parameters

  • connection (FinnhubAPI.Connection): Connection to server
  • opts (keyword): Optional parameters
    • :symbol (String.t): Fund's symbol.
    • :isin (String.t): Fund's isin.

Returns

  • {:ok, FinnhubAPI.Model.MutualFundProfile.t} on success
  • {:error, Tesla.Env.t} on failure
Link to this function

mutual_fund_sector_exposure(connection, opts \\ [])

View Source
@spec mutual_fund_sector_exposure(
  Tesla.Env.client(),
  keyword()
) ::
  {:ok, FinnhubAPI.Model.MutualFundSectorExposure.t()} | {:error, Tesla.Env.t()}

Mutual Funds Sector Exposure Get Mutual Funds sector exposure data.

Parameters

  • connection (FinnhubAPI.Connection): Connection to server
  • opts (keyword): Optional parameters
    • :symbol (String.t): Mutual Fund symbol.
    • :isin (String.t): Fund's isin.

Returns

  • {:ok, FinnhubAPI.Model.MutualFundSectorExposure.t} on success
  • {:error, Tesla.Env.t} on failure
Link to this function

news_sentiment(connection, symbol, opts \\ [])

View Source
@spec news_sentiment(Tesla.Env.client(), String.t(), keyword()) ::
  {:ok, FinnhubAPI.Model.NewsSentiment.t()} | {:error, Tesla.Env.t()}

News Sentiment Get company's news sentiment and statistics. This endpoint is only available for US companies.

Parameters

  • connection (FinnhubAPI.Connection): Connection to server
  • symbol (String.t): Company symbol.
  • opts (keyword): Optional parameters

Returns

  • {:ok, FinnhubAPI.Model.NewsSentiment.t} on success
  • {:error, Tesla.Env.t} on failure
Link to this function

ownership(connection, symbol, opts \\ [])

View Source
@spec ownership(Tesla.Env.client(), String.t(), keyword()) ::
  {:ok, FinnhubAPI.Model.Ownership.t()} | {:error, Tesla.Env.t()}

Ownership Get a full list of shareholders of a company in descending order of the number of shares held. Data is sourced from <code>13F form</code>, <code>Schedule 13D</code> and <code>13G</code> for US market, <code>UK Share Register</code> for UK market, <code>SEDI</code> for Canadian market and equivalent filings for other international markets.

Parameters

  • connection (FinnhubAPI.Connection): Connection to server
  • symbol (String.t): Symbol of the company: AAPL.
  • opts (keyword): Optional parameters
    • :limit (integer()): Limit number of results. Leave empty to get the full list.

Returns

  • {:ok, FinnhubAPI.Model.Ownership.t} on success
  • {:error, Tesla.Env.t} on failure
Link to this function

pattern_recognition(connection, symbol, resolution, opts \\ [])

View Source
@spec pattern_recognition(Tesla.Env.client(), String.t(), String.t(), keyword()) ::
  {:ok, FinnhubAPI.Model.PatternRecognition.t()} | {:error, Tesla.Env.t()}

Pattern Recognition Run pattern recognition algorithm on a symbol. Support double top/bottom, triple top/bottom, head and shoulders, triangle, wedge, channel, flag, and candlestick patterns.

Parameters

  • connection (FinnhubAPI.Connection): Connection to server
  • symbol (String.t): Symbol
  • resolution (String.t): Supported resolution includes <code>1, 5, 15, 30, 60, D, W, M </code>.Some timeframes might not be available depending on the exchange.
  • opts (keyword): Optional parameters

Returns

  • {:ok, FinnhubAPI.Model.PatternRecognition.t} on success
  • {:error, Tesla.Env.t} on failure
Link to this function

press_releases(connection, symbol, opts \\ [])

View Source
@spec press_releases(Tesla.Env.client(), String.t(), keyword()) ::
  {:ok, FinnhubAPI.Model.PressRelease.t()} | {:error, Tesla.Env.t()}

Major Press Releases

Get latest major press releases of a company. This data can be used to highlight the most significant events comprised of mostly press releases sourced from the exchanges, BusinessWire, AccessWire, GlobeNewswire, Newsfile, and PRNewswire.

Parameters

  • connection (FinnhubAPI.Connection): Connection to server
  • symbol (String.t): Company symbol.
  • opts (keyword): Optional parameters
    • :from (Date.t): From time: 2020-01-01.
    • :to (Date.t): To time: 2020-01-05.

Returns

  • {:ok, FinnhubAPI.Model.PressRelease.t} on success
  • {:error, Tesla.Env.t} on failure
Link to this function

price_metrics(connection, symbol, opts \\ [])

View Source
@spec price_metrics(Tesla.Env.client(), String.t(), keyword()) ::
  {:ok, FinnhubAPI.Model.PriceMetrics.t()} | {:error, Tesla.Env.t()}

Price Metrics Get company price performance statistics such as 52-week high/low, YTD return and much more.

Parameters

  • connection (FinnhubAPI.Connection): Connection to server
  • symbol (String.t): Symbol of the company: AAPL.
  • opts (keyword): Optional parameters
    • :date (String.t): Get data on a specific date in the past. The data is available weekly so your date will be automatically adjusted to the last day of that week.

Returns

  • {:ok, FinnhubAPI.Model.PriceMetrics.t} on success
  • {:error, Tesla.Env.t} on failure
Link to this function

price_target(connection, symbol, opts \\ [])

View Source
@spec price_target(Tesla.Env.client(), String.t(), keyword()) ::
  {:ok, FinnhubAPI.Model.PriceTarget.t()} | {:error, Tesla.Env.t()}

Price Target Get latest price target consensus.

Parameters

  • connection (FinnhubAPI.Connection): Connection to server
  • symbol (String.t): Symbol of the company: AAPL.
  • opts (keyword): Optional parameters

Returns

  • {:ok, FinnhubAPI.Model.PriceTarget.t} on success
  • {:error, Tesla.Env.t} on failure
Link to this function

quote(connection, symbol, opts \\ [])

View Source
@spec quote(Tesla.Env.client(), String.t(), keyword()) ::
  {:ok, FinnhubAPI.Model.Quote.t()} | {:error, Tesla.Env.t()}

Quote

Get real-time quote data for US stocks. Constant polling is not recommended. Use websocket if you need real-time updates.

Parameters

  • connection (FinnhubAPI.Connection): Connection to server
  • symbol (String.t): Symbol
  • opts (keyword): Optional parameters

Returns

  • {:ok, FinnhubAPI.Model.Quote.t} on success
  • {:error, Tesla.Env.t} on failure
Link to this function

recommendation_trends(connection, symbol, opts \\ [])

View Source
@spec recommendation_trends(Tesla.Env.client(), String.t(), keyword()) ::
  {:ok, [FinnhubAPI.Model.RecommendationTrend.t()]} | {:error, Tesla.Env.t()}

Recommendation Trends Get latest analyst recommendation trends for a company.

Parameters

  • connection (FinnhubAPI.Connection): Connection to server
  • symbol (String.t): Symbol of the company: AAPL.
  • opts (keyword): Optional parameters

Returns

  • {:ok, [%RecommendationTrend{}, ...]} on success
  • {:error, Tesla.Env.t} on failure
Link to this function

revenue_breakdown(connection, opts \\ [])

View Source
@spec revenue_breakdown(
  Tesla.Env.client(),
  keyword()
) :: {:ok, FinnhubAPI.Model.RevenueBreakdown.t()} | {:error, Tesla.Env.t()}

Revenue Breakdown Get revenue breakdown by product. This dataset is only available for US companies which disclose their revenue breakdown in the annual or quarterly reports.

Parameters

  • connection (FinnhubAPI.Connection): Connection to server
  • opts (keyword): Optional parameters
    • :symbol (String.t): Symbol.
    • :cik (String.t): CIK.

Returns

  • {:ok, FinnhubAPI.Model.RevenueBreakdown.t} on success
  • {:error, Tesla.Env.t} on failure
Link to this function

search_in_filing(connection, opts \\ [])

View Source
@spec search_in_filing(
  Tesla.Env.client(),
  keyword()
) :: {:ok, FinnhubAPI.Model.InFilingResponse.t()} | {:error, Tesla.Env.t()}

Search In Filing

Get a list of excerpts and highlight positions within a document using your query.

Parameters

  • connection (FinnhubAPI.Connection): Connection to server
  • opts (keyword): Optional parameters
    • :body (InFilingSearchBody): Search body

Returns

  • {:ok, FinnhubAPI.Model.InFilingResponse.t} on success
  • {:error, Tesla.Env.t} on failure
Link to this function

sector_metric(connection, region, opts \\ [])

View Source
@spec sector_metric(Tesla.Env.client(), String.t(), keyword()) ::
  {:ok, FinnhubAPI.Model.SectorMetric.t()} | {:error, Tesla.Env.t()}

Sector Metrics Get ratios for different sectors and regions/indices.

Parameters

Returns

  • {:ok, FinnhubAPI.Model.SectorMetric.t} on success
  • {:error, Tesla.Env.t} on failure
Link to this function

similarity_index(connection, opts \\ [])

View Source
@spec similarity_index(
  Tesla.Env.client(),
  keyword()
) :: {:ok, FinnhubAPI.Model.SimilarityIndex.t()} | {:error, Tesla.Env.t()}

Similarity Index

Calculate the textual difference between a company's 10-K / 10-Q reports and the same type of report in the previous year using Cosine Similarity. For example, this endpoint compares 2019's 10-K with 2018's 10-K. Companies breaking from its routines in disclosure of financial condition and risk analysis section can signal a significant change in the company's stock price in the upcoming 4 quarters.

Parameters

  • connection (FinnhubAPI.Connection): Connection to server
  • opts (keyword): Optional parameters
    • :symbol (String.t): Symbol. Required if cik is empty
    • :cik (String.t): CIK. Required if symbol is empty
    • :freq (String.t): <code>annual</code> or <code>quarterly</code>. Default to <code>annual</code>

Returns

  • {:ok, FinnhubAPI.Model.SimilarityIndex.t} on success
  • {:error, Tesla.Env.t} on failure
Link to this function

social_sentiment(connection, symbol, opts \\ [])

View Source
@spec social_sentiment(Tesla.Env.client(), String.t(), keyword()) ::
  {:ok, FinnhubAPI.Model.SocialSentiment.t()} | {:error, Tesla.Env.t()}

Social Sentiment

Get social sentiment for stocks on Reddit and Twitter.

Parameters

  • connection (FinnhubAPI.Connection): Connection to server
  • symbol (String.t): Company symbol.
  • opts (keyword): Optional parameters
    • :from (Date.t): From date <code>YYYY-MM-DD</code>.
    • :to (Date.t): To date <code>YYYY-MM-DD</code>.

Returns

  • {:ok, FinnhubAPI.Model.SocialSentiment.t} on success
  • {:error, Tesla.Env.t} on failure
Link to this function

stock_basic_dividends(connection, symbol, opts \\ [])

View Source
@spec stock_basic_dividends(Tesla.Env.client(), String.t(), keyword()) ::
  {:ok, FinnhubAPI.Model.Dividends2.t()} | {:error, Tesla.Env.t()}

Dividends 2 (Basic) Get global dividends data.

Parameters

  • connection (FinnhubAPI.Connection): Connection to server
  • symbol (String.t): Symbol.
  • opts (keyword): Optional parameters

Returns

  • {:ok, FinnhubAPI.Model.Dividends2.t} on success
  • {:error, Tesla.Env.t} on failure
Link to this function

stock_bidask(connection, symbol, opts \\ [])

View Source
@spec stock_bidask(Tesla.Env.client(), String.t(), keyword()) ::
  {:ok, FinnhubAPI.Model.LastBidAsk.t()} | {:error, Tesla.Env.t()}

Last Bid-Ask Get last bid/ask data for US stocks.

Parameters

  • connection (FinnhubAPI.Connection): Connection to server
  • symbol (String.t): Symbol.
  • opts (keyword): Optional parameters

Returns

  • {:ok, FinnhubAPI.Model.LastBidAsk.t} on success
  • {:error, Tesla.Env.t} on failure
Link to this function

stock_candles(connection, symbol, resolution, from, to, opts \\ [])

View Source
@spec stock_candles(
  Tesla.Env.client(),
  String.t(),
  String.t(),
  integer(),
  integer(),
  keyword()
) ::
  {:ok, FinnhubAPI.Model.StockCandles.t()} | {:error, Tesla.Env.t()}

Stock Candles

Get candlestick data (OHLCV) for stocks.

Parameters

  • connection (FinnhubAPI.Connection): Connection to server
  • symbol (String.t): Symbol.
  • resolution (String.t): Supported resolution includes <code>1, 5, 15, 30, 60, D, W, M </code>.Some timeframes might not be available depending on the exchange.
  • from (integer()): UNIX timestamp. Interval initial value.
  • to (integer()): UNIX timestamp. Interval end value.
  • opts (keyword): Optional parameters

Returns

  • {:ok, FinnhubAPI.Model.StockCandles.t} on success
  • {:error, Tesla.Env.t} on failure
Link to this function

stock_dividends(connection, symbol, from, to, opts \\ [])

View Source
@spec stock_dividends(Tesla.Env.client(), String.t(), Date.t(), Date.t(), keyword()) ::
  {:ok, [FinnhubAPI.Model.Dividends.t()]} | {:error, Tesla.Env.t()}

Dividends Get dividends data for common stocks going back 30 years.

Parameters

  • connection (FinnhubAPI.Connection): Connection to server
  • symbol (String.t): Symbol.
  • from (Date.t): YYYY-MM-DD.
  • to (Date.t): YYYY-MM-DD.
  • opts (keyword): Optional parameters

Returns

  • {:ok, [%Dividends{}, ...]} on success
  • {:error, Tesla.Env.t} on failure
Link to this function

stock_lobbying(connection, symbol, from, to, opts \\ [])

View Source
@spec stock_lobbying(Tesla.Env.client(), String.t(), Date.t(), Date.t(), keyword()) ::
  {:ok, FinnhubAPI.Model.LobbyingResult.t()} | {:error, Tesla.Env.t()}

Senate Lobbying Get a list of reported lobbying activities in the Senate and the House.

Parameters

  • connection (FinnhubAPI.Connection): Connection to server
  • symbol (String.t): Symbol.
  • from (Date.t): From date <code>YYYY-MM-DD</code>.
  • to (Date.t): To date <code>YYYY-MM-DD</code>.
  • opts (keyword): Optional parameters

Returns

  • {:ok, FinnhubAPI.Model.LobbyingResult.t} on success
  • {:error, Tesla.Env.t} on failure
Link to this function

stock_nbbo(connection, symbol, date, limit, skip, opts \\ [])

View Source
@spec stock_nbbo(
  Tesla.Env.client(),
  String.t(),
  Date.t(),
  integer(),
  integer(),
  keyword()
) ::
  {:ok, FinnhubAPI.Model.HistoricalNbbo.t()} | {:error, Tesla.Env.t()}

Historical NBBO

Get historical best bid and offer for US stocks, LSE, TSX, Euronext and Deutsche Borse.

Parameters

  • connection (FinnhubAPI.Connection): Connection to server
  • symbol (String.t): Symbol.
  • date (Date.t): Date: 2020-04-02.
  • limit (integer()): Limit number of ticks returned. Maximum value: <code>25000</code>
  • skip (integer()): Number of ticks to skip. Use this parameter to loop through the entire data.
  • opts (keyword): Optional parameters

Returns

  • {:ok, FinnhubAPI.Model.HistoricalNbbo.t} on success
  • {:error, Tesla.Env.t} on failure
Link to this function

stock_splits(connection, symbol, from, to, opts \\ [])

View Source
@spec stock_splits(Tesla.Env.client(), String.t(), Date.t(), Date.t(), keyword()) ::
  {:ok, [FinnhubAPI.Model.Split.t()]} | {:error, Tesla.Env.t()}

Splits Get splits data for stocks.

Parameters

  • connection (FinnhubAPI.Connection): Connection to server
  • symbol (String.t): Symbol.
  • from (Date.t): YYYY-MM-DD.
  • to (Date.t): YYYY-MM-DD.
  • opts (keyword): Optional parameters

Returns

  • {:ok, [%Split{}, ...]} on success
  • {:error, Tesla.Env.t} on failure
Link to this function

stock_symbols(connection, exchange, opts \\ [])

View Source
@spec stock_symbols(Tesla.Env.client(), String.t(), keyword()) ::
  {:ok, [FinnhubAPI.Model.StockSymbol.t()]} | {:error, Tesla.Env.t()}

Stock Symbol List supported stocks. We use the following symbology to identify stocks on Finnhub <code>Exchange_Ticker.Exchange_Code</code>. A list of supported exchange codes can be found <a href="https://docs.google.com/spreadsheets/d/1I3pBxjfXB056-g_JYf_6o3Rns3BV2kMGG1nCatb91ls/edit?usp=sharing" target="_blank">here</a>.

Parameters

Returns

  • {:ok, [%StockSymbol{}, ...]} on success
  • {:error, Tesla.Env.t} on failure
Link to this function

stock_tick(connection, symbol, date, limit, skip, opts \\ [])

View Source
@spec stock_tick(
  Tesla.Env.client(),
  String.t(),
  Date.t(),
  integer(),
  integer(),
  keyword()
) ::
  {:ok, FinnhubAPI.Model.TickData.t()} | {:error, Tesla.Env.t()}

Tick Data

Get historical tick data for global exchanges.

Parameters

  • connection (FinnhubAPI.Connection): Connection to server
  • symbol (String.t): Symbol.
  • date (Date.t): Date: 2020-04-02.
  • limit (integer()): Limit number of ticks returned. Maximum value: <code>25000</code>
  • skip (integer()): Number of ticks to skip. Use this parameter to loop through the entire data.
  • opts (keyword): Optional parameters

Returns

  • {:ok, FinnhubAPI.Model.TickData.t} on success
  • {:error, Tesla.Env.t} on failure
Link to this function

stock_usa_spending(connection, symbol, from, to, opts \\ [])

View Source
@spec stock_usa_spending(
  Tesla.Env.client(),
  String.t(),
  Date.t(),
  Date.t(),
  keyword()
) ::
  {:ok, FinnhubAPI.Model.UsaSpendingResult.t()} | {:error, Tesla.Env.t()}

USA Spending Get a list of government's spending activities from USASpending dataset for public companies. This dataset can help you identify companies that win big government contracts which is extremely important for industries such as Defense, Aerospace, and Education.

Parameters

  • connection (FinnhubAPI.Connection): Connection to server
  • symbol (String.t): Symbol.
  • from (Date.t): From date <code>YYYY-MM-DD</code>. Filter for <code>actionDate</code>
  • to (Date.t): To date <code>YYYY-MM-DD</code>. Filter for <code>actionDate</code>
  • opts (keyword): Optional parameters

Returns

  • {:ok, FinnhubAPI.Model.UsaSpendingResult.t} on success
  • {:error, Tesla.Env.t} on failure
Link to this function

stock_uspto_patent(connection, symbol, from, to, opts \\ [])

View Source
@spec stock_uspto_patent(
  Tesla.Env.client(),
  String.t(),
  Date.t(),
  Date.t(),
  keyword()
) ::
  {:ok, FinnhubAPI.Model.UsptoPatentResult.t()} | {:error, Tesla.Env.t()}

USPTO Patents List USPTO patents for companies. Limit to 250 records per API call.

Parameters

  • connection (FinnhubAPI.Connection): Connection to server
  • symbol (String.t): Symbol.
  • from (Date.t): From date <code>YYYY-MM-DD</code>.
  • to (Date.t): To date <code>YYYY-MM-DD</code>.
  • opts (keyword): Optional parameters

Returns

  • {:ok, FinnhubAPI.Model.UsptoPatentResult.t} on success
  • {:error, Tesla.Env.t} on failure
Link to this function

stock_visa_application(connection, symbol, from, to, opts \\ [])

View Source
@spec stock_visa_application(
  Tesla.Env.client(),
  String.t(),
  Date.t(),
  Date.t(),
  keyword()
) ::
  {:ok, FinnhubAPI.Model.VisaApplicationResult.t()} | {:error, Tesla.Env.t()}

H1-B Visa Application Get a list of H1-B and Permanent visa applications for companies from the DOL. The data is updated quarterly.

Parameters

  • connection (FinnhubAPI.Connection): Connection to server
  • symbol (String.t): Symbol.
  • from (Date.t): From date <code>YYYY-MM-DD</code>. Filter on the <code>beginDate</code> column.
  • to (Date.t): To date <code>YYYY-MM-DD</code>. Filter on the <code>beginDate</code> column.
  • opts (keyword): Optional parameters

Returns

  • {:ok, FinnhubAPI.Model.VisaApplicationResult.t} on success
  • {:error, Tesla.Env.t} on failure
Link to this function

supply_chain_relationships(connection, symbol, opts \\ [])

View Source
@spec supply_chain_relationships(Tesla.Env.client(), String.t(), keyword()) ::
  {:ok, FinnhubAPI.Model.SupplyChainRelationships.t()} | {:error, Tesla.Env.t()}

Supply Chain Relationships

This endpoint provides an overall map of public companies' key customers and suppliers. The data offers a deeper look into a company's supply chain and how products are created. The data will help investors manage risk, limit exposure or generate alpha-generating ideas and trading insights.

Parameters

  • connection (FinnhubAPI.Connection): Connection to server
  • symbol (String.t): Symbol.
  • opts (keyword): Optional parameters

Returns

  • {:ok, FinnhubAPI.Model.SupplyChainRelationships.t} on success
  • {:error, Tesla.Env.t} on failure
Link to this function

support_resistance(connection, symbol, resolution, opts \\ [])

View Source
@spec support_resistance(Tesla.Env.client(), String.t(), String.t(), keyword()) ::
  {:ok, FinnhubAPI.Model.SupportResistance.t()} | {:error, Tesla.Env.t()}

Support/Resistance Get support and resistance levels for a symbol.

Parameters

  • connection (FinnhubAPI.Connection): Connection to server
  • symbol (String.t): Symbol
  • resolution (String.t): Supported resolution includes <code>1, 5, 15, 30, 60, D, W, M </code>.Some timeframes might not be available depending on the exchange.
  • opts (keyword): Optional parameters

Returns

  • {:ok, FinnhubAPI.Model.SupportResistance.t} on success
  • {:error, Tesla.Env.t} on failure
Link to this function

symbol_change(connection, from, to, opts \\ [])

View Source
@spec symbol_change(Tesla.Env.client(), String.t(), String.t(), keyword()) ::
  {:ok, FinnhubAPI.Model.SymbolChange.t()} | {:error, Tesla.Env.t()}

Symbol Change Get a list of symbol changes for US-listed, EU-listed, NSE and ASX securities. Limit to 2000 events at a time.

Parameters

  • connection (FinnhubAPI.Connection): Connection to server
  • from (String.t): From date <code>YYYY-MM-DD</code>.
  • to (String.t): To date <code>YYYY-MM-DD</code>.
  • opts (keyword): Optional parameters

Returns

  • {:ok, FinnhubAPI.Model.SymbolChange.t} on success
  • {:error, Tesla.Env.t} on failure
Link to this function

symbol_search(connection, q, opts \\ [])

View Source
@spec symbol_search(Tesla.Env.client(), String.t(), keyword()) ::
  {:ok, FinnhubAPI.Model.SymbolLookup.t()} | {:error, Tesla.Env.t()}

Symbol Lookup Search for best-matching symbols based on your query. You can input anything from symbol, security's name to ISIN and Cusip.

Parameters

  • connection (FinnhubAPI.Connection): Connection to server
  • q (String.t): Query text can be symbol, name, isin, or cusip.
  • opts (keyword): Optional parameters

Returns

  • {:ok, FinnhubAPI.Model.SymbolLookup.t} on success
  • {:error, Tesla.Env.t} on failure
Link to this function

technical_indicator(connection, symbol, resolution, from, to, indicator, opts \\ [])

View Source
@spec technical_indicator(
  Tesla.Env.client(),
  String.t(),
  String.t(),
  integer(),
  integer(),
  String.t(),
  keyword()
) :: {:ok, Map.t()} | {:error, Tesla.Env.t()}

Technical Indicators Return technical indicator with price data. List of supported indicators can be found <a href="https://docs.google.com/spreadsheets/d/1ylUvKHVYN2E87WdwIza8ROaCpd48ggEl1k5i5SgA29k/edit?usp=sharing" target="_blank">here</a>.

Parameters

Returns

  • {:ok, map()} on success
  • {:error, Tesla.Env.t} on failure
Link to this function

transcripts(connection, id, opts \\ [])

View Source
@spec transcripts(Tesla.Env.client(), String.t(), keyword()) ::
  {:ok, FinnhubAPI.Model.EarningsCallTranscripts.t()} | {:error, Tesla.Env.t()}

Earnings Call Transcripts

Get earnings call transcripts, audio and participants' list. Data is available for US, UK, European, Australian and Canadian companies.

15+ years of data is available with 220,000+ audio which add up to 7TB in size.

Parameters

  • connection (FinnhubAPI.Connection): Connection to server
  • id (String.t): Transcript's id obtained with <a href="#transcripts-list">Transcripts List endpoint</a>.
  • opts (keyword): Optional parameters

Returns

  • {:ok, FinnhubAPI.Model.EarningsCallTranscripts.t} on success
  • {:error, Tesla.Env.t} on failure
Link to this function

transcripts_list(connection, symbol, opts \\ [])

View Source
@spec transcripts_list(Tesla.Env.client(), String.t(), keyword()) ::
  {:ok, FinnhubAPI.Model.EarningsCallTranscriptsList.t()}
  | {:error, Tesla.Env.t()}

Earnings Call Transcripts List List earnings call transcripts' metadata. This endpoint is available for US, UK, European, Australian and Canadian companies.

Parameters

  • connection (FinnhubAPI.Connection): Connection to server
  • symbol (String.t): Company symbol: AAPL. Leave empty to list the latest transcripts
  • opts (keyword): Optional parameters

Returns

  • {:ok, FinnhubAPI.Model.EarningsCallTranscriptsList.t} on success
  • {:error, Tesla.Env.t} on failure
Link to this function

upgrade_downgrade(connection, opts \\ [])

View Source
@spec upgrade_downgrade(
  Tesla.Env.client(),
  keyword()
) :: {:ok, [FinnhubAPI.Model.UpgradeDowngrade.t()]} | {:error, Tesla.Env.t()}

Stock Upgrade/Downgrade Get latest stock upgrade and downgrade.

Parameters

  • connection (FinnhubAPI.Connection): Connection to server
  • opts (keyword): Optional parameters
    • :symbol (String.t): Symbol of the company: AAPL. If left blank, the API will return latest stock upgrades/downgrades.
    • :from (Date.t): From date: 2000-03-15.
    • :to (Date.t): To date: 2020-03-16.

Returns

  • {:ok, [%UpgradeDowngrade{}, ...]} on success
  • {:error, Tesla.Env.t} on failure