Yahoo Finance API

Yahoo Finance API

If you're looking for an API that can provide you with financial data, Yahoo Finance is a great option. The Yahoo Finance API offers access to a wide range of data, including stock quotes, historical prices, company information, and more.
This makes it the perfect choice for businesses and developers who need to incorporate financial data into their applications or websites. In this article, we'll take a closer look at what the SyncWith Yahoo Finance API has to offer. We'll discuss its features and how you can put it to use in your own projects

What We’ll Cover

  • Overview of the different endpoints
  • Sample queries
  • Sample results
  • Ability to live test the API right in this webpage
That’s right - as an example here’s the quoteSummary/{symbol} endpoint being called - feel free to change the symbol and see what the API endpoint sends back including the raw JSON with the View raw data toggle.

top example

Please fill in any necessary fields and click Run.

GET

Preview

View the API data, get a live Google Sheet dashboard

Current Price
Target - High Price
Target - Low Price
Recommendation
# Analyst Opinions
numberOfAnalystOpinions.longFmt
Total Cash
Cash per Share
EBITDA
Total Debt
Total Revenue
debtToEquity
revenuePerShare
Gross Profit
Free Cash Flow
Revenue Growth
Gross Margins
                 
                 
                 

Get a live Google Sheet

Export your data to a google sheet, with the SyncWith Addon, or download to CSV

Automatically updated

Add data sources

Build reports & dashboards

An Introduction to the Yahoo Finance API

Before we get into its uses, let's break down the specifics of the Yahoo Finance API.

What is the Yahoo Finance API?

The Yahoo Finance API is a RESTful API that provides access to financial data. This data includes stock quotes, historical prices, and company information. The API is free to use and does not require an API key.
The Yahoo Finance API is available in both JSON and XML format. This makes it easy to integrate the data into your applications or websites. You can also access the API through a number of third-party libraries.

What is Yahoo Finance?

Yahoo Finance is a website that provides financial news, data, and analysis. The site also includes a stock ticker and portfolio tracker. Yahoo Finance is one of the most popular finance websites on the internet.

Features of the Yahoo Finance API

One of the most useful features of the Yahoo Finance API is its ability to return historical price data for stocks. This data goes back as far as 1962 and is available for all US stocks and ETFs.
In addition to stock data, the Yahoo Finance API also provides access to currency exchange rates, futures contracts, and market indices.

What Data is Available?

The Yahoo Finance API provides access to a wide range of data, including:
  • Stock prices
  • Company information
  • News headlines
  • Financial reports
  • Currency exchange rates
  • Futures contracts
  • Market indices
To access this data, you will need to sign up for a free Yahoo Finance API key. Once you have your key, you can start making requests to the API.

Pros of using the Yahoo Finance API

There are a number of benefits to using the Yahoo Finance API, including:
  • It's free to use (for individuals)
  • It's well-documented
  • It has a wide range of data available

Cons of using the Yahoo Finance API

There are also a few drawbacks to using the Yahoo Finance API, including:
  • The data is only updated once per day
  • The data is delayed by 15 minutes
Despite its drawbacks, the Yahoo Finance API is still a valuable tool for developers working on finance-related applications. The wide range of data available makes it an essential part of any financial application.

Is it Actually Free?

The Yahoo Finance API is free to use for personal projects. However, commercial usage of the API requires a paid subscription. This means that developers working on commercial projects will need to pay for a Yahoo Finance API subscription.
How is the Data Updated?
The Yahoo Finance API is updated once per day. This means that developers will need to use other data sources if they want real-time data.

Data you can retrieve from the Yahoo Finance API

As we've already mentioned, there is a huge range of data that you can get from the Yahoo Finance API. To give you some idea of the functionality, we'll be breaking down some of the most popular features.

Getting Details About a Stock

Retrieving stock details is one of the most popular uses for the Yahoo Finance API. The following example shows how you can get information about Google stock:
 
Using the endpoint:
https://query1.finance.yahoo.com/v10/finance/quoteSummary/{symbol}?modules={csv of modules}

Available Modules

The modules query parameter takes a csv of the various modules you’d like. The modules available are:
The following modules are available:
  • assetProfile - The assetProfile object contains general information about the company, such as industry, fullTimeEmployees, and website and is useful for getting an overview of the company's assets.
  • defaultKeyStatistics - The defaultKeyStatistics object contains information about a company's stock. This is useful for getting an idea of a company's stock.
  • recommendationTrend - recommendationTrend object contains information about analyst recommendations. This is useful for getting an idea of whether a stock is being bought or sold by analysts.
  • financialData - The financialData object contains information about a company's financial situation. This is useful for getting an idea of a company's financial situation.
  • majorHoldersBreakdown - The majorHoldersBreakdown object contains information about the top holders of a stock. This is useful for getting an idea of who is buying or selling a stock.
  • earnings - The earnings object contains information about a company's earnings. This is useful for getting an idea of a company's profitability.
  • earningsHistory - The earningsHistory object contains information about a company's earnings history. This is useful for getting an idea of a company's past profitability.
  • earningsTrend - The earningsTrend object contains information about a company's earnings trend. This is useful for getting an idea of a company's current and future profitability.
  • indexTrend - The indexTrend object contains information about the direction of a stock market index. This is useful for getting an idea of the overall direction of the market.
  • industryTrend - The industryTrend object contains information about the direction of an industry. This is useful for getting an idea of the overall direction of an industry.
  • netSharePurchaseActivity - The netSharePurchaseActivity object contains information about the net share purchase activity of a company. This is useful for getting an idea of the overall direction of a company's stock.
  • sectorTrend -The sectorTrend object contains information about the direction of a stock market sector. This is useful for getting an idea of the overall direction of a particular stock market sector.
  • insiderHolders - The insiderHolders object contains information about the insider holders of a company's stock. This is useful for getting an idea of who owns a company's stock.
  • upgradeDowngradeHistory - The upgradeDowngradeHistory object contains information about the upgrades and downgrades that analysts have given a company's stock. This is useful for getting an idea of analyst opinion on a company's stock

Example 1: Apple’s Earnings History

  • The query will have the form: https://query1.finance.yahoo.com/v10/finance/quoteSummary/{symbol} ?modules={modules}
  • So for Apple's earnings we get (cut and paste into a browser to see what Yahoo returns):
