Soenneker.Google.SearchConsole
4.0.1
Prefix Reserved
dotnet add package Soenneker.Google.SearchConsole --version 4.0.1
NuGet\Install-Package Soenneker.Google.SearchConsole -Version 4.0.1
<PackageReference Include="Soenneker.Google.SearchConsole" Version="4.0.1" />
<PackageVersion Include="Soenneker.Google.SearchConsole" Version="4.0.1" />
<PackageReference Include="Soenneker.Google.SearchConsole" />
paket add Soenneker.Google.SearchConsole --version 4.0.1
#r "nuget: Soenneker.Google.SearchConsole, 4.0.1"
#:package Soenneker.Google.SearchConsole@4.0.1
#addin nuget:?package=Soenneker.Google.SearchConsole&version=4.0.1
#tool nuget:?package=Soenneker.Google.SearchConsole&version=4.0.1
Soenneker.Google.SearchConsole
A utility library for Google Search Console.
Installation
dotnet add package Soenneker.Google.SearchConsole
Setup
Enable the Google Search Console API in your Google Cloud project and grant the service account access to your Search Console property. Place its credential JSON in the application's output directory under LocalResources/search-console.json. Do not commit this file.
Register the utility and its credential provider:
using Soenneker.Google.SearchConsole.Registrars;
services.AddGoogleSearchConsoleUtilAsSingleton();
// Or: services.AddGoogleSearchConsoleUtilAsScoped();
Inject IGoogleSearchConsoleUtil. Clients are cached by credential filename and request the https://www.googleapis.com/auth/webmasters scope, which supports both read and write operations.
Usage
using Google.Apis.SearchConsole.v1.Data;
using Soenneker.Google.SearchConsole.Abstract;
public sealed class SearchReport(IGoogleSearchConsoleUtil searchConsole)
{
public async Task<SearchAnalyticsQueryResponse> Get(CancellationToken cancellationToken)
{
return await searchConsole.QuerySearchAnalytics(
"sc-domain:example.com",
new SearchAnalyticsQueryRequest
{
StartDate = "2026-08-01",
EndDate = "2026-08-31",
Dimensions = ["query", "page"],
RowLimit = 25000,
StartRow = 0
},
"search-console.json",
cancellationToken);
}
}
Use the exact property identifier from Search Console: sc-domain:example.com for a domain property or https://example.com/ for a URL-prefix property.
Available operations:
QuerySearchAnalytics: returns one page of analytics using Google's request and response models. SetStartRowandRowLimitexplicitly for pagination. Search Console may return only the top rows, even with pagination.InspectUrl: retrieves Google's indexed status of a URL; it does not run a live test or request indexing.ListSites,GetSite,AddSite,DeleteSite: manage account properties. Adding a property does not verify ownership.ListSitemaps,GetSitemap,SubmitSitemap,DeleteSitemap: manage sitemap submissions.ListSitemapsaccepts an optional sitemap index.Get: exposes the cached SDK client for advanced usage. Do not dispose this client directly.RemoveandRemoveSync: evict and dispose a cached client. The separate credential cache is unchanged; evict credentials throughIGoogleCredentialsUtilas well when rotating credential files.
All asynchronous operations accept cancellation tokens. Google API errors propagate to the caller. DI disposes cached clients with the utility; manually constructed utilities should be disposed. Do not remove or dispose clients while requests are in flight.
| 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
- Google.Apis.SearchConsole.v1 (>= 1.75.0.4234)
- Microsoft.Extensions.DependencyInjection.Abstractions (>= 10.0.12)
- Soenneker.Google.Credentials (>= 4.0.2611)
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.1 | 52 | 9/21/2026 |