// Kuvola Institutional Data API — C# starter (no NuGet package published; copy this file) using System.Net.Http.Headers; public class KuvolaClient { private const string BaseUrl = "https://kuvola.ao"; private readonly HttpClient _http = new(); private readonly string _apiKey; public KuvolaClient(string apiKey) { _apiKey = apiKey; } public async Task V2ListMarketsAsync() { var request = new HttpRequestMessage(HttpMethod.Get, BaseUrl + "/api/v2/markets"); request.Headers.Authorization = new AuthenticationHeaderValue("Bearer", _apiKey); var response = await _http.SendAsync(request); if ((int)response.StatusCode == 429) throw new Exception($"Rate limited. Reset: {response.Headers.GetValues("X-RateLimit-Reset").FirstOrDefault()}"); if (!response.IsSuccessStatusCode) throw new Exception($"Kuvola API error {(int)response.StatusCode}: {await response.Content.ReadAsStringAsync()}"); return await response.Content.ReadAsStringAsync(); // JSON string — .pagination has totalPages } // Usage: await new KuvolaClient("kv_live_...").V2ListMarketsAsync(); }