Skip to content

Commit

Permalink
docs(trendingSymbols): add docs for trendingSymbols
Browse files Browse the repository at this point in the history
  • Loading branch information
advaiyalad committed Feb 17, 2021
1 parent 4f486f7 commit 9dd1239
Show file tree
Hide file tree
Showing 3 changed files with 50 additions and 0 deletions.
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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).
Expand Down
1 change: 1 addition & 0 deletions docs/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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.

<a name="error-handling"></a>
## Error Handling
Expand Down
48 changes: 48 additions & 0 deletions docs/modules/trendingSymbols.md
Original file line number Diff line number Diff line change
@@ -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).

0 comments on commit 9dd1239

Please sign in to comment.