How to consume external API from WordPress post editor and display the response data in the custom field?

How to consume external API from WordPress post editor and display the response data in the custom field?