Soenneker.Google.Geocode
4.0.1187
Prefix Reserved
See the version list below for details.
dotnet add package Soenneker.Google.Geocode --version 4.0.1187
NuGet\Install-Package Soenneker.Google.Geocode -Version 4.0.1187
<PackageReference Include="Soenneker.Google.Geocode" Version="4.0.1187" />
<PackageVersion Include="Soenneker.Google.Geocode" Version="4.0.1187" />
<PackageReference Include="Soenneker.Google.Geocode" />
paket add Soenneker.Google.Geocode --version 4.0.1187
#r "nuget: Soenneker.Google.Geocode, 4.0.1187"
#:package Soenneker.Google.Geocode@4.0.1187
#addin nuget:?package=Soenneker.Google.Geocode&version=4.0.1187
#tool nuget:?package=Soenneker.Google.Geocode&version=4.0.1187
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 | 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. |
-
net10.0
- GoogleApi (>= 5.8.15)
- Soenneker.Extensions.Configuration (>= 4.0.872)
- Soenneker.Extensions.Task (>= 4.0.128)
- Soenneker.Extensions.ValueTask (>= 4.0.120)
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 |
|---|---|---|
| 4.0.1212 | 35 | 9/16/2026 |
| 4.0.1211 | 33 | 9/16/2026 |
| 4.0.1210 | 32 | 9/16/2026 |
| 4.0.1209 | 45 | 9/15/2026 |
| 4.0.1208 | 34 | 9/15/2026 |
| 4.0.1207 | 41 | 9/15/2026 |
| 4.0.1206 | 46 | 9/13/2026 |
| 4.0.1205 | 57 | 9/13/2026 |
| 4.0.1204 | 51 | 9/13/2026 |
| 4.0.1203 | 56 | 9/12/2026 |
| 4.0.1202 | 53 | 9/12/2026 |
| 4.0.1201 | 52 | 9/12/2026 |
| 4.0.1200 | 54 | 9/12/2026 |
| 4.0.1198 | 53 | 9/12/2026 |
| 4.0.1197 | 101 | 9/9/2026 |
| 4.0.1196 | 90 | 9/9/2026 |
| 4.0.1195 | 88 | 9/8/2026 |
| 4.0.1194 | 95 | 9/8/2026 |
| 4.0.1193 | 96 | 9/8/2026 |
| 4.0.1187 | 95 | 9/4/2026 |
Add interface inheritdoc references