https://query1.finance.yahoo.com/v10/finance/quoteSummary/aapl?modules=earningsHistory
  • Which returns the following JSON
{ "quoteSummary":{ "result":[ { "earningsHistory":{ "history":[ { "maxAge":1, "epsActual":{ "raw":1.3, "fmt":"1.3" }, "epsEstimate":{ "raw":1.01, "fmt":"1.01" }, "epsDifference":{ "raw":0.29, "fmt":"0.29" }, "surprisePercent":{ "raw":0.287, "fmt":"28.70%" }, "quarter":{ "raw":1625011200, "fmt":"2021-06-30" }, "period":"-4q" }, { "maxAge":1, "epsActual":{ "raw":1.24, "fmt":"1.24" }, "epsEstimate":{ "raw":1.24, "fmt":"1.24" }, "epsDifference":{ "raw":0.0, "fmt":"0" }, "surprisePercent":{ "raw":0.0, "fmt":"0.00%" }, "quarter":{ "raw":1632960000, "fmt":"2021-09-30" }, "period":"-3q" }, { "maxAge":1, "epsActual":{ "raw":2.1, "fmt":"2.1" }, "epsEstimate":{ "raw":1.89, "fmt":"1.89" }, "epsDifference":{ "raw":0.21, "fmt":"0.21" }, "surprisePercent":{ "raw":0.111, "fmt":"11.10%" }, "quarter":{ "raw":1640908800, "fmt":"2021-12-31" }, "period":"-2q" }, { "maxAge":1, "epsActual":{ "raw":1.52, "fmt":"1.52" }, "epsEstimate":{ "raw":1.43, "fmt":"1.43" }, "epsDifference":{ "raw":0.09, "fmt":"0.09" }, "surprisePercent":{ "raw":0.063, "fmt":"6.30%" }, "quarter":{ "raw":1648684800, "fmt":"2022-03-31" }, "period":"-1q" } ], "maxAge":86400 } } ], "error":null } }

Getting Historical Prices from Yahoo Finance API #v8-finance-chart

Price history is one of the most important pieces of data for stocks. The Yahoo Finance API provides this data for free.
  • Using the endpoint:
https://query1.finance.yahoo.com/v8/finance/chart/{symbol}
  • Takes the query parameter metrics, of which you can specify the following values (multiple values must be comma separated)
The metrics returned include:
  • Date - The date metric returns the date of the stock price. This is used for indexing the DataFrame.
  • High - The high metric returns the highest price of the stock for that day. This is used for computing the percent change.
  • Low - The low metric returns the lowest price of the stock for that day. This is used for computing the percent change.
  • Open - The open metric returns the opening price of the stock for that day. This is used for computing the percent change
  • Close - The close metric returns the closing price of the stock for that day. This is used for computing the percent change.
  • Volume - The volume metric returns the number of shares traded for that day. This is used for computing the average daily trading volume.
  • Adj Close - The adjusted close metric returns the closing price of the stock for that day, adjusted for splits and dividends. This is used for computing the percent change.
  • Currency - The currency metric returns the stock price in US dollars. This is used for computing the percent change.
  • InstrumentType - instrumentType shows whether the stock is equity, index, currency, or commodity. This is used for filtering the data.

Available Query Parameters

There are five adjustable parameters that can be used to get different results.
  1. interval - The time interval between two data points. Can be 1m2m5m15m30m60m90m1h1d5d1wk1mo3mo
  1. range - The range for which the data is returned. Can be "max" or "previous".
  1. period1 - UNIX timestamp representation of the date you wish to start  at
  1. period2 - UNIX timestamp representation of the date you wish to end  at
  1. close - Adjusts the price type to be returned. valid values are adjusted and unadjusted
  1. events=div%7Csplit - will include dividends and splits
  1. includePrePost which takes true or false
Using these additional parameters will help you fine-tune your requests to get the data that you need. For example, to get the last five years of Google stock price with one row per day, you would change the parameters to:

Example: Apple's High stock price for the last 5d days

The query will have the form: https://query1.finance.yahoo.com/v8/finance/chart/aapl?metrics=high?&interval=1d&range=5d you can see the 4 additions to the base URL
  • aapl
  • range=5d
  • Interval=1d
  • metrics=high
So for Apple's High stock price for the day we get (cut and paste into a browser to see what Yahoo returns)
{ "chart":{ "result":[ { "meta":{ "currency":"USD", "symbol":"AAPL", "exchangeName":"NMS", "instrumentType":"EQUITY", "firstTradeDate":345479400, "regularMarketTime":1656432291, "gmtoffset":-14400, "timezone":"EDT", "exchangeTimezoneName":"America/New_York", "regularMarketPrice":138.867, "chartPreviousClose":135.87, "priceHint":2, "currentTradingPeriod":{ "pre":{ "timezone":"EDT", "start":1656403200, "end":1656423000, "gmtoffset":-14400 }, "regular":{ "timezone":"EDT", "start":1656423000, "end":1656446400, "gmtoffset":-14400 }, "post":{ "timezone":"EDT", "start":1656446400, "end":1656460800, "gmtoffset":-14400 } }, "dataGranularity":"1d", "range":"5d", "validRanges":[ "1d", "5d", "1mo", "3mo", "6mo", "1y", "2y", "5y", "10y", "ytd", "max" ] }, "timestamp":[ 1655904600, 1655991000, 1656077400, 1656336600, 1656432291 ], "indicators":{ "quote":[ { "volume":[ 73409200, 72433800, 89047400, 70149200, 27762238 ], "low":[ 133.91000366210938, 135.6300048828125, 139.77000427246094, 140.97000122070312, 138.82000732421875 ], "open":[ 134.7899932861328, 136.82000732421875, 139.89999389648438, 142.6999969482422, 142.1300048828125 ], "high":[ 137.75999450683594, 138.58999633789062, 141.91000366210938, 143.49000549316406, 143.4219970703125 ], "close":[ 135.35000610351562, 138.27000427246094, 141.66000366210938, 141.66000366210938, 138.86669921875 ] } ], "adjclose":[ { "adjclose":[ 135.35000610351562, 138.27000427246094, 141.66000366210938, 141.66000366210938, 138.86669921875 ] } ] } } ], "error":null } }

Try it Out

v8/finance/chart/{symbol}

Please fill in any necessary fields and click Run.

