I have a REST request that returns a json with values
{"Meta Data":{"1. Information":"Intraday (1min) prices and volumes","2. Symbol":"MSFT","3. Last Refreshed":"2018-05-30 16:00:00","4. Interval":"1min","5. Output Size":"Compact","6. Time Zone":"US/Eastern"},"Time Series (1min)":{"2018-05-30 16:00:00":{"1. open":"99.0000","2. high":"99.0500","3. low":"98.9100","4. close":"98.9500","5. volume":"2233252"}, ......
I ask it this way:
$(document).ready(function () {
$.ajax({
url: "https://www.alphavantage.co/query?function=TIME_SERIES_INTRADAY&symbol=MSFT&interval=1min&apikey=*******"
}).then(function (data) {
console.log(JSON.stringify(data));
});
});
The problem is that every time I return the field is with different values since the date changes.
Asking in the forum they told me how to represent the data of the moment. But the data changes so I've thought about adding a regular expression:
data["Time Series (1min)"]["^([1-9]|([012][0-9])|(3[01]))-([0]{0,1}[1-9]|1[012])-\d\d\d\d [012]{0,1}[0-9]:[0-6][0-9]$"]["1. open"]
But it does not work, can I add elements of regular expressions the way I'm doing, any help?