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.
Nick Wesselman | Shopify - Was my reply helpful? Click Like to let me know! - Was your question answered? Mark it as an Accepted Solution - To learn more visit the Shopify Help Center or the Shopify Blog