2 ); // Build query string $queryString = http_build_query($params); // Final URL with query string $urlWithParams = $url . '?' . $queryString; // Initialize cURL session $ch = curl_init(); // Set cURL options curl_setopt($ch, CURLOPT_URL, $urlWithParams); curl_setopt($ch, CURLOPT_RETURNTRANSFER, true); curl_setopt($ch, CURLOPT_HTTPHEADER, array( 'x-may-api-key: s4LrKodmAen05jI733TEN2ZfuWZKsgmitona' )); // Execute cURL request $response = curl_exec($ch); // Check for errors if (curl_errno($ch)) { echo 'Error: ' . curl_error($ch); } // Close cURL session curl_close($ch); ?>