GET

Preview

View the API data, get a live Google Sheet dashboard

currency
symbol
exchangeName
instrumentType
timestamp
open
high
low
close
volume
error
           
           
           

Get a live Google Sheet

Export your data to a google sheet, with the SyncWith Addon, or download to CSV

Automatically updated

Add data sources

Build reports & dashboards

Get key details about multiple tickers at once #finance-quote

Using the endpoint:
https://query1.finance.yahoo.com/v7/finance/quote or
https://query1.finance.yahoo.com/v6/finance/quote
 
You can query multiple tickers at once, which is useful if you want to compare data side-by-side.
To do this, simply pass in a comma-separated list of tickers as the "symbols" parameter. For example:
{ "quoteResponse":{ "result":[ { "language":"en-US", "region":"US", "quoteType":"EQUITY", "typeDisp":"Equity", "quoteSourceName":"Nasdaq Real Time Price", "triggerable":true, "customPriceAlertConfidence":"HIGH", "currency":"USD", "exchange":"NMS", "shortName":"Alphabet Inc.", "longName":"Alphabet Inc.", "messageBoardId":"finmb_29096", "exchangeTimezoneName":"America/New_York", "exchangeTimezoneShortName":"EDT", "gmtOffSetMilliseconds":-14400000, "market":"us_market", "esgPopulated":false, "marketState":"REGULAR", "twoHundredDayAverageChange":-417.12305, "twoHundredDayAverageChangePercent":-0.15576103, "marketCap":1483543937024, "forwardPE":17.144499, "priceToBook":5.863537, "sourceInterval":15, "exchangeDataDelayedBy":0, "pageViewGrowthWeekly":0.02255507, "averageAnalystRating":"1.5 - Strong Buy", "tradeable":false, "regularMarketChange":-71.60498, "regularMarketChangePercent":-3.0699472, "regularMarketTime":1656440297, "regularMarketPrice":2260.845, "regularMarketDayHigh":2357.13, "regularMarketDayRange":"2256.7014 - 2357.13", "regularMarketDayLow":2256.7014, "regularMarketVolume":894701, "regularMarketPreviousClose":2332.45, "bid":2259.36, "ask":2260.38, "bidSize":9, "askSize":31, "fullExchangeName":"NasdaqGS", "financialCurrency":"USD", "regularMarketOpen":2327.02, "averageDailyVolume3Month":1535167, "averageDailyVolume10Day":1667890, "fiftyTwoWeekLowChange":216.68494, "fiftyTwoWeekLowChangePercent":0.10600194, "fiftyTwoWeekRange":"2044.16 - 3042.0", "fiftyTwoWeekHighChange":-781.155, "fiftyTwoWeekHighChangePercent":-0.25678995, "fiftyTwoWeekLow":2044.16, "fiftyTwoWeekHigh":3042.0, "trailingAnnualDividendRate":0.0, "trailingPE":20.444408, "trailingAnnualDividendYield":0.0, "epsTrailingTwelveMonths":110.585, "epsForward":131.87, "epsCurrentYear":111.33, "priceEpsCurrentYear":20.307598, "sharesOutstanding":313376000, "bookValue":385.577, "fiftyDayAverage":2307.9668, "fiftyDayAverageChange":-47.121826, "fiftyDayAverageChangePercent":-0.020417029, "twoHundredDayAverage":2677.968, "firstTradeDateMilliseconds":1092922200000, "priceHint":2, "displayName":"Alphabet", "symbol":"GOOG" }, { "language":"en-US", "region":"US", "quoteType":"EQUITY", "typeDisp":"Equity", "quoteSourceName":"Nasdaq Real Time Price", "triggerable":true, "customPriceAlertConfidence":"HIGH", "currency":"USD", "exchange":"NMS", "shortName":"Apple Inc.", "longName":"Apple Inc.", "messageBoardId":"finmb_24937", "exchangeTimezoneName":"America/New_York", "exchangeTimezoneShortName":"EDT", "gmtOffSetMilliseconds":-14400000, "market":"us_market", "esgPopulated":false, "marketState":"REGULAR", "twoHundredDayAverageChange":-20.251343, "twoHundredDayAverageChangePercent":-0.1277508, "marketCap":2237942202368, "forwardPE":21.110062, "priceToBook":33.254185, "sourceInterval":15, "exchangeDataDelayedBy":0, "pageViewGrowthWeekly":-0.043733243, "averageAnalystRating":"1.9 - Buy", "tradeable":false, "regularMarketChange":-3.3890991, "regularMarketChangePercent":-2.3924177, "regularMarketTime":1656440342, "regularMarketPrice":138.2709, "regularMarketDayHigh":143.422, "regularMarketDayRange":"138.25 - 143.422", "regularMarketDayLow":138.25, "regularMarketVolume":40352582, "regularMarketPreviousClose":141.66, "bid":138.93, "ask":138.94, "bidSize":8, "askSize":11, "fullExchangeName":"NasdaqGS", "financialCurrency":"USD", "regularMarketOpen":142.13, "averageDailyVolume3Month":95182072, "averageDailyVolume10Day":92680690, "fiftyTwoWeekLowChange":9.230911, "fiftyTwoWeekLowChangePercent":0.071535274, "fiftyTwoWeekRange":"129.04 - 182.94", "fiftyTwoWeekHighChange":-44.669098, "fiftyTwoWeekHighChangePercent":-0.24417348, "fiftyTwoWeekLow":129.04, "fiftyTwoWeekHigh":182.94, "dividendDate":1652313600, "earningsTimestamp":1651163400, "earningsTimestampStart":1658779200, "earningsTimestampEnd":1659124800, "trailingAnnualDividendRate":0.88, "trailingPE":22.530699, "trailingAnnualDividendYield":0.0062120566, "epsTrailingTwelveMonths":6.137, "epsForward":6.55, "epsCurrentYear":6.14, "priceEpsCurrentYear":22.519691, "sharesOutstanding":16185199616, "bookValue":4.158, "fiftyDayAverage":148.6032, "fiftyDayAverageChange":-10.332291, "fiftyDayAverageChangePercent":-0.0695294, "twoHundredDayAverage":158.52225, "firstTradeDateMilliseconds":345479400000, "priceHint":2, "displayName":"Apple", "symbol":"AAPL" } ], "error":null } }
Yahoo Finance will return data for all of the specified tickers in one call, which can then be easily compared.
This is a powerful way to quickly get an overview of how different stocks are performing.
The metrics returned from this query include:
  • trailingAnnualDividendRate - The trailing annual dividend rate, expressed as a percentage of the current stock price.
  • dividendDate - The date of the most recent dividend payment.
  • trailingAnnualDividendYield - The trailing annual dividend yield, expressed as a percentage of the current stock price.
  • priceHint - A hint for the number of digits to display after the decimal point when formatting prices.
  • firstTradeDateMilliseconds - The date of the first trade for this stock.
  • shortName - A short name for the company or security.
  • marketState - The market state of the security.
  • esgPopulated - True if this security has ESG data.
  • market - The market of the security.
  • gmtOffSetMilliseconds - The difference, in milliseconds, between Greenwich Mean Time (GMT) and the market's primary exchange's local time.

