GoogleCustomSearchEngine 5.0.0

dotnet add package GoogleCustomSearchEngine --version 5.0.0
                    
NuGet\Install-Package GoogleCustomSearchEngine -Version 5.0.0
                    
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="GoogleCustomSearchEngine" Version="5.0.0" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="GoogleCustomSearchEngine" Version="5.0.0" />
                    
Directory.Packages.props
<PackageReference Include="GoogleCustomSearchEngine" />
                    
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 GoogleCustomSearchEngine --version 5.0.0
                    
#r "nuget: GoogleCustomSearchEngine, 5.0.0"
                    
#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 GoogleCustomSearchEngine@5.0.0
                    
#: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=GoogleCustomSearchEngine&version=5.0.0
                    
Install as a Cake Addin
#tool nuget:?package=GoogleCustomSearchEngine&version=5.0.0
                    
Install as a Cake Tool

DotNet Google Cloud Agent Search API

A lightweight C# client for the Google Cloud Agent Search API (formerly Vertex AI Search). The retired Google Custom Search Engine API is not supported.

Authentication

The client accepts exactly these credentials:

  • PROJECT_ID: Google Cloud project ID
  • APP_ID: Agent Search engine ID
  • API_KEY: Google Cloud API key with Discovery Engine API access
$env:PROJECT_ID="your-project-id"
$env:APP_ID="your-app-id"
$env:API_KEY="your-api-key"

Usage

using GoogleCSE;

var searcher = new GoogleSearch(
    projectId: "your-project-id",
    appId: "your-app-id",
    apiKey: "YOUR_API_KEY");

var results = searcher.Search("dotnet tutorials");

foreach (var item in results)
{
    Console.WriteLine($"{item.Title}: {item.Url}");
}

To limit a website search to a URL pattern, pass siteSearch as the second argument:

var results = searcher.Search(
    "dotnet tutorials",
    siteSearch: "https://example.com/docs/*");

This sends the Agent Search filter expression siteSearch:"https://example.com/docs/*".

Optional constructor arguments configure the Agent Search request: location, pageSize, maxPages, and start.

Test Application

The included console application reads only PROJECT_ID, APP_ID, and API_KEY.

dotnet run --project GoogleCSE/GoogleCSE.TestApp/GoogleCSE.TestApp.csproj

See:

https://docs.cloud.google.com/generative-ai-app-builder/docs/migrate-from-cse#api-key-deploy

Product Compatible and additional computed target framework versions.
.NET Framework net472 is compatible.  net48 was computed.  net481 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
5.0.0 123 10/14/2026
4.0.4 3,702 10/9/2018
3.0.1 1,926 4/13/2017
2.0.0 3,591 8/8/2014
1.0.0 2,162 1/31/2014

Moves to the Google Cloud Agent Search API and updates Newtonsoft.Json to 13.0.4.