Since contracts don't have the ability to interact with the outside world directly, you can make use of the Oracle implementation to achieve this functionality. A simple Oracle server will listen to specific events occurring in the smart contract and will make API calls based on the parameters. The server will respond by making a callback transaction with the result of the API call.
The design can be illustrated as follows: