-
Notifications
You must be signed in to change notification settings - Fork 62
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
docs(trendingSymbols): add docs for trendingSymbols
- Loading branch information
1 parent
4f486f7
commit 9dd1239
Showing
3 changed files
with
50 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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). |