Additional Parameters

In addition, you can also get detailed fundamental data for each ticker by passing using the include query parameter. Available values include
  • revenue
  • grossMargin
  • debtToEquity
  • currentRatio
For example, to get this data for Google and Apple, you would use the following query parameter: ?include=revenue,grossMargin,debtToEquity,currentRatio
Example: Revenue for Alphabet (GOOGL) and Apple (AAPL)
To get the revenue for Alphabet (GOOGL), you would use the following query: GOOGL?include=revenue
To get the revenue for Alphabet (GOOGL), you would use the following query: GOOGL?include=revenue
This would return the following:
GOOGL Revenue: 86,79B
You can also get this data for multiple companies at once. For example, to get the revenue for Alphabet (GOOGL) and Apple (AAPL), you would use the following query: GOOGL,AAPL?include=revenue
This would return the following:
GOOGL Revenue: 86,79B
AAPL Revenue: 260,17B

Download historic data for a stock ticker

Using the endpoint:

https://query1.finance.yahoo.com/v7/finance/download/{symbol}

Provides information on a single stock ticker. The {symbol} is the stock ticker you are interested in. For example, to get information about Google, use GOOG.
This endpoint returns a CSV. The full list of columns is:
Date - The date of the observation
Open - The opening price of the stock for the day
High - The highest price of the stock for the day
Low - The lowest price of the stock for the day
Close - The closing price of the stock for the day
Adj Close - An adjusted close. Prices are already adjusted for splits, the "Adjusted Close" price is further adjusted for dividends.
Volume - How many shares traded hands during the interval

Available Query Parameters

There are five adjustable parameters that can be used to get different results.
  1. interval - The time interval between two data points. Can be 1m2m5m15m30m60m90m1h1d5d1wk1mo3mo
  1. period1 - UNIX timestamp representation of the date you wish to start  at
  1. period2 - UNIX timestamp representation of the date you wish to end  at

Returned JSON

If we pass the following parameters:
  • symbol = goog
  • period1 = 1641059569 (~ Jan 1, 2022)
  • period2 = 1641579977 (~ Jan 7, 2022)
  • interval = 1d
  • includeAdjustedClose = true
Which returns the JSON:
[ { "Date":"2022-01-03", "Open":"2889.510010", "High":"2911.000000", "Low":"2870.050049", "Close":"2901.489990", "Adj Close":"2901.489990", "Volume":"1260700" }, { "Date":"2022-01-04", "Open":"2911.010010", "High":"2932.199951", "Low":"2876.322998", "Close":"2888.330078", "Adj Close":"2888.330078", "Volume":"1146400" }, { "Date":"2022-01-05", "Open":"2883.620117", "High":"2885.959961", "Low":"2750.469971", "Close":"2753.070068", "Adj Close":"2753.070068", "Volume":"2482100" }, { "Date":"2022-01-06", "Open":"2749.949951", "High":"2793.719971", "Low":"2735.270020", "Close":"2751.020020", "Adj Close":"2751.020020", "Volume":"1452500" }, { "Date":"2022-01-07", "Open":"2758.100098", "High":"2765.094971", "Low":"2715.780029", "Close":"2740.090088", "Adj Close":"2740.090088", "Volume":"970400" } ]

Try It Out for Yourself

v7/finance/download/{symbol}

Please fill in any necessary fields and click Run.

GET

Preview

View the API data, get a live Google Sheet dashboard

Date
Open
High
Low
Close
Adj Close
Volume
       
       
       

Get a live Google Sheet

Export your data to a google sheet, with the SyncWith Addon, or download to CSV

Automatically updated

Add data sources

Build reports & dashboards

Get advanced details about a stock #quote-summary

Using the endpoint:
https://query1.finance.yahoo.com/v11/finance/quoteSummary/{symbol}
You will get essentially the same results as the /v10/finance/quoteSummary/{symbol} endpoint mentioned above
Will provide you with advanced details on a stock, including:
  • A summary of the stock - open, close, high, low
  • A dividend summary - ex-date, payment date, amount
  • An earnings summary - EPS estimate for current year and next year, actual EPS for last four quarters
  • An earnings report - includes actual EPS, surprise, and fiscal period
  • A financial data summary - includes shares outstanding, float, beta, and more
  • A list of major holders - includes institutional holders and mutual fund ownership
  • A list of major holders changes - includes net and percent change in holdings
  • Analyst recommendations - includes current rating and target price

Modules

