I am a newbie to JSON and I have some JSON that I trying to parse with C#.
I have tried making a class to represent by data, but the names of my properties are based on times so I’d have to hard code my data contracts. I’ve tried JSON.NET and LINQ to sort through the data, but keep getting null values due to the strange object/property.
Again I am very new to JSON so I’m sure there is a simple fix to this, I’m just not sure how to ask the question correctly. Thank you for your help.
Below is a small sample of JSON I am struggling to parse. Again thanks.
{
"Meta Data": {
"1. Information": "Intraday (1min) prices and volumes",
"2. Symbol": "MU",
"3. Last Refreshed": "2017-05-30 16:00:00",
"4. Interval": "1min",
"5. Output Size": "Full size",
"6. Time Zone": "US/Eastern"
},
"Time Series (1min)": {
"2017-05-30 16:00:00": {
"1. open": "30.7200",
"2. high": "30.7300",
"3. low": "30.7000",
"4. close": "30.7000",
"5. volume": "1390302"
},
"2017-05-30 15:59:00": {
"1. open": "30.7750",
"2. high": "30.7800",
"3. low": "30.7200",
"4. close": "30.7250",
"5. volume": "380134"
}
}
}
Note that the "Time Series"
properties come in 1min, 5min, 15min, 30min, 60min intervals, i.e. "Time Series (##min)"
for various ##min
.