Giter VIP home page Giter VIP logo

stock-tracker's Introduction

stock-tracker Build Status Codacy Badge

NodeJS stock tracker. Read historical stock data from an API to store in local DB. Offer API to integrate data into a dashboard. https://github.com/alecc08/stock-tracker-dashboard

Using Alphavantage API to get data. You can get your own API key from them at https://www.alphavantage.co

Note: Alphavantage is free but they request not to query them over 100 calls per minute. Please respect this limit or contact them to work something out. This application shouldn't have any need get anywhere near that volume, as the data returned will be from the database unless the stock wasn't already obtained.

API Endpoints:

Update a stock:

POST
/stocks

 - Params
   -stockCode

Ex: POST /stocks stockCode:MSFT

Auto update stocks

There's a cron job that runs at your time of choosing to update all stocks in the database. You can change this time in config.js

Get a stock:

GET
/stocks

 - Params
   -stockCodes : Comma seperated list of stocks
   -start : YYYY-MM-DD format date start
   -end   : YYYY-MM-DD format date end

Ex: GET /stocks stockCodes:MSFT,FB,GOOG start:2017-01-01 end:2017-02-02

Get an account:

GET
/accounts

 - Params
   -accountId 

Ex: POST /stocks stockCode:MSFT

Create an account:

POST
/accounts
 - Params
    -accountName

Run sql on DB

To run some custom sql directly into the db, simply run the dbConsole.js file with node

node dbConsole

Then you can run any sql statement followed by a semicolon to execute the query. E.g.

SELECT * FROM stock_history;

stock-tracker's People

Contributors

alecc08 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.