Detailed Information
Learn how to get detailed information about securities.
We'll cover the following
There are many securities-related parameters that investors look at during the financial analysis of a security. These parameters help them choose the right securities to invest in. YH Finance API provides us with an endpoint that provides us with these parameters.
The base URL https://yfapi.net/v11/finance/quoteSummary/{symbol}
provides very detailed information about the security-related parameters. Similar to other endpoints, we’ll replace the {symbol}
parameter of this endpoint with the symbol of the security we want the detailed information for.
Request Parameters
This endpoint has the following query parameters:
Parameters | Category | Type | Description |
| required | string | This represents the detail of the security we want to look at. The |
| optional | string | This parameter represents the language in which we want the information, possible values include |
| optional | string | This parameter represents the region for which we want the information. The possible options for this parameter are |
Note: To get the list of all the possible options for the
modules
parameter, click. here UntitledConcept1
The code below shows how we can use the price
module to know the different types of prices of Apple Inc. stocks. Click "Run" to execute the code.
const endpointUrl = new URL('https://yfapi.net/v11/finance/quoteSummary/AAPL');//AAPL is the symbol for Apple Inc.const queryParameters = new URLSearchParams({'modules':'price','lang':'en','region':'US'});const headerParameters = {'X-API-KEY': '{{API_KEY}}'}const options = {method: 'GET',headers: headerParameters};async function fetchStockPrices() {try {endpointUrl.search = queryParameters;const response = await fetch(endpointUrl, options);printResponse(response);} catch (error) {printError(error);}}fetchStockPrices();
Let's have a quick look at the code:
Line 1: We set the URL to
https://yfapi.net/v11/finance/quoteSummary/AAPL
.Lines 4–8: We add the query parameters.
Lines 19–27: We define an async function named
fetchStockPrices()
. This function calls this endpoint and prints the response.
We can replace the AAPL
in line 1 with the symbol of some other security to get information related to that security. When we change the input of modules
in line 5, it will give us specific information about that security. We can also retrieve information about multiple modules with one call by replacing price
in line 5 with those modules separated by a comma.
Note: The table in the Appendix contains some symbols that we can use to test this endpoint.
Response fields
Some important output fields are mentioned in the table below:
Response fields | Description |
| This list contains the security price in the early hours, just before the stock market opens. |
| This list contains the security price during the market hours, at the timestamp provided in the response. |
| This list contains the highest security price during regular market hours. |
| This list contains the lowest security price during regular market hours. |
| This list contains the closing price of the security for the previous day. |
| This list contains the price of the security at the opening of the market. |
Note: The response also contains other important information. The information varies depending on the module or security we select.