I'm struggling to find a solution and implement it in the correct format.
An API returns a JSON file to me via a URL. The format is as follows:
{"success":true,
"data":[
{
"loadTimestamp":"2022-07-20T15:12:35.097Z",
"seqNum":"9480969",
"price":"45.7",
"quantity":"0.2",
"makerClientOrderId":"1658329838469",
"takerClientOrderId":"1658329934701"
},
{
"loadTimestamp":"2022-07-20T14:49:11.446Z",
"seqNum":"9480410",
"price":"46",
"quantity":"0.1",
"makerClientOrderId":"1658328403394",
"takerClientOrderId":"0"
}]
}
Since it is received via URL, I cannot directly access the object using code like:
myobj['data']['price']
I have the option to either convert the data from a string using JSON.parse(), or work with it as an object. However, I am facing difficulties in using it directly.
It seems like the JSON file contains an array of data inside it. My objective is to display all the data from the array, focusing on values like price and quantity.
How can I extract the specific values I need?