Endpoint that accepts:
- date range
- ticker(s)
- optional grouping weekly flag
Returns JSON payload containing:
- company name
- ticker
- date
- high price
- low price
- closing price
- grouped by day or week
Update db configs constants.
php -S localhost:8080 Ticker\ API.php
curl 'http://localhost:8080?date_from=2017-07-12&date_to=2017-07-13&ticker=WMT,TGT'
{
"dayname": {
"Tuesday": [
{
"name": "Walmart",
"ticker": "WMT",
"d": "2017-01-03",
"high": "69.24",
"low": "68.05",
"close": "68.66"
}
],
"Wednesday": [
{
"name": "Walmart",
"ticker": "WMT",
"d": "2017-01-04",
"high": "69.63",
"low": "68.60",
"close": "69.06"
}
]
}
}
curl 'http://localhost:8080?date_from=2017-07-12&date_to=2016-07-13&ticker=WMT,TGT&group_weekly=true'
{
"week": {
"1": [
{
"name": "Walmart",
"ticker": "WMT",
"d": "2017-01-03",
"high": "69.24",
"low": "68.05",
"close": "68.66"
},
{
"name": "Walmart",
"ticker": "WMT",
"d": "2017-01-04",
"high": "69.63",
"low": "68.60",
"close": "69.06"
}
]
}
}