GoogleMapsApi 1.4.8
See the version list below for details.
dotnet add package GoogleMapsApi --version 1.4.8
NuGet\Install-Package GoogleMapsApi -Version 1.4.8
<PackageReference Include="GoogleMapsApi" Version="1.4.8" />
<PackageVersion Include="GoogleMapsApi" Version="1.4.8" />
<PackageReference Include="GoogleMapsApi" />
paket add GoogleMapsApi --version 1.4.8
#r "nuget: GoogleMapsApi, 1.4.8"
#:package GoogleMapsApi@1.4.8
#addin nuget:?package=GoogleMapsApi&version=1.4.8
#tool nuget:?package=GoogleMapsApi&version=1.4.8
Release history: see CHANGELOG.md.
GoogleMapsApi
A friendly, strongly-typed .NET wrapper for the Google Maps Web Services APIs — Geocoding, Directions, Distance Matrix, Elevation, Time Zone, Places, and Static Maps. Multi-framework (net10.0, net8.0, netstandard2.0, net481, net462), async-first, and battle-tested with 2M+ downloads on NuGet.
Supported APIs
| API | Description |
|---|---|
| Geocoding | Convert between addresses and geographic coordinates |
| Directions | Route planning between two points with multiple travel modes |
| Distance Matrix | Travel time and distance between multiple origins/destinations |
| Elevation | Elevation data for individual locations or paths |
| Time Zone | Time zone information for any coordinate |
| Places | Find / Nearby / Text search, Place Details, Autocomplete |
| Static Maps | Generate URLs for static map images with markers, paths, and styles |
Why this vs Google's official SDKs
Google's official .NET packages (e.g. Google.Maps.Routing.V2, Google.Maps.Places.V1) are auto-generated from gRPC service definitions — they're verbose, split across many packages, and feel like protobuf instead of .NET. GoogleMapsApi is a single, idiomatic NuGet package: one install, async-first, multi-target (modern .NET through legacy .NET Framework), with hand-crafted request/response types that read like normal C#.
Installation
Install via NuGet Package Manager:
Install-Package GoogleMapsApi
Or via .NET CLI:
dotnet add package GoogleMapsApi
Looking for runnable examples? See samples/ — console, ASP.NET Core minimal API, and Blazor Server.
Quickstart
API Key Configuration
You can configure your Google Maps API key in several ways:
// Option 1: Set API key per request
DirectionsRequest directionsRequest = new DirectionsRequest()
{
Origin = "NYC, 5th and 39",
Destination = "Philadelphia, Chestnut and Walnut",
ApiKey = "your-google-maps-api-key"
};
// Option 2: Set globally via app.config/appsettings.json (see wiki for details)
For more configuration options and detailed guides, see the wiki. Full API reference is published at maximn.github.io/google-maps.
Code Examples
Basic Usage (async-first)
using GoogleMapsApi;
using GoogleMapsApi.Entities.Common;
using GoogleMapsApi.Entities.Directions.Request;
using GoogleMapsApi.Entities.Directions.Response;
using GoogleMapsApi.Entities.Geocoding.Request;
using GoogleMapsApi.Entities.Geocoding.Response;
using GoogleMapsApi.StaticMaps;
using GoogleMapsApi.StaticMaps.Entities;
//Static class use (Directions) (Can be made from static/instance class)
DirectionsRequest directionsRequest = new DirectionsRequest()
{
Origin = "NYC, 5th and 39",
Destination = "Philadelphia, Chestnut and Walnut",
};
// Async call (recommended)
DirectionsResponse directions = await GoogleMaps.Directions.QueryAsync(directionsRequest);
Console.WriteLine(directions);
//Instance class use (Geocode) (Can be made from static/instance class)
GeocodingRequest geocodeRequest = new GeocodingRequest()
{
Address = "new york city",
};
var geocodingEngine = GoogleMaps.Geocode;
GeocodingResponse geocode = await geocodingEngine.QueryAsync(geocodeRequest);
Console.WriteLine(geocode);
// Static maps API - get static map of with the path of the directions request
StaticMapsEngine staticMapGenerator = new StaticMapsEngine();
//Path from previos directions request
IEnumerable<Step> steps = directions.Routes.First().Legs.First().Steps;
// All start locations
IList<ILocationString> path = steps.Select(step => step.StartLocation).ToList<ILocationString>();
// also the end location of the last step
path.Add(steps.Last().EndLocation);
string url = staticMapGenerator.GenerateStaticMapURL(new StaticMapRequest(new Location(40.38742, -74.55366), 9, new ImageSize(800, 400))
{
Pathes = new List<GoogleMapsApi.StaticMaps.Entities.Path>(){ new GoogleMapsApi.StaticMaps.Entities.Path()
{
Style = new PathStyle()
{
Color = "red"
},
Locations = path
}}
});
Console.WriteLine("Map with path: " + url);
Synchronous Usage
Synchronous calls are also supported via Query (use QueryAsync whenever possible):
DirectionsResponse directions = GoogleMaps.Directions.Query(directionsRequest);
Console.WriteLine(directions);
If this library saved you time, please ⭐ the repo — it helps others find it.
| Product | Versions Compatible and additional computed target framework versions. |
|---|---|
| .NET | net5.0 was computed. net5.0-windows was computed. net6.0 is compatible. net6.0-android was computed. net6.0-ios was computed. net6.0-maccatalyst was computed. net6.0-macos was computed. net6.0-tvos was computed. net6.0-windows was computed. net7.0 was computed. net7.0-android was computed. net7.0-ios was computed. net7.0-maccatalyst was computed. net7.0-macos was computed. net7.0-tvos was computed. net7.0-windows was computed. 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. |
| .NET Core | netcoreapp2.0 was computed. netcoreapp2.1 was computed. netcoreapp2.2 was computed. netcoreapp3.0 was computed. netcoreapp3.1 was computed. |
| .NET Standard | netstandard2.0 is compatible. netstandard2.1 was computed. |
| .NET Framework | net461 was computed. net462 is compatible. net463 was computed. net47 was computed. net471 was computed. net472 was computed. net48 was computed. net481 is compatible. |
| MonoAndroid | monoandroid was computed. |
| MonoMac | monomac was computed. |
| MonoTouch | monotouch was computed. |
| Tizen | tizen40 was computed. tizen60 was computed. |
| Xamarin.iOS | xamarinios was computed. |
| Xamarin.Mac | xamarinmac was computed. |
| Xamarin.TVOS | xamarintvos was computed. |
| Xamarin.WatchOS | xamarinwatchos was computed. |
-
.NETFramework 4.6.2
- System.Net.Http (>= 4.3.4)
- System.Text.Encodings.Web (>= 10.0.8)
- System.Text.Json (>= 10.0.8)
-
.NETFramework 4.8.1
- System.Net.Http (>= 4.3.4)
- System.Text.Encodings.Web (>= 10.0.8)
- System.Text.Json (>= 10.0.8)
-
.NETStandard 2.0
- System.Text.Encodings.Web (>= 10.0.8)
- System.Text.Json (>= 10.0.8)
-
net10.0
- No dependencies.
-
net6.0
- System.Text.Json (>= 10.0.8)
-
net8.0
- System.Text.Json (>= 10.0.8)
NuGet packages (1)
Showing the top 1 NuGet packages that depend on GoogleMapsApi:
| Package | Downloads |
|---|---|
|
GoogleMapsApi.Extensions.DependencyInjection
Dependency injection extensions for GoogleMapsApi — registers IGoogleMapsClient with IHttpClientFactory and binds options via AddGoogleMaps(). |
GitHub repositories
This package is not used by any popular GitHub repositories.
| Version | Downloads | Last Updated |
|---|---|---|
| 2.5.0 | 335 | 6/23/2026 |
| 2.4.0 | 931 | 6/15/2026 |
| 2.3.0 | 246 | 6/13/2026 |
| 2.2.0 | 168 | 6/12/2026 |
| 2.1.0 | 1,558 | 5/31/2026 |
| 2.0.0 | 134 | 5/31/2026 |
| 1.8.0 | 314 | 5/31/2026 |
| 1.7.0 | 149 | 5/30/2026 |
| 1.6.0 | 144 | 5/30/2026 |
| 1.5.0 | 524 | 5/25/2026 |
| 1.4.8 | 1,326 | 5/24/2026 |
| 1.4.7 | 175 | 5/23/2026 |
| 1.4.6 | 162 | 5/23/2026 |
| 1.4.5 | 83,862 | 9/23/2025 |
| 1.4.4 | 2,475 | 9/19/2025 |
| 1.4.0 | 3,769 | 9/5/2025 |
| 1.3.9 | 1,114 | 9/3/2025 |
| 1.3.8 | 785 | 9/3/2025 |