apiKey}"]); $body = curl_exec($ch); $status = curl_getinfo($ch, CURLINFO_HTTP_CODE); curl_close($ch); $decoded = json_decode($body, true); if ($status === 429) { throw new Exception("Rate limited."); } if ($status >= 400) { throw new Exception("Kuvola API error {$status}: " . ($decoded['error']['message'] ?? 'Unknown error')); } return $decoded; // ['data' => ..., 'pagination' => ['totalPages' => ...]] } } // Usage: // $client = new KuvolaClient("kv_live_..."); // $result = $client->v2ListMarkets(['pageSize' => 25]);