It is required that from a custom page access an API External to Shopify. What would be the best way to implement this requirement? what do they advise?
Unfortunately you cannot make HTTP requests from the Shopify backend, therefore executing API calls with confidential data (password, api key etc) shouldn't be done through the frontend. So the above code, although it works, is highly insecure.
A solution could be to have a separate survey to make the API calls for your store. Server hosting is really cheap on AWS or Google Cloud so it can be quite inexpensive, but is still extra work to setup.
Sorry for the disappointment, but I hope it helps!