Last name:
entity_ids as $person) { // Use the matching API id(s) to return profile information $url = "http://api.sunlightlabs.com/people.getPersonInfo.php?id=$person"; curl_setopt($ch, CURLOPT_URL, $url); curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1); // Object containing congressperson information $info = json_decode(curl_exec($ch)); /* ================================================== The CARMA API returns results in XML format We then parse the data ================================================== */ $fullname = $info->firstname . '+' . $info->lastname; $url = "http://carma.org/api/1.1/searchLocations?name=$fullname®ion_type=6"; curl_setopt($ch, CURLOPT_URL, $url); curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1); $stats = json_decode(curl_exec($ch)); ?>

<?php echo $query; ?>
, state_full_name; ?> (party; ?>)
Tons CO2 (Now -- Future): carbon->present) . ' -- ', number_format($stats->carbon->future); ?>
MWh Energy (Now -- Future): energy->present) . ' -- ', number_format($stats->energy->future); ?>
Intensity (Now -- Future): intensity->present) . ' -- ', number_format($stats->intensity->future); ?>
Plants: plant_count; ?>