Code Monkey home page Code Monkey logo

yahoo-dl's Introduction

yahoo-dl

A command-line tool for downloading yahoo stock prices.

Installation

npm install -g yahoo-dl

yahoo-dl installation

Usage

To download weekly data for Apple you need to use following command from commandline.

yahoo-dl -t w get AAPL

Download Stock Price

This will download weekly historically data for the latest 12 months.

Usage: yahoo-dl [options] [command]

Yahoo stock price downloader.

Options:
  -V, --version                output the version number
  -t, --timeframe <d,w,m>      Timeframe d for daily, w for weekly, m for monthly. (default: "w")
  -p, --period <104>           Period of the selected time frame e.g. 200, 12 etc... (default: 104)
  -o, --stdout                 Output will be written to stdout.
  -f, --filename <symbol.csv>  Output will be written to a file default is symbol.csv
  -s, --skip                   Do not overwrite if file exits. Usefull to retry a download.
  -h, --help                   output usage information

Commands:
  get <symbol>

Example

Download spy 104 week data.

kg@tmp $ yahoo-dl get spy
ℹ Writing to /Users/kg/tmp/spy.csv
✔ Done spy  104w

Output is as follows

kg@tmp $ cat spy.csv
Date,Open,High,Low,Close,Adj Close,Volume
2016-10-24,215.000000,215.320007,211.710007,212.539993,204.589417,420237800
2016-10-31,212.929993,213.190002,208.380005,208.550003,200.748672,485446500
2016-11-07,208.550003,218.309998,208.550003,216.419998,208.324280,743158200
2016-11-14,217.029999,219.270004,215.720001,218.500000,210.326462,404338000
2016-11-21,219.169998,221.559998,219.000000,221.520004,213.233505,232394000
...
2018-10-01,292.109985,293.209991,286.220001,287.820007,287.820007,391529300
2018-10-08,287.049988,288.859985,270.359985,275.950012,275.950012,834839200
2018-10-15,275.549988,281.149994,274.299988,276.250000,276.250000,605470400

Download symbol list

Download fidelity sector data for last 20 weeks

cat fidelity-sectors.txt | xargs -L 1 -t yahoo-dl -t w -p 20 get

Output will be as follows

yahoo-dl -t w -p 20 get FSTCX
ℹ Writing to /Users/kg/git/stock-ranker/FSTCX.csv
✔ Done FSTCX  20w
yahoo-dl -t w -p 20 get FSRFX
ℹ Writing to /Users/kg/git/stock-ranker/FSRFX.csv
✔ Done FSRFX  20w
yahoo-dl -t w -p 20 get FSUTX
ℹ Writing to /Users/kg/git/stock-ranker/FSUTX.csv
✔ Done FSUTX  20w
yahoo-dl -t w -p 20 get FWRLX
ℹ Writing to /Users/kg/git/stock-ranker/FWRLX.csv
✔ Done FWRLX  20w

Symbols

You can find some of the symbols from here

License

MIT

yahoo-dl's People

Contributors

korayguclu avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.