Skip to main content

Official SDKs

The official .NET SDK handles authentication, caching, error handling, rate limits, and retries for you.

Available SDKs

LanguagePackageInstall
C#BoxesNLines.Geolocationdotnet 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 (.NET uses *Exception suffix)
  • Rate limit handling -automatic retry on 429 with Retry-After support
  • 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

SDKMinimum Runtime
C#.NET 8+

Samples

The SDK ships with sample projects you can clone and run locally:

SampleLink
Quickstartdotnet
Redis Cachedotnet
GDPR Compliancedotnet