Soenneker.Google.Geocode 4.0.1180

Prefix Reserved
There is a newer version of this package available.
See the version list below for details.
dotnet add package Soenneker.Google.Geocode --version 4.0.1180
                    
NuGet\Install-Package Soenneker.Google.Geocode -Version 4.0.1180
                    
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="Soenneker.Google.Geocode" Version="4.0.1180" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="Soenneker.Google.Geocode" Version="4.0.1180" />
                    
Directory.Packages.props
<PackageReference Include="Soenneker.Google.Geocode" />
                    
Project file
For projects that support Central Package Management (CPM), copy this XML node into the solution Directory.Packages.props file to version the package.
paket add Soenneker.Google.Geocode --version 4.0.1180
                    
#r "nuget: Soenneker.Google.Geocode, 4.0.1180"
                    
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
#:package Soenneker.Google.Geocode@4.0.1180
                    
#:package directive can be used in C# file-based apps starting in .NET 10 preview 4. Copy this into a .cs file before any lines of code to reference the package.
#addin nuget:?package=Soenneker.Google.Geocode&version=4.0.1180
                    
Install as a Cake Addin
#tool nuget:?package=Soenneker.Google.Geocode&version=4.0.1180
                    
Install as a Cake Tool

alternate text is missing from this package README image alternate text is missing from this package README image alternate text is missing from this package README image alternate text is missing from this package README image

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 Result when match quality matters.
  • Google API and transport failures propagate to the caller. Cancellation is forwarded to the request.
Product 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. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

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.1185 0 8/31/2026
4.0.1184 7 8/31/2026
4.0.1183 35 8/31/2026
4.0.1182 37 8/30/2026
4.0.1180 47 8/30/2026
4.0.1179 36 8/30/2026
4.0.1178 42 8/30/2026
4.0.1177 35 8/30/2026
4.0.1176 39 8/30/2026
4.0.1175 37 8/30/2026
4.0.1174 37 8/29/2026
4.0.1173 40 8/29/2026
4.0.1172 40 8/29/2026
4.0.1170 70 8/26/2026
4.0.1169 76 8/26/2026
4.0.1168 78 8/25/2026
4.0.1167 89 8/21/2026
4.0.1166 92 8/18/2026
4.0.1165 91 8/12/2026
4.0.1164 98 8/12/2026
Loading failed

Update dependency Soenneker.Extensions.ValueTask to 4.0.120 (#1717)