You could populate the attribute table of feature layer whose feature is being clicked on to trigger the popup with lat and long coords, then use Arcade to insert those values into a query string. Or you could simply add the query text with the coordinates of each feature into a new attribute column.
As for getting the info back and parsing it into a pop-up window I found a similar question posed here. The answer that one I believe the asker ultimately used I don't think is possible in ArcGIS Online. There were other suggestions to use Arcade or JavaScript to display info from an external API, and those seem more doable to me, but I don't know where to start from there.
In my case, looking to grab attribute info from a JSON with a simple query based on a unique ID for each feature, (http://someurl.com/file.json?unique_id=999) and populate my pop-up with that information - if that's possible. Is that something like what you're trying to accomplish?