Soenneker.Google.Geocode
11.0.1248
Prefix Reserved
dotnet add package Soenneker.Google.Geocode --version 11.0.1248
NuGet\Install-Package Soenneker.Google.Geocode -Version 11.0.1248
<PackageReference Include="Soenneker.Google.Geocode" Version="11.0.1248" />
<PackageVersion Include="Soenneker.Google.Geocode" Version="11.0.1248" />
<PackageReference Include="Soenneker.Google.Geocode" />
paket add Soenneker.Google.Geocode --version 11.0.1248
#r "nuget: Soenneker.Google.Geocode, 11.0.1248"
#:package Soenneker.Google.Geocode@11.0.1248
#addin nuget:?package=Soenneker.Google.Geocode&version=11.0.1248
#tool nuget:?package=Soenneker.Google.Geocode&version=11.0.1248
Soenneker.Google.Geocode
A small DI-ready wrapper around Google Maps address geocoding for retrieving all matches, the first match, or its place ID.
Install
dotnet add package Soenneker.Google.Geocode
Configuration
{
"Google": {
"Geocode": {
"ApiKey": "<Google Maps API key>"
}
}
}
Enable the Geocoding API for the key and restrict the key appropriately for the application that uses it.
Register
using Soenneker.Google.Geocode.Registrars;
using Microsoft.Extensions.DependencyInjection;
services.AddGoogleGeocodeUtilAsScoped();
Singleton registration is also available through AddGoogleGeocodeUtilAsSingleton(); the implementation is stateless after reading its API key.
Usage
Result? result = await geocode.GetResult(
"1600 Amphitheatre Parkway, Mountain View, CA",
cancellationToken);
if (result is not null)
Console.WriteLine($"{result.FormattedAddress} ({result.PlaceId})");
Use GetResults() when every Google candidate matters. GetResult() returns Google's first candidate, and GetPlaceId() returns that candidate's place ID directly.
API at a glance
| API | What it does | Result / important behavior |
|---|---|---|
GetResults(address) |
Sends an address-geocoding request. | Returns Google's candidates in response order, or null if no response is produced. |
GetResult(address) |
Gets the first candidate. | Returns null when no candidate exists. |
GetPlaceId(address) |
Gets the first candidate's place ID. | Returns null when no candidate exists. |
Behavior
- The address is sent to Google as provided; this package does not normalize or validate it locally.
- A first result is not a guarantee of an exact match. Inspect the full
Resultwhen match quality matters. - Google API and transport failures propagate to the caller. Cancellation is forwarded to the request.
| Product | Versions Compatible and additional computed target framework versions. |
|---|---|
| .NET | net11.0 is compatible. |
-
net11.0
- GoogleApi (>= 5.8.18)
- Soenneker.Extensions.Configuration (>= 11.0.914)
- Soenneker.Extensions.Task (>= 11.0.141)
- Soenneker.Extensions.ValueTask (>= 4.0.133)
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 |
|---|---|---|
| 11.0.1248 | 241 | 10/27/2026 |
| 11.0.1247 | 93 | 10/26/2026 |
| 11.0.1246 | 95 | 10/26/2026 |
| 4.0.1243 | 128 | 10/15/2026 |
| 4.0.1242 | 100 | 10/15/2026 |
| 4.0.1241 | 106 | 10/14/2026 |
| 4.0.1240 | 98 | 10/14/2026 |
| 4.0.1237 | 101 | 10/14/2026 |
| 4.0.1230 | 110 | 10/13/2026 |
| 4.0.1229 | 107 | 10/13/2026 |
| 4.0.1228 | 108 | 10/12/2026 |
| 4.0.1224 | 124 | 10/11/2026 |
| 4.0.1223 | 113 | 10/11/2026 |
| 4.0.1222 | 105 | 10/11/2026 |
| 4.0.1221 | 106 | 10/10/2026 |
| 4.0.1220 | 100 | 10/9/2026 |
| 4.0.1219 | 102 | 10/9/2026 |
| 4.0.1218 | 163 | 10/1/2026 |
| 4.0.1217 | 127 | 9/25/2026 |
| 4.0.1216 | 109 | 9/25/2026 |
Remove redundant framework conditions