WordPress has its own HTTP API for talking to external services. Use wp_remote_get() and wp_remote_post() instead of cURL, because they work on any hosting and respect the site settings.
Transients store data temporarily in the database or in the object cache, with an expiration time. They are perfect for saving the result of slow work, like an external API…