You could read this documentation: jQuery.getJSON()
As examples You can use (from this documentation):
$.getJSON( "ajax/test.json", function( data ) {
var items = [];
$.each( data, function( key, val ) {
items.push( "<li id='" + key + "'>" + val + "</li>" );
});
$( "<ul/>", {
"class": "my-new-list",
html: items.join( "" )
}).appendTo( "body" );
});
With this You could replace "ajax/test.json" to "ajax/getapi.php?method='method_wich_you_need'" and make ajax/getapi.php like this:
<?php
// curl session initialization
$ch = curl_init();
$method = $_GET['method'];
// set curl options
curl_setopt($ch, CURLOPT_URL, "http://api.com/method/".method."&json");
curl_setopt($ch, CURLOPT_HEADER, 0);
// load page from API
if($result = curl_exec($ch) === false)
{
echo 'Error: ' . curl_error($ch);
}
else
{
echo $result;
}
curl_close($ch);
?>