This endpoint requires the modules query parameter to specify what information you want returned back. The modules query parameter takes a csv of the various modules you’d like. The modules available are:
The following modules are available:
  • assetProfile - The assetProfile object contains general information about the company, such as industry, fullTimeEmployees, and website and is useful for getting an overview of the company's assets.
  • defaultKeyStatistics - The defaultKeyStatistics object contains information about a company's stock. This is useful for getting an idea of a company's stock.
  • recommendationTrend - recommendationTrend object contains information about analyst recommendations. This is useful for getting an idea of whether a stock is being bought or sold by analysts.
  • financialData - The financialData object contains information about a company's financial situation. This is useful for getting an idea of a company's financial situation.
  • majorHoldersBreakdown - The majorHoldersBreakdown object contains information about the top holders of a stock. This is useful for getting an idea of who is buying or selling a stock.
  • earnings - The earnings object contains information about a company's earnings. This is useful for getting an idea of a company's profitability.
  • earningsHistory - The earningsHistory object contains information about a company's earnings history. This is useful for getting an idea of a company's past profitability.
  • earningsTrend - The earningsTrend object contains information about a company's earnings trend. This is useful for getting an idea of a company's current and future profitability.
  • indexTrend - The indexTrend object contains information about the direction of a stock market index. This is useful for getting an idea of the overall direction of the market.
  • industryTrend - The industryTrend object contains information about the direction of an industry. This is useful for getting an idea of the overall direction of an industry.
  • netSharePurchaseActivity - The netSharePurchaseActivity object contains information about the net share purchase activity of a company. This is useful for getting an idea of the overall direction of a company's stock.
  • sectorTrend -The sectorTrend object contains information about the direction of a stock market sector. This is useful for getting an idea of the overall direction of a particular stock market sector.
  • insiderHolders - The insiderHolders object contains information about the insider holders of a company's stock. This is useful for getting an idea of who owns a company's stock.
  • upgradeDowngradeHistory - The upgradeDowngradeHistory object contains information about the upgrades and downgrades that analysts have given a company's stock. This is useful for getting an idea of analyst opinion on a company's stock
To get started, simply make a GET request to the endpoint, specifying the ticker symbol for the stock you're interested in. For example, to get details on Apple Inc.'s stock (AAPL), use:
Sample GET request:
Which is passing in:
  • path ticker param = AAPL
  • modules = assetProfile
Returns:
{ "quoteSummary":{ "result":[ { "assetProfile":{ "address1":"One Apple Park Way", "city":"Cupertino", "state":"CA", "zip":"95014", "country":"United States", "phone":"408 996 1010", "website":"https://www.apple.com", "industry":"Consumer Electronics", "sector":"Technology", "longBusinessSummary":"Apple Inc. designs, manufactures, and markets smartphones, personal computers, tablets, wearables, and accessories worldwide. It also sells various related services. In addition, the company offers iPhone, a line of smartphones; Mac, a line of personal computers; iPad, a line of multi-purpose tablets; AirPods Max, an over-ear wireless headphone; and wearables, home, and accessories comprising AirPods, Apple TV, Apple Watch, Beats products, HomePod, and iPod touch. Further, it provides AppleCare support services; cloud services store services; and operates various platforms, including the App Store that allow customers to discover and download applications and digital content, such as books, music, video, games, and podcasts. Additionally, the company offers various services, such as Apple Arcade, a game subscription service; Apple Music, which offers users a curated listening experience with on-demand radio stations; Apple News+, a subscription news and magazine service; Apple TV+, which offers exclusive original content; Apple Card, a co-branded credit card; and Apple Pay, a cashless payment service, as well as licenses its intellectual property. The company serves consumers, and small and mid-sized businesses; and the education, enterprise, and government markets. It distributes third-party applications for its products through the App Store. The company also sells its products through its retail and online stores, and direct sales force; and third-party cellular network carriers, wholesalers, retailers, and resellers. Apple Inc. was incorporated in 1977 and is headquartered in Cupertino, California.", "fullTimeEmployees":154000, "companyOfficers":[ { "maxAge":1, "name":"Mr. Timothy D. Cook", "age":60, "title":"CEO & Director", "yearBorn":1961, "fiscalYear":2021, "totalPay":{ "raw":16386559, "fmt":"16.39M", "longFmt":"16,386,559" }, "exercisedValue":{ "raw":0, "fmt":null, "longFmt":"0" }, "unexercisedValue":{ "raw":0, "fmt":null, "longFmt":"0" } }, { "maxAge":1, "name":"Mr. Luca Maestri", "age":57, "title":"CFO & Sr. VP", "yearBorn":1964, "fiscalYear":2021, "totalPay":{ "raw":5018883, "fmt":"5.02M", "longFmt":"5,018,883" }, "exercisedValue":{ "raw":0, "fmt":null, "longFmt":"0" }, "unexercisedValue":{ "raw":0, "fmt":null, "longFmt":"0" } }, { "maxAge":1, "name":"Mr. Jeffrey E. Williams", "age":57, "title":"Chief Operating Officer", "yearBorn":1964, "fiscalYear":2021, "totalPay":{ "raw":5017437, "fmt":"5.02M", "longFmt":"5,017,437" }, "exercisedValue":{ "raw":0, "fmt":null, "longFmt":"0" }, "unexercisedValue":{ "raw":0, "fmt":null, "longFmt":"0" } }, { "maxAge":1, "name":"Ms. Katherine L. Adams", "age":57, "title":"Sr. VP, Gen. Counsel & Sec.", "yearBorn":1964, "fiscalYear":2021, "totalPay":{ "raw":5014533, "fmt":"5.01M", "longFmt":"5,014,533" }, "exercisedValue":{ "raw":0, "fmt":null, "longFmt":"0" }, "unexercisedValue":{ "raw":0, "fmt":null, "longFmt":"0" } }, { "maxAge":1, "name":"Ms. Deirdre O'Brien", "age":54, "title":"Sr. VP of People & Retail", "yearBorn":1967, "fiscalYear":2021, "totalPay":{ "raw":5061191, "fmt":"5.06M", "longFmt":"5,061,191" }, "exercisedValue":{ "raw":0, "fmt":null, "longFmt":"0" }, "unexercisedValue":{ "raw":0, "fmt":null, "longFmt":"0" } }, { "maxAge":1, "name":"Mr. Chris Kondo", "title":"Sr. Director of Corp. Accounting", "exercisedValue":{ "raw":0, "fmt":null, "longFmt":"0" }, "unexercisedValue":{ "raw":0, "fmt":null, "longFmt":"0" } }, { "maxAge":1, "name":"Mr. James Wilson", "title":"Chief Technology Officer", "exercisedValue":{ "raw":0, "fmt":null, "longFmt":"0" }, "unexercisedValue":{ "raw":0, "fmt":null, "longFmt":"0" } }, { "maxAge":1, "name":"Ms. Mary Demby", "title":"Chief Information Officer", "exercisedValue":{ "raw":0, "fmt":null, "longFmt":"0" }, "unexercisedValue":{ "raw":0, "fmt":null, "longFmt":"0" } }, { "maxAge":1, "name":"Ms. Nancy Paxton", "title":"Sr. Director of Investor Relations & Treasury", "exercisedValue":{ "raw":0, "fmt":null, "longFmt":"0" }, "unexercisedValue":{ "raw":0, "fmt":null, "longFmt":"0" } }, { "maxAge":1, "name":"Mr. Greg Joswiak", "title":"Sr. VP of Worldwide Marketing", "exercisedValue":{ "raw":0, "fmt":null, "longFmt":"0" }, "unexercisedValue":{ "raw":0, "fmt":null, "longFmt":"0" } } ], "auditRisk":2, "boardRisk":1, "compensationRisk":9, "shareHolderRightsRisk":1, "overallRisk":2, "governanceEpochDate":1656633600, "compensationAsOfEpochDate":1640908800, "maxAge":86400 } } ], "error":null } }
Now if you switch the modules query param to be ?modules=financialData you get the following response for AAPL:
{ "quoteSummary": { "result": [ { "financialData": { "maxAge": 86400, "currentPrice": { "raw": 138.93, "fmt": "138.93" }, "targetHighPrice": { "raw": 214, "fmt": "214.00" }, "targetLowPrice": { "raw": 155, "fmt": "155.00" }, "targetMeanPrice": { "raw": 186.73, "fmt": "186.73" }, "targetMedianPrice": { "raw": 187.37, "fmt": "187.37" }, "recommendationMean": { "raw": 1.9, "fmt": "1.90" }, "recommendationKey": "buy", "numberOfAnalystOpinions": { "raw": 43, "fmt": "43", "longFmt": "43" }, "totalCash": { "raw": 51511001088, "fmt": "51.51B", "longFmt": "51,511,001,088" }, "totalCashPerShare": { "raw": 3.183, "fmt": "3.18" }, "ebitda": { "raw": 130633998336, "fmt": "130.63B", "longFmt": "130,633,998,336" }, "totalDebt": { "raw": 119980998656, "fmt": "119.98B", "longFmt": "119,980,998,656" }, "quickRatio": { "raw": 0.76, "fmt": "0.76" }, "currentRatio": { "raw": 0.927, "fmt": "0.93" }, "totalRevenue": { "raw": 386017001472, "fmt": "386.02B", "longFmt": "386,017,001,472" }, "debtToEquity": { "raw": 178.016, "fmt": "178.02" }, "revenuePerShare": { "raw": 23.471, "fmt": "23.47" }, "returnOnAssets": { "raw": 0.21695, "fmt": "21.69%" }, "returnOnEquity": { "raw": 1.49271, "fmt": "149.27%" }, "grossProfits": { "raw": 152836000000, "fmt": "152.84B", "longFmt": "152,836,000,000" }, "freeCashflow": { "raw": 84384628736, "fmt": "84.38B", "longFmt": "84,384,628,736" }, "operatingCashflow": { "raw": 116425998336, "fmt": "116.43B", "longFmt": "116,425,998,336" }, "earningsGrowth": { "raw": 0.086, "fmt": "8.60%" }, "revenueGrowth": { "raw": 0.086, "fmt": "8.60%" }, "grossMargins": { "raw": 0.43322, "fmt": "43.32%" }, "ebitdaMargins": { "raw": 0.33842, "fmt": "33.84%" }, "operatingMargins": { "raw": 0.30926, "fmt": "30.93%" }, "profitMargins": { "raw": 0.26407, "fmt": "26.41%" }, "financialCurrency": "USD" } } ], "error": null } }

