https://github.com/vutran/yahoo-stocks
Fetch stock data from Yahoo! Finance
https://github.com/vutran/yahoo-stocks
data finance scaper stocks trade yahoo
Last synced: 6 months ago
JSON representation
Fetch stock data from Yahoo! Finance
- Host: GitHub
- URL: https://github.com/vutran/yahoo-stocks
- Owner: vutran
- License: mit
- Created: 2017-03-09T02:40:46.000Z (over 8 years ago)
- Default Branch: master
- Last Pushed: 2019-02-12T18:33:57.000Z (over 6 years ago)
- Last Synced: 2025-04-09T11:50:44.635Z (6 months ago)
- Topics: data, finance, scaper, stocks, trade, yahoo
- Language: JavaScript
- Homepage:
- Size: 348 KB
- Stars: 24
- Watchers: 4
- Forks: 6
- Open Issues: 2
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# yahoo-stocks
[](https://travis-ci.org/vutran/yahoo-stocks) [](https://coveralls.io/github/vutran/yahoo-stocks) [](LICENSE)
> Fetch stock data from Yahoo! Finance
## Install
```
$ npm install --save yahoo-stocks
```## Usage
```
import { lookup, history } from 'yahoo-stocks';lookup('AAPL').then(response => {
console.log(response);
});history('AAPL').then(response => {
console.log(response);
});
```## API
### lookup(symbol)
Returns a `Promise` that resolves the data for the symbol.
#### symbol
Type: `String`
The stock symbol.
### history(symbol, [options])
Returns a `Promise` that resolves the price history for the symbol.
#### symbol
Type: `String`
The stock symbol.
#### options
Type: `Object`
A dictionary of customizable options
* `interval` - Set the interval for the price changes, e.g. `1m`, `1d`, `5d`, `1mo`, `1y`.
* `range` - Set the range of dates to include in the output, value values are: `1d`, `5d`, `1mo`, `3mo`, `6mo`, `1y`, `2y`, `5y`, `10y`, `ytd`, `max`## License
MIT © [Vu Tran](https://github.com/vutran/)