// Use getTop100Agent1Holders() to get a list of Top 100 Holders.functiongetTop100Agent1Holders() {// API: https://a1api.moonlanders.wiki/reference/api-reference/holders-and-wallets// Modify to use other API. $url ="https://agent1.xyz/nft/getStats/top100holders";// Enter your AGENT1 X-API-KEY (if any or leave blank "") $apiKey ="10001"; // Enter your AGENT1 X-API-NAME (if any or leave blank "") $appName ="AGENT1_MADE_ME_A_CODER"; try { $json_data =fetchJsonData($url, $apiKey, $appName);print_r($json_data); } catch (Exception $e) {echo'Error: '. $e->getMessage(); }}functionfetchJsonData($url, $apiKey ="", $appName ="") {// Initialize cURL session $curl =curl_init($url);// Set the custom headers $headers =array('X-API-KEY: '. $apiKey,'X-APP-NAME: '. $appName );// Set cURL optionscurl_setopt($curl, CURLOPT_HTTPHEADER, $headers);curl_setopt($curl, CURLOPT_RETURNTRANSFER,true);// Execute cURL session and get the JSON data as a string $json_string =curl_exec($curl);// Check if the operation was successfulif ($json_string ===false) { $error =curl_error($curl);curl_close($curl);thrownewException('Error fetching JSON data from '. $url .': '. $error); }// Close cURL sessioncurl_close($curl);// Decode the JSON string into a PHP associative array $json_data =json_decode($json_string,true);// Check if the JSON decoding was successfulif ($json_data ===null&&json_last_error()!==JSON_ERROR_NONE) {thrownewException('Error decoding JSON data: '.json_last_error_msg()); }return $json_data;}