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
                    
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.SearchConsole" Version="4.0.1" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="Soenneker.Google.SearchConsole" Version="4.0.1" />
                    
Directory.Packages.props
<PackageReference Include="Soenneker.Google.SearchConsole" />
                    
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.SearchConsole --version 4.0.1
                    
#r "nuget: Soenneker.Google.SearchConsole, 4.0.1"
                    
#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.SearchConsole@4.0.1
                    
#: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.SearchConsole&version=4.0.1
                    
Install as a Cake Addin
#tool nuget:?package=Soenneker.Google.SearchConsole&version=4.0.1
                    
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.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. Set StartRow and RowLimit explicitly 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. ListSitemaps accepts an optional sitemap index.
  • Get: exposes the cached SDK client for advanced usage. Do not dispose this client directly.
  • Remove and RemoveSync: evict and dispose a cached client. The separate credential cache is unchanged; evict credentials through IGoogleCredentialsUtil as 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.

Google Search Console API reference

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.1 76 9/21/2026