This is an API for Stock collector. It's a node/express and mongoDB application.
npm install --production
Simply type:
npm start
or
node server/app.js
Add new stock into db
-
Body request:
{ "ticket": "NYSE:LNKD", "user": "bernieMadoff", "account": "PonziINC", "sell": 50.50, "rate": 10.00, "time": "2016-04-02T15:04:05Z07:00", "buy": 505.00 }
-
response
{ "success": true, "stock": { "__v": 0, "market": "NYSE", "ticket": "NYSE:LNKD", "user": "bernieMadoff", "account": "PonziINC", "sell": 50.5, "rate": 10, "time": "2016-04-02T15:04:05.000Z", "buy": 505, "_id": "56ca85507189d6485dcaad66" } }
Get the most operated stock for each account, where the total operated value is greater than 100K.
-
Response:
{ "success": true, "stock": [Stock List] }
Get the most active user in the last hour
-
Response:
{ "success": true, "user": "bernieMadoff", "count": 8765 }
Get the most expensive stock for the last day.
-
Response:
{ "success": true, "stock": [Stock List] }
Get the mean and the median value for a requested date range
- For instance, I'm returning only the mean (average)
- body request:
-
{ "fromDate": "2016-02-02T15:04:05Z07:00", "toDate": "2016-04-02T15:04:05Z07:00" }
response:
{
"success": true,
"mean": 20.299102691924226
}