Including API key in the header :(

I’m suspicious that httpDo(), httpGet() & httpPost() don’t take advantage of preload().

Therefore the execution can reach setup() & even draw() and the loading isn’t finished yet!

That’s why your console.log(spid[0]); fails, b/c spid[] array hasn’t been initialized by the success callback function (res) { spid = res; } within httpDo().

According to the httpDo()'s example you seem to be doing it right by including a headers property:

But given I don’t have your API Key, I’ve written a sketch to get the file “spid.json” via a CDN proxy.

If you wish you can take a look at it: