Git Product home page Git Product logo

historical-quotes's Introduction

historical-quotes

Node.js webservice that gets JSON-formatted historical quotes from Yahoo Finance.

Uses the yahoo-managed HistCSVDownload webservice, then converts the data to json.

Getting Started

  1. Deploy the source code to a host which supports Node.
  2. Run node index.js
  3. Call the URL. e.g. http://some-host/?symbol=GOOG
  4. Get jsonp response, which is historical quotes sorted by date in descending order

Example

Request

http://some-host:8888/?symbol=GOOG&startDate=2013-07-09&endDate=2013-07-11&interval=d

###Response

callback({
    data: [{
        "Date": "2013-07-11",
        "Open": "913.00",
        "High": "920.81",
        "Low": "908.52",
        "Close": "920.24",
        "Volume": "2584200",
        "Adj Close": "920.24"
    }, {
        "Date": "2013-07-10",
        "Open": "903.45",
        "High": "911.14",
        "Low": "900.38",
        "Close": "905.99",
        "Volume": "1708400",
        "Adj Close": "905.99"
    }, {
        "Date": "2013-07-09",
        "Open": "911.00",
        "High": "912.95",
        "Low": "897.98",
        "Close": "905.24",
        "Volume": "1964200",
        "Adj Close": "905.24"
    }]
})

Options

You can specify options via GET parameters in the url.

The following is a list of parameters:

  • symbol: (Mandatory) Specify the stock to lookup by ticker; any ticker that works on Yahoo Finance should work here.
    • e.g. http://some-host/?symbol=GOOG
  • endDate: Specify the end date, inclusive, for historical quotes, in yyyy-mm-dd format.
    • e.g. http://some-host/?symbol=GOOG&endDate=2013-07-11.
    • Default: today's date.
  • startDate: Specify the start date for historical quotes, in yyyy-mm-dd format.
    • e.g. http://some-host/?symbol=GOOG&startDate=2013-05-19.
    • Default: endDate minus one year.
  • interval: Specify the interval of quotes, in days ('d'), weeks ('w') or years ('y').
    • e.g. http://some-host/?symbol=GOOG&interval=w.
    • Default: 'd' (Days).

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.