Skip to content

sdclarkelab/jamstockex-api

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

81 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

StockWatchJa: JamStockEx API v2

The StockWatchJa: JamStockEx API v2 serves up stock details info as JSON at this URL. The data is pulled from StockWatchJa: JamStockEx Scraper.

Response Preview

{
  "stocks": [
    {
      "id": "5f4efd8b77435e97079e95bb",
      "lastUpdatedDate": "1995-06-22T18:31:18.362Z",
      "instrumentName": "SOME STOCK NAME",
      "symbol": "SYMBOL",
      "currency": "JMD",
      "sector": "TOURISM",
      "type": "ORDINARY",
      "website": null,
      "isListed": true,
      "market": "Main Market",
      "corporateActionUrl": "https://www.jamstockex.com/market-data/listed-companies/corporate-actions/SYMBOL/latest",
      "dividends": [],
      "tradeInfo": {
        "volumeTraded": 955,
        "dollarChange": 0,
        "marketPrice": 0.3,
        "percentageChange": 0,
        "lastUpdatedDate": "1995-06-22T18:31:18.345Z"
      }
    },
  .....
  ],
  "results": 10,
  "total": 245,
}

API Documentation

Click here to view the API documentation.

Requirements

Tool Version Source
NodeJs 10.16.2 (includes npm 6.9.0) Nodejs v10.x Releases
Heroku - Getting Started on Heroku with Python
Windows OS 10 -

Heroku Setup

Installation

  1. Install GIT
  2. Install Heroku
  3. Login using the following command
heroku login

Prepare Heroku to recieve source code

Create environment file file

Create ".env" in application root folder

DB="<MongoDB-node-2.2.12-connection-string>"
PORT=5000

Create Heroku project in Heroku

heroku create jamstockex-api

Set Environment Variables

heroku config:set DB="<MongoDB-node-2.2.12-connection-string>"
heroku config:set PORT=5000

Deploy

git push heroku your_local_branch_name:master

Validate that the application is live

heroku ps:scale web=1

Test locally with heroku

heroku local web