百科.dev
全部条目在线工具AI 编程趋势榜开源项目技术资讯提交条目
登录
< 返回工具列表
G

GoogleApi

> 编程语言
开源

C# .NET Core Google API(地图、地点、道路、搜索、翻译)。支持所有端点和请求/响应。

587 stars0 点赞0 次浏览
访问官网GitHub

工具介绍

C# .NET Core Google API(地图、地点、道路、搜索、翻译)。支持所有端点和请求/响应。

Google Api

Seamless Google Api integrations.
Google Maps, Places, Roads, Search and Translate.

Feel free to contribute, throw questions and report issues. I usually respond fast (24-48 hours).
Do you need support for an additional .Net framework?, let me know.

NOTE: Google Places New Added


Using the Library

The library may be consumed, either by using the individual facede implementations or by depdendency injecting the individual api's.
Each api implementation consists of a request and a response. The request has properties reflecting the parameters supported, and the response represents the object model for the returned json.

A few other noteworthy members.

csharp
var uri = request.GetUri(); // Gets the full request uri, including query parameters.
var params = request.GetQUeryStringParameters(); // Gets a list of all the added parameters.
csharp
response.RawJson // The raw json returned by Google.
response.RawQueryString // The querystring sent to Google when invoking the request.

Facade

Each api has a generic facade operation to execute the request and return the response.
The example below, simply populates a request, invokes the facade operation, and receives the response in return.

csharp
TRequest request = new TRequest();
TResponse response = await {Api}.[{SubGroup}].{Action}.QueryAsync(request);

See below for a full list of supported Api's and actions.

Dependency Injection

If injecting the api's as dependencies is preffered register the services during startup, as shown below.

csharp
services
    .AddGoogleApiClients();

Then, inject the individual Api's in constructors as needed

csharp
public class MyClass
{
    private Api api;
    
    public MyClass(Api api)
    {
        this.api = api
    }
}

See below for a full list of supported Api's and actions.

Proxy

If a WebProxy is required set the static property HttpClientFactory.Proxy before registrering the GoogleApi dependencies or using the Facade.


Supported Api's

The following api's are supported.

Google Maps
  • Directions (GoogleMaps.Directions)
  • Distance Matrix (GoogleMaps.DistanceMatrix)
  • Elevation (GoogleMaps.Elevation)
  • Geocode
    • Place (GoogleMaps.Geocode.PlaceGeocode)
    • Address (GoogleMaps.Geocode.AddressGeocode)
    • Location (reverse) (GoogleMaps.Geocode.LocationGeocode)
    • Plus Code (GoogleMaps.Geocode.PlusCodeGeocode)
  • Geolocation (GoogleMaps.Geolocation)
  • Roads
    • Nearest Roads (GoogleMaps.Roads.NearestRoads)
    • Snap To Roads (GoogleMaps.Roads.SnapToRoad)
    • Speed Limits (GoogleMaps.Roads.SpeedLimits)
  • Time Zone
  • Street View
  • Static Maps
  • Routes
    • RouteDirections (GoogleMaps.Routes.Directions)
    • RouteMatrix (GoogleMaps.Routes.Matrix)
  • Address Validation (GoogleMaps.AddressValidation)
  • Aerial View (beta)
    • Get Video (GoogleMaps.AerialView.GetVideo)
    • Render Video (GoogleMaps.AerialView.RenderVideo)
Google Places
  • Place Search
    • Find (GooglePlaces.Search.FindSearch)
    • Near By (GooglePlaces.Search.NearBySearch)
    • Text (GooglePlaces.Search.TextSearch)
  • Place Details (GooglePlaces.Details)
  • Place Photos (GooglePlaces.Photos)
  • Place Autocomplete (GooglePlaces.AutoComplete)
  • Query Autocomplete (GooglePlaces.QueryAutoComplete)
Google Places (new)
  • Place Search
    • Near By (GooglePlacesNew.Search.NearBySearchNew)
    • Text (GooglePlacesNew.Search.TextSearchNew)
  • Place Details (GooglePlacesNew.DetailsNew)
  • Place Photos (GooglePlacesNew.PhotosNew)
  • Place Photos Skip-Http-Redirect (GooglePlacesNew.PhotosNewSkipHttpRedirect)
  • Place Autocomplete (GooglePlacesNew.AutoCompleteNew)
Google Search
  • Web (GoogleSearch.WebSearch)
  • Image (GoogleSearch.ImageSearch)
  • Video
    • Channels (GoogleSearch.VideoSearch.Channels)
    • Playlists (GoogleSearch.VideoSearch.Playlists)
    • Vidoes (GoogleSearch.VideoSearch.Vidoes)
Google Translate
  • Detect (GoogleTranslate.Detect)
  • Languages (GoogleTranslate.Languages)
  • Translate (GoogleTranslate.Translate)
Google Functions
  • MergePolyLine
  • EncodePolyLine
  • DecodePolyLine

Running Test Suite

Running the test suite is simple.

The test project stores settings related to your Google subscription (free or paid) in application.default.json.
Most importantly, the ApiKey, used to identify the Google subscription.

json
{ 
  "ApiKey": "",
  "SearchEngineId": "",
}

More information about generating a key can be found here: https://console.developers.google.com/


Issues· 0 开放

查看全部 Issues在 GitHub 打开

暂无开放 Issues,或尚未同步最近议题。

> 标签

C#autocompletec-sharpcoordinatedirections

暂无评论,来聊聊你的看法吧

> 工具信息

发布日期2026年8月1日
最后更新2026年9月17日
分类编程语言
定价开源

> 相关工具

T
TypeScript
JavaScript 的超集,为前端与全栈提供静态类型
P
Python
通用编程语言,广泛用于 Web、数据与 AI
G
Go
Google 推出的简洁高效系统语言