SplatDev.GeoLocation
1.0.2
dotnet add package SplatDev.GeoLocation --version 1.0.2
NuGet\Install-Package SplatDev.GeoLocation -Version 1.0.2
<PackageReference Include="SplatDev.GeoLocation" Version="1.0.2" />
<PackageVersion Include="SplatDev.GeoLocation" Version="1.0.2" />
<PackageReference Include="SplatDev.GeoLocation" />
paket add SplatDev.GeoLocation --version 1.0.2
#r "nuget: SplatDev.GeoLocation, 1.0.2"
#:package SplatDev.GeoLocation@1.0.2
#addin nuget:?package=SplatDev.GeoLocation&version=1.0.2
#tool nuget:?package=SplatDev.GeoLocation&version=1.0.2
SplatDev.GeoLocation
IP geolocation for .NET applications — resolves IP addresses to city, region, country, coordinates, ISP organization, postal code, and timezone via the ipinfo.io API.
Compatibility
| .NET | Umbraco | Package Version |
|---|---|---|
| 8.0 | 13 | 1.0.0 |
| 10.0 | 17 | 1.0.0 |
Installation
dotnet add package SplatDev.GeoLocation
Configuration
Basic usage
using SplatDev.GeoLocation;
// Resolve the caller's IP (or provide a specific one)
var result = await GeoLocator.GetIpInfoGeoLocation();
Console.WriteLine($"City: {result.City}, Country: {result.Country}");
Usage
Look up a specific IP address
using SplatDev.GeoLocation;
var result = await GeoLocator.GetIpInfoGeoLocation("8.8.8.8");
Console.WriteLine($"IP: {result.Ip}");
Console.WriteLine($"Hostname: {result.Hostname}");
Console.WriteLine($"City: {result.City}");
Console.WriteLine($"Region: {result.Region}");
Console.WriteLine($"Country: {result.Country}");
Console.WriteLine($"Location: {result.Loc}");
Console.WriteLine($"Org: {result.Org}");
Console.WriteLine($"Postal: {result.Postal}");
Console.WriteLine($"Timezone: {result.Timezone}");
With an API token
using SplatDev.GeoLocation;
// For higher rate limits (50k req/month with free tier token)
var result = await GeoLocator.GetIpInfoGeoLocation(
ip: "1.1.1.1",
apiToken: "your-ipinfo-token");
Console.WriteLine($"ISP: {result.Org}");
Register as a service
// Program.cs
builder.Services.AddSingleton<GeoLocator>();
// In a controller
public class LocationController : Controller
{
private readonly GeoLocator _geoLocator;
public LocationController(GeoLocator geoLocator)
{
_geoLocator = geoLocator;
}
public async Task<IActionResult> Index()
{
var location = await _geoLocator.GetIpInfoGeoLocation();
return Json(location);
}
}
Batch IP resolution
using SplatDev.GeoLocation;
var ips = new[] { "8.8.8.8", "1.1.1.1", "208.67.222.222" };
foreach (var ip in ips)
{
var result = await GeoLocator.GetIpInfoGeoLocation(ip);
Console.WriteLine($"{ip} → {result.City}, {result.Country} ({result.Org})");
}
Features
- Resolve IP addresses to city, region, country, geographic coordinates, organization, postal code, and timezone
- Auto-detects the caller's public IP when no IP is specified
- Optional ipinfo.io API token for higher rate limits (free tier: 50k requests/month)
- Uses
RestSharpfor reliable HTTP communication - Structured response via
GeoLocationResultwith strongly-typed properties Locfield returns"latitude,longitude"format ready for mapping or distance calculations- Lightweight — single dependency on
RestSharp - No database or local file required — pure API-based resolution
GeoLocationResult Properties
| Property | Type | Description |
|---|---|---|
Ip |
string |
IP address queried |
Hostname |
string |
Reverse DNS hostname |
City |
string |
City name |
Region |
string |
Region or state name |
Country |
string |
Country code (ISO 3166 alpha-2) |
Loc |
string |
Latitude,longitude coordinates |
Org |
string |
ISP or organization name |
Postal |
string |
Postal/ZIP code |
Timezone |
string |
IANA timezone identifier |
Dependencies
| Package | Version | Purpose |
|---|---|---|
RestSharp |
112.1.0 | HTTP client for ipinfo.io API calls |
No other NuGet dependencies.
SplatDev.GeoLocation — part of the SplatDev.Umbraco.Plugins suite. Licensed under MIT. © SplatDev Ltda.
Changelog
1.0.2 — 2026-08-24
Removes a dashboard screenshot that showed an error toast. It was captured against a site where this plugin's API was unreachable, so it advertised a broken dashboard. No screenshot is better than a misleading one; a replacement will be taken against a working install.
1.0.1 — 2026-08-24
Package metadata only: the listing now carries an icon and search tags, and the project and repository links point at the organisation that actually hosts this code. No code changes.
1.0.0 — 2026-08-24
This package now keeps a changelog. Earlier releases predate it and are not reconstructed here — consult the repository history for those. From this version on, every release records what changed for someone using it.
| Product | Versions Compatible and additional computed target framework versions. |
|---|---|
| .NET | net8.0 is compatible. net8.0-android was computed. net8.0-browser was computed. net8.0-ios was computed. net8.0-maccatalyst was computed. net8.0-macos was computed. net8.0-tvos was computed. net8.0-windows was computed. net9.0 was computed. net9.0-android was computed. net9.0-browser was computed. net9.0-ios was computed. net9.0-maccatalyst was computed. net9.0-macos was computed. net9.0-tvos was computed. net9.0-windows was computed. net10.0 is compatible. net10.0-android was computed. net10.0-browser was computed. net10.0-ios was computed. net10.0-maccatalyst was computed. net10.0-macos was computed. net10.0-tvos was computed. net10.0-windows was computed. |
NuGet packages
This package is not used by any NuGet packages.
GitHub repositories
This package is not used by any popular GitHub repositories.
| Version | Downloads | Last Updated |
|---|---|---|
| 1.0.2 | 63 | 8/24/2026 |