<?php
header('Content-Type: application/json');

$apiKey = 'CG-mY8TrSt1eVix95dkotSE9hBb';

$requestUri = $_SERVER['REQUEST_URI'];
if (strpos($requestUri, '/v3/simple/price') !== false) {
    $params = $_GET;
    $params['x_cg_pro_api_key'] = $apiKey;
    
    $url = 'https://pro-api.coingecko.com/api/v3/simple/price?' . http_build_query($params);
    
    $ch = curl_init();
    curl_setopt($ch, CURLOPT_URL, $url);
    curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
    curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false);
    
    $response = curl_exec($ch);
    curl_close($ch);
    
    echo $response;
} else {
    http_response_code(404);
    echo json_encode(['error' => 'Not found']);
}