-
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.
- Loading branch information
Showing
6 changed files
with
692 additions
and
1 deletion.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
# yahoo-finance docs | ||
|
||
## Table of Contents | ||
|
||
1. [Common Options](#common-options) | ||
1. Modules | ||
1.1. [autoc](./modules/autoc.md) | ||
1.1. [historical](./modules/historical.md) | ||
1.1. [quoteSummary](./modules/quoteSummary.md) | ||
1.1. [search](./modules/search.md) | ||
|
||
<a name="common-options"></a> | ||
## Common Options |
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,59 @@ | ||
# autoc (auto complete) | ||
|
||
## Usage: | ||
|
||
```js | ||
import yahooFinance from 'yahoo-finance2'; | ||
|
||
const query = 'GOO'; | ||
const result = await yahooFinance.autoc(query, /* queryOptions */); | ||
|
||
{ | ||
Query: 'GOO', | ||
Result: [ | ||
{ | ||
symbol: 'GDRX', | ||
name: 'GoodRx Holdings, Inc.', | ||
exch: 'NMS', | ||
type: 'S', | ||
exchDisp: 'NASDAQ', | ||
typeDisp: 'Equity' | ||
}, | ||
{ | ||
symbol: 'GOOG', | ||
name: 'Alphabet Inc.', | ||
exch: 'NMS', | ||
type: 'S', | ||
exchDisp: 'NASDAQ', | ||
typeDisp: 'Equity' | ||
}, | ||
{ | ||
symbol: 'GOOGL', | ||
name: 'Alphabet Inc.', | ||
exch: 'NAS', | ||
type: 'S', | ||
exchDisp: 'NASDAQ', | ||
typeDisp: 'Equity' | ||
}, | ||
// .... | ||
} | ||
``` | ||
|
||
See also: [search](./search.md). | ||
|
||
## API | ||
|
||
```js | ||
await yahooFinance.autoc(query, queryOptions, fetchOptions); | ||
``` | ||
|
||
### Query term | ||
|
||
Symbol, company name, SEDOL, etc. | ||
|
||
### Query Options | ||
|
||
| Name | Type | Default | Description | | ||
| ------------- | ----------| ---------- | --------------------------------- | | ||
| `region` | number | 1 | | | ||
| `lang` | string | "en" | | |
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,57 @@ | ||
# historical | ||
|
||
## Usage: | ||
|
||
```js | ||
import yahooFinance from 'yahoo-finance2'; | ||
|
||
const query = 'TSLA'; | ||
const queryOptions = { period1: '2021-02-01', /* ... */ }; | ||
const result = await yahooFinance.search(query, queryOptions); | ||
|
||
[ | ||
{ | ||
date: new Date("2021-02-01T00:00:00.000Z"), | ||
open: 814.289978, | ||
high: 842, | ||
low: 795.559998, | ||
close: 839.809998, | ||
adjClose: 839.809998, | ||
volume: 25391400 | ||
}, | ||
{ | ||
date: new Date("2021-02-02T00:00:00.000Z"), | ||
open: 844.679993, | ||
high: 880.5, | ||
low: 842.200623, | ||
close: 872.789978, | ||
adjClose: 872.789978, | ||
volume: 24346213 | ||
} | ||
] | ||
``` | ||
|
||
## API | ||
|
||
```js | ||
await yahooFinance.historical(query, queryOptions, fetchOptions); | ||
``` | ||
|
||
### Query term | ||
|
||
Symbol, company name, SEDOL, etc. | ||
|
||
### Query Options | ||
|
||
| Name | Type | Default | Description | | ||
| ------------- | ----------| ---------- | --------------------------------- | | ||
| `period1` | Date* | *required* | Starting period | ||
| `period2` | Date* | (today) | Ending period | ||
| `interval` | "1d", "1wk", "1mo" | "1d" | Interval (day, week, month) | ||
| `events` | string | "history" | ||
| `includeAdjustedClose` | boolean | true | ||
|
||
Dates* can be: | ||
|
||
* A **Date** instance, e.g. `new Date(something)` | ||
* A **string** that can be parsed by `Date()`, e.g. `"2020-01-01"`. |
Oops, something went wrong.