Consume external API from custom block
I'd do it this way:


Create a custom module 
Create a class inside the src folder that consumes the API 
Create a custom block inside your module: call the class there


Mostly it is better to fetch f.e. each hour and save the api data to custom entities. In this way you can cache the content in the block which enhances performance.