Finding it hard to reliably parse data, returns undefined error inevitably

nodejs
javascript

#1

I’m try to parse specific data from the streaming api using JSON keys to obtain the values. This works for a short period, then returns an undefined error. Is there anything I can do to get around this?