Get a sample of your json, put it manually in a blank api and initialise.

Put your code in a run js workflow and send it to your bubble to js element using bubble_fn_xxx

I output as text and then use a json to bubble things plugin to convert to the api thing you initialised