In this article, I will introduce the Yahoo! Financial Aggregator API. Finance . There is one nuance in the story - the official API of Yahu Finance was closed three years ago , but almost immediately its undocumented, workable version appeared, which is still alive. For research purposes, I would like to tell you more about the use of this workable version.

Moreover, the list of markets from which data can be obtained through Yahu Finance is huge . At the moment, there are 79 countries in it, including Russia.

Apple Inc. (AAPL) on Yahu Finance website and API

Looking at data from the perspective of a long-term private investor

Below I will consider obtaining only those parameters that, in my opinion, may be of interest to a long-term private investor:

  1. Name of paper
  2. Paper price
  3. Year-to-date income
  4. Dividend Yield
  5. Date of previous dividend
  6. Previous dividend value
  7. Annual fee for funds
  8. Category of securities

The Yahu Finance API provides responses in JSON format. In the screenshots using the API, I’m using the Google Chrome browser extension: JSON-handle .

Name of paper / Name

Having only the ticker, you can always get a huge number of parameters, the first in the list, in my opinion, is the name of the instrument. First, we will find it on the website using the example of the SPDR S&P 500 ETF Trust (SPY):

ETF name on the Yahu Finance website

After that, we will find the name already through the API - it is displayed in JSON format in two versions: shortName and longName. The data link, including the name, looks like this: ETF name via Yahu Finance API The named property contains a string value . The way to get this key:

[https://query1.finance.yahoo.com/v10/finance/quoteSummary/SPY?modules=price](https://query1.finance.yahoo.com/v10/finance/quoteSummary/SPY?modules=price)

longNameSPDR S&P 500 ETF Trust

JSON.quoteSummary.result[0].price.longName

Paper Price / Price

The next important parameter is of course the price. Find it for Berkshire Hathaway Inc. (BRKA) : The

price of shares on the Yahu Finance website.

Next, we get the price through the API. The section containing the price is similar to getting the name: Share price via the Yahu Finance API A key with a name for can be obtained with or without formatting. The way to get this property:

[https://query1.finance.yahoo.com/v10/finance/quoteSummary/BRKA?modules=price](https://query1.finance.yahoo.com/v10/finance/quoteSummary/BRKA?modules=price)

rawregularMarketPrice JSON.quoteSummary.result[0].price.regularMarketPrice.raw

YTD / YTD Daily Total Return

This parameter can be viewed only for funds. Using the example of Vanguard Total Stock Market Index Fund ETF Shares (VTI) :

#api #coding #api яху финанс

Все финансовые рынки мира в API Яху Финанс
1.35 GEEK