From 9dd1239b6acf85b968fea21cf4d18b67c4131e44 Mon Sep 17 00:00:00 2001 From: advaiyalad Date: Wed, 17 Feb 2021 17:19:04 -0600 Subject: [PATCH] docs(trendingSymbols): add docs for trendingSymbols --- README.md | 1 + docs/README.md | 1 + docs/modules/trendingSymbols.md | 48 +++++++++++++++++++++++++++++++++ 3 files changed, 50 insertions(+) create mode 100644 docs/modules/trendingSymbols.md diff --git a/README.md b/README.md index 998802db..647d6aec 100644 --- a/README.md +++ b/README.md @@ -65,6 +65,7 @@ recommendationTrend, secFilings, sectorTrend, summaryDetail, summaryProfile, symbol, topHoldings, upgradeDowngradeHistory), [`search`](./docs/modules/search.md), [`recommendationsBySymbol`](./docs/modules/recommendationsBySymbol.md), with more +[`trendingSymbols`](./docs/modules/trendingSymbols.md), [coming soon](https://github.com/gadicc/node-yahoo-finance2/issues/8). See the [Full Documentation](./docs/README.md). diff --git a/docs/README.md b/docs/README.md index 14f7a3ca..036a5561 100644 --- a/docs/README.md +++ b/docs/README.md @@ -33,6 +33,7 @@ const result = await yahooFinance.module(query, queryOpts, moduleOpts); 1. [quoteSummary](./modules/quoteSummary.md) - comprehensive symbol info. 1. [search](./modules/search.md) - symbol lookup, news and articles. 1. [recommendationsBySymbol](./modules/recommendationsBySymbol.md) - similar symbols. +1. [trendingSymbols](./modules/trendingSymbols.md) - symbols trending in a country. ## Error Handling diff --git a/docs/modules/trendingSymbols.md b/docs/modules/trendingSymbols.md new file mode 100644 index 00000000..1ea63cde --- /dev/null +++ b/docs/modules/trendingSymbols.md @@ -0,0 +1,48 @@ +# trendingSymbols + +## Usage: + +```js +import yahooFinance from 'yahoo-finance2'; +const queryOptions = { count: 5, lang: 'en-US' }; +const result = await yahooFinance.trendingSymbols('US', queryOptions); +``` +Result: +```js +{ + count: 5, + quotes: [ + { symbol: 'TWLO' }, + { symbol: 'RIOT' }, + { symbol: 'LODE' }, + { symbol: 'TLRY' }, + { symbol: 'FSLY' } + ], + jobTimestamp: 1613600090081, + startInterval: 202102172100 +} +``` + +## API + +```js +await yahooFinance.trendingSymbols(query, queryOptions, moduleOptions); +``` + +### Query + +The country name has to be an ISO2 code, either uppercase or lowercase. Most countries will not return data. Only `US`, `GB`, and a couple other will. + +### Query Options + +| Name | Type | Default | Description | +| -------- | ------ | ------- | ----------------------------------------------------------------- | +| `count` | number | 5 | The max amount of symbols that can be returned. | +| `lang` | string | "en-US" | | +| `region` | string | | The region/country. Will override the search country is provided. | + +**NOTE:** `corsDomain` seems to be a parameter for the API according to #8, but it does nothing. **It does not set the CORS domain.** Therefore, it is not a parameter. + +### Module Options + +See [Common Options](../README.md#common-options). \ No newline at end of file