Official SDKs
The official .NET SDK handles authentication, caching, error handling, rate limits, and retries for you.
Available SDKs
| Language | Package | Install |
|---|---|---|
| C# | BoxesNLines.Geolocation | dotnet add package BoxesNLines.Geolocation |
Features
The SDK is designed with:
- Zero-config quick start -just pass your API key and start querying
- LRU cache -in-memory cache with configurable TTL (default 5 min) and max entries (default 1000)
- Typed errors -
AuthError,ValidationError,NotFoundError,RateLimitError,ConflictError(.NETuses*Exceptionsuffix) - Rate limit handling -automatic retry on 429 with
Retry-Aftersupport - Retry with backoff -exponential backoff on 5xx server errors
- Rate limit info -every response includes parsed rate limit headers
Usage Example
var geo = new GeolocationClient(new GeolocationClientOptions { ApiKey = "bnl_..." });
var result = await geo.GetCountryFromGpsAsync(34.05, -118.24);
Console.WriteLine(result.Data); // "USA"
Runtime Requirements
| SDK | Minimum Runtime |
|---|---|
| C# | .NET 8+ |
Samples
The SDK ships with sample projects you can clone and run locally:
| Sample | Link |
|---|---|
| Quickstart | dotnet |
| Redis Cache | dotnet |
| GDPR Compliance | dotnet |