Monitored Stocks and Mutual Funds
Learn to see a list of the most popular stocks or mutual funds on traders' watchlists.
We'll cover the following
What if we want to know which stocks or mutual funds people are keeping an eye on? YH Finance has got us covered.
The endpoint https://yfapi.net/ws/screeners/v1/finance/screener/predefined/saved
gives us information about the stocks or mutual funds that have been added to the watchlists by most traders. This interest of the traders translates into a rise in the price of the stock or mutual funds. So by observing the watchlists, we can get an idea which securities may prove to be beneficial.
Request parameters
We can use the following two query parameters with this endpoint.
Parameters | Category | Type | Description |
| required | string | This is the screener ID. It is used to filter the watchlists to get a list based on our defined metrics. The |
| optional | number | The |
Note: To get the list of all possible options for
scrIds
, click. here UntitledConcept2
The code below demonstrates how we can use this endpoint to get information about the top 25 day gainer stocks on watchlists. Click "Run" to get the list.
const endpointUrl = new URL('https://yfapi.net/ws/screeners/v1/finance/screener/predefined/saved');const queryParameters = new URLSearchParams({count:'25',scrIds:'day_gainers',});const headerParameters = {'X-API-KEY': '{{API_KEY}}'}const options = {method: 'GET',headers: headerParameters};async function fetchMostWatchedStocks() {try {endpointUrl.search = queryParameters;const response = await fetch(endpointUrl, options);printResponse(response);} catch (error) {printError(error);}}fetchMostWatchedStocks();
Let's look at the code:
Line 1: We set the URL to
https://yfapi.net/ws/screeners/v1/finance/screener/predefined/saved
.Lines 3–6: We add the query parameters.
Lines 17–25: We define a function named
fetchMostWatchedStocks()
that calls this endpoint and prints the response.
We can change the value of count
in line 4 with any other number to get a different number of stocks. We can get a different list by changing the value of scrIds
in line 5.
Response fields
We'll get the criteria on which these stocks are being rated, and information about the 25 most-watched day gainer stocks added to the watchlist. Some important response fields are mentioned in the table below.
Response fields | Description |
| This is the number of stocks of mutual funds we get in response. |
| This is the list of quotes of the stocks which meet our criteria. |
| This is the total number of stocks or mutual funds that fall within the selected criteria. |
Note: The response also contains other important information. The response fields can vary depending on the query parameter values.