How to access Json Attribute which has space in its name

hi there

I’m trying to parse a JSON that fails in some lines:

{
“timezone”: “UTC”,
“serverTime”: 1635788550,
“symbol”: {
“Asset”: “xxx”,
“Market”: “xxxxl”,
“xasks”: 48245,
“xasks3”: 81243,
“xasks24”: 72627,
“xbids”: 15106,
“xbids3”: 79229,
“xbids24”: 80078,
“ofr”: 52.31,
“Sells <$100”: 2.61,
“Sells <$50k”: 97.03,
“Sells >$50k”: 0.36,
“Sells 1hr”: 5.03,
“Sells 6hr”: 18.7,
“Sells 24hr”: 76.27,
“Buys <$100”: 2.58,
“Buys <$50k”: 96.74,
“Buys >$50k”: 0.68,
“Buys 1hr”: 5.95,
“Buys 6hr”: 18.78,
“Buys 24hr”: 75.27,
“ofr3”: 1.26,
“ofr24”: -4.88,
“usdPrice”: 37.16,
“btcPrice”: 0.000610012842
}
}

Those with spaces like “Sells <$100” are not able to use jsonObject.SelectToken…

Can someone help me?

Thanks in advance

Hi @Tracerecart,

Can you share the screenshots ? what error does it throw?

Can you try giving like below instead ?

jsonObject.SelectToken("[‘Sells <$100’]")

REgards
Sonali

1 Like

Thank you, Sonali.

Fantastic.

Cheers

Hi @Tracerecart,

I am glad I could help :slight_smile:

Regards
Sonali

This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.