How to call external api to pull data into json format? There is an api that is used to expose data from an external website. How can I use the drupal API to call the external api and pull the data into json format?

the external api would be, for example, "api.website.com/api/get_data". 

return results would be in json format "{"data":[....]}

How would I use a module to call the external api and return the data in json?
It depends on what you wish to do with said data.

If you are looking for a purely code approach, you could do something like:

$response = drupal_http_request($url);
$result = json_decode($response-&gt;data);


If you want a Rules based approach, you could could use the Rules HTTP Client module, which allows you to do essentially the same as the above code but via the Rules UI.