Shopify functions must be deterministic and execute within 5ms. Enabling external API calls in functions would break these requirements, thus it’s not something we support or intend to.
Alternatively, you can place that product information in metafields, or populate it in cart attributes or line item properties. The key is, you need to make the information available ahead of time, before the function executes, and then add it to your input query.