Try it Out

v11/finance/quoteSummary/{symbol}

Please fill in any necessary fields and click Run.

GET

Preview

View the API data, get a live Google Sheet dashboard

maxAge
currentPrice
targetHighPrice
targetLowPrice
targetMeanPrice
targetMedianPrice
recommendationMean
recommendationKey
numberOfAnalystOpinions
totalCash
totalCashPerShare
ebitda
totalDebt
quickRatio
currentRatio
totalRevenue
debtToEquity
revenuePerShare
returnOnAssets
returnOnEquity
grossProfits
freeCashflow
operatingCashflow
earningsGrowth
revenueGrowth
grossMargins
ebitdaMargins
operatingMargins
profitMargins
financialCurrency
                              
                              
                              

Get a live Google Sheet

Export your data to a google sheet, with the SyncWith Addon, or download to CSV

Automatically updated

Add data sources

Build reports & dashboards

This endpoint is great at getting the kind of information is critical for making sound investment decisions because it gives you an idea of what others in the market think about a particular stock. It also helps you track how sentiment around a stock has changed over time.
  • An earnings report
  • A summary of the stock

Get option contracts for a Ticker

The endpoint:
https://query1.finance.yahoo.com/v7/finance/options/{symbol}
returns the a table of option contracts for the underlying asset for the specified ticker (via the path param {symbol}:
  1. The underlying asset's price
  1. Implied volatility
  1. Strike price
  1. Expiration date
  1. fOpen interest
  1. Volume
  1. Percent change in volume
  1. Bid
  1. Ask
  1. Last trade price
The core JSON object looks like:
notion image
The quote object isn’t options related it just repeats a set of detailed financial stats for the equity, eg:
"quote":{ "language":"en-US", "region":"US", "quoteType":"EQUITY", "typeDisp":"Equity", "quoteSourceName":"Delayed Quote", "triggerable":true, "customPriceAlertConfidence":"HIGH", "postMarketChangePercent":0.064789176, "postMarketTime":1656719991, "postMarketPrice":139.02, "postMarketChange":0.0900116, "regularMarketChange":2.2099915, "regularMarketChangePercent":1.616436, "regularMarketTime":1656705604, "regularMarketPrice":138.93, "regularMarketDayHigh":139.035, "regularMarketDayRange":"135.67 - 139.035", "regularMarketDayLow":135.67, "regularMarketVolume":71051552, "regularMarketPreviousClose":136.72, "bid":139.02, "ask":139.03, "bidSize":8, "askSize":8, "fullExchangeName":"NasdaqGS", "financialCurrency":"USD", "regularMarketOpen":136.04, "averageDailyVolume3Month":94027277, "averageDailyVolume10Day":82358450, "fiftyTwoWeekLowChange":9.889999, "currency":"USD", "gmtOffSetMilliseconds":-14400000, "market":"us_market", "esgPopulated":false, "exchange":"NMS", "shortName":"Apple Inc.", "longName":"Apple Inc.", "messageBoardId":"finmb_24937", "exchangeTimezoneName":"America/New_York", "exchangeTimezoneShortName":"EDT", "firstTradeDateMilliseconds":345479400000, "priceHint":2, "fiftyTwoWeekLowChangePercent":0.0766429, "fiftyTwoWeekRange":"129.04 - 182.94", "fiftyTwoWeekHighChange":-44.01001, "fiftyTwoWeekHighChangePercent":-0.24057072, "fiftyTwoWeekLow":129.04, "fiftyTwoWeekHigh":182.94, "dividendDate":1652313600, "earningsTimestamp":1659038400, "earningsTimestampStart":1659038400, "earningsTimestampEnd":1659038400, "trailingAnnualDividendRate":0.88, "trailingPE":22.590242, "trailingAnnualDividendYield":0.0064365123, "epsTrailingTwelveMonths":6.15, "epsForward":6.55, "epsCurrentYear":6.14, "priceEpsCurrentYear":22.627035, "sharesOutstanding":16185199616, "bookValue":4.158, "fiftyDayAverage":146.3498, "fiftyDayAverageChange":-7.4198, "fiftyDayAverageChangePercent":-0.05069908, "twoHundredDayAverage":158.3055, "twoHundredDayAverageChange":-19.375504, "twoHundredDayAverageChangePercent":-0.12239312, "marketCap":2248609628160, "forwardPE":21.210686, "priceToBook":33.412697, "sourceInterval":15, "exchangeDataDelayedBy":0, "pageViewGrowthWeekly":0.091135874, "averageAnalystRating":"1.9 - Buy", "tradeable":false, "marketState":"CLOSED", "displayName":"Apple", "symbol":"AAPL" }
The expirationDates and strikes are simple arrays of the valid expirationDates and strike prices.
The meat of the request is in options object which has an array for put and call objects.
A sample call object looks like:
{ "contractSymbol":"AAPL220708C00070000", "strike":70.0, "currency":"USD", "lastPrice":69.39, "change":0.0, "percentChange":0.0, "volume":1, "openInterest":2, "bid":68.45, "ask":69.65, "contractSize":"REGULAR", "expiration":1657238400, "lastTradeDate":1656511122, "impliedVolatility":2.3593791015624994, "inTheMoney":true }
And a sample put contract looks like:
{ "contractSymbol":"AAPL220708P00075000", "strike":75.0, "currency":"USD", "lastPrice":0.01, "change":0.0, "percentChange":0.0, "volume":3, "openInterest":5, "bid":0.0, "ask":0.02, "contractSize":"REGULAR", "expiration":1657238400, "lastTradeDate":1656682204, "impliedVolatility":1.625001875, "inTheMoney":false }
Options include stocks, indexes, and ETFs. For stocks, the parameter should be the stock ticker. For indexes, the parameter should be the index symbol. For ETFs, the parameter should be the ETF ticker.

Try it Out

options

Please fill in any necessary fields and click Run.

GET

Preview

View the API data, get a live Google Sheet dashboard

result.underlyingSymbol
result.expirationDates
result.strikes
result.hasMiniOptions
result.quote
result.options
error
       
       
       

Get a live Google Sheet

Export your data to a google sheet, with the SyncWith Addon, or download to CSV

Automatically updated

Add data sources

Build reports & dashboards

Get a list of securities that match a search

The endpoint:
https://query1.finance.yahoo.com/v1/finance/search?q={Query}
will search Yahoo for relevant equities, news articles lists and navigation options and return tthem to you you. This is done with the q query parameter.
For instance if we search for berkshire hathaway we get:
A bunch of Berkshirt Hathaway listings across different classes and exchanges:
{ "exchange": "NYQ", "shortname": "Berkshire Hathaway Inc. New", "quoteType": "EQUITY", "symbol": "BRK-B", "index": "quotes", "score": 47015, "typeDisp": "Equity", "longname": "Berkshire Hathaway Inc.", "exchDisp": "NYSE", "sector": "Financial Services", "industry": "Insurance—Diversified", "dispSecIndFlag": true, "isYahooFinance": true }, { "exchange": "NYQ", "shortname": "Berkshire Hathaway Inc.", "quoteType": "EQUITY", "symbol": "BRK-A", "index": "quotes", "score": 25712, "typeDisp": "Equity", "longname": "Berkshire Hathaway Inc.", "exchDisp": "NYSE", "sector": "Financial Services", "industry": "Insurance—Diversified", "isYahooFinance": true }, { "exchange": "VIE", "shortname": "BERKSHIRE HATHAWAY INC", "quoteType": "EQUITY", "symbol": "BRKB.VI", "index": "quotes", "score": 20701, "typeDisp": "Equity", "longname": "Berkshire Hathaway Inc.", "exchDisp": "Vienna", "sector": "Financial Services", "industry": "Insurance—Diversified", "isYahooFinance": true }, { "exchange": "VIE", "shortname": "BERKSHIRE HATHAWAY INC", "quoteType": "EQUITY", "symbol": "BRKA.VI", "index": "quotes", "score": 20173, "typeDisp": "Equity", "longname": "Berkshire Hathaway Inc.", "exchDisp": "Vienna", "sector": "Financial Services", "industry": "Insurance—Diversified", "isYahooFinance": true }, { "exchange": "BUE", "shortname": "BERKSHIRE HATHAWAY", "quoteType": "EQUITY", "symbol": "BRKB.BA", "index": "quotes", "score": 20048, "typeDisp": "Equity", "exchDisp": "Buenos Aires", "isYahooFinance": true }, { "exchange": "AMS", "shortname": "LS Berkshire Hathaway (BRK-B) T", "quoteType": "EQUITY", "symbol": "BERK.AS", "index": "quotes", "score": 20043, "typeDisp": "Equity", "exchDisp": "Amsterdam", "isYahooFinance": true }, { "exchange": "GER", "shortname": "BERKSHIRE HATHAWAY INC", "quoteType": "EQUITY", "symbol": "BRYN.DE", "index": "quotes", "score": 20039, "typeDisp": "Equity", "longname": "Berkshire Hathaway Inc.", "exchDisp": "XETRA", "sector": "Financial Services", "industry": "Insurance—Diversified", "isYahooFinance": true }
News Articles
These seem completely unrelated to the search and must simply be back fill or recent articles from Yahoo, for example:
{ "uuid": "6144f6c8-86d6-36f8-bbec-ad4ccaa549ec", "title": "Our favorite HexClad cookware set is $399 off for 4th of July", "publisher": "USA TODAY", "link": "https://finance.yahoo.com/m/6144f6c8-86d6-36f8-bbec-ad4ccaa549ec/our-favorite-hexclad-cookware.html", "providerPublishTime": 1656881160, "type": "STORY", "thumbnail": { "resolutions": [ { "url": "https://s.yimg.com/uu/api/res/1.2/F3E8gRgWosDuM4even6bcw--~B/aD0xMzg0O3c9MjQ2MDthcHBpZD15dGFjaHlvbg--/https://s.yimg.com/uu/api/res/1.2/uPfTE8.eZVgHK1TjmOvPaA--~B/aD0xMzg0O3c9MjQ2MDthcHBpZD15dGFjaHlvbg--/https://media.zenfs.com/en/usa_today_money_325/a49bb145b6ee71de2e819033b708d2d3", "width": 2460, "height": 1384, "tag": "original" }, { "url": "https://s.yimg.com/uu/api/res/1.2/_ZbkFQgoiP6vMFMHiIBsmQ--~B/Zmk9ZmlsbDtoPTE0MDtweW9mZj0wO3c9MTQwO2FwcGlkPXl0YWNoeW9u/https://s.yimg.com/uu/api/res/1.2/uPfTE8.eZVgHK1TjmOvPaA--~B/aD0xMzg0O3c9MjQ2MDthcHBpZD15dGFjaHlvbg--/https://media.zenfs.com/en/usa_today_money_325/a49bb145b6ee71de2e819033b708d2d3", "width": 140, "height": 140, "tag": "140x140" } ] }
Lists
{ "slug": "the-berkshire-hathaway-portfolio", "name": "The Berkshire Hathaway Portfolio", "index": "the-berkshire-hathaway-portfolio", "score": 157.88571, "type": "ALGO_WATCHLIST", "brandSlug": "yahoo-finance", "pfId": "the_berkshire_hathaway_portfolio", "symbolCount": 20, "dailyPercentGain": 2.0569980978559026, "followerCount": 222808, "iconUrl": "https://edgecast-img.yahoo.net/mysterio/api/c1699b006cb1043f7174f137cf5a2dab3ce87405dda0f2d7f58ced39ebb370a8/finance/resizefill_w96_h96/https://s.yimg.com/dh/ap/default/161012/the-berkshire-hathaway-portfolio.jpg" }

Try it Out

query

Please fill in any necessary fields and click Run.

GET

Preview

View the API data, get a live Google Sheet dashboard

explains
count
quotes
news
nav
lists
researchReports
screenerFieldResults
totalTime
timeTakenForQuotes
timeTakenForNews
timeTakenForAlgowatchlist
timeTakenForPredefinedScreener
timeTakenForCrunchbase
timeTakenForNav
timeTakenForResearchReports
timeTakenForScreenerField
timeTakenForCulturalAssets
                  
                  
                  

Get a live Google Sheet

Export your data to a google sheet, with the SyncWith Addon, or download to CSV

Automatically updated

Add data sources

Build reports & dashboards

Summary of Yahoo Finance API Data Quality

The Yahoo Finance API data quality is quite good overall. However, there are a few things to be aware of.
First, the data is only as good as the underlying data that Yahoo! Finance has. So, if there is an error in the original source data, it will be reflected in the API data.
Second, the API doesn't always have the most up-to-date information. For example, if a company files its quarterly results after market close, the API data will still reflect the last closing price until Yahoo! Finance updates its records.
Finally, while most of the fields are well-documented, some of them are not. This can make it difficult to know what certain fields represent or how to use them.
Despite these limitations, the Yahoo! Finance API is still a valuable resource for data-driven investors. With a little bit of know-how, you can use it to get the information you need to make informed investment decisions.

Discussion of Alpha Advantage vs Yahoo Finance API

Alpha Advantage and Yahoo Finance are both popular sources of stock market data. Both have their pros and cons, but which one is the better choice for you?
Alpha Advantage offers more comprehensive data coverage than Yahoo Finance, including global markets and sector-specific data. However, it can be more expensive to access (but offer a free tier), and its documentation can be difficult to understand.
Yahoo Finance offers less comprehensive data than Alpha Advantage, but it is typically easier and cheaper to access. However, its documentation can be difficult to understand, and it does not always provide accurate or up-to-date information.
So which one should you choose? It really depends on your needs. If you need global market data or sector-specific data, then Alpha Advantage is the better choice. However, if you just need basic stock information, then Yahoo Finance might be a better option for you.

Using Yahoo Finance API in Python

Making use of the Yahoo Finance API in Python is easy thanks to the yfinance package. With just a few lines of code, you can get the data you need from Yahoo Finance.
To use the Yahoo Finance API in Python, we first have to install the yfinance package. We can do this by running the following command in the terminal: pip install finance.
Once we have installed the yfinance package, it can be made use of using Python code. We start by importing it into the code: import yfinance as yf.
We then use the download method to fetch data from Yahoo Finance: data = yf.download("AAPL", start="2020-01-01", end="2020-04-30").
This will return a pandas dataframe with the data from Apple for the specified date range.
We can then access this data in our code by using the column names of the dataframe. For example, we can access the close price of Apple stock by using the following code: df["Close"].plot().
This will plot the close price of AAPL over time.
As you can see, it is very easy to get started with the Yahoo Finance API in Python thanks to yfinance.

Yahoo Finance API Alternatives

There are a number of alternatives to the Yahoo Finance API that provide similar functionality.
  • Morning Star - Morning Star offers an Excel Add-In that allows you to access their data directly from Excel.
  • Quandl - Quandl is a provider of alternative data sets. They offer a Python package that makes it easy to get started with their data.
  • Twelve Data - Twelve Data is an alternative data provider that offers a Python SDK to access their data.
  • Fidelity Investment - Fidelity Investments is a provider of financial data and services. They offer an API to access their data.
  • Finnhub - Finnhub is a provider of financial data and services. They offer an API to access their data.
  • Trending Finance - Trending Finance acts as a provider of financial news and analysis. They offer an API to access their data.
  • IEX Cloud - IEX Cloud is a provider of financial data and services. They offer an API to access their data.