GoogleCustomSearchEngine 5.0.0
dotnet add package GoogleCustomSearchEngine --version 5.0.0
NuGet\Install-Package GoogleCustomSearchEngine -Version 5.0.0
<PackageReference Include="GoogleCustomSearchEngine" Version="5.0.0" />
<PackageVersion Include="GoogleCustomSearchEngine" Version="5.0.0" />
<PackageReference Include="GoogleCustomSearchEngine" />
paket add GoogleCustomSearchEngine --version 5.0.0
#r "nuget: GoogleCustomSearchEngine, 5.0.0"
#:package GoogleCustomSearchEngine@5.0.0
#addin nuget:?package=GoogleCustomSearchEngine&version=5.0.0
#tool nuget:?package=GoogleCustomSearchEngine&version=5.0.0
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 IDAPP_ID: Agent Search engine IDAPI_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 | Versions Compatible and additional computed target framework versions. |
|---|---|
| .NET Framework | net472 is compatible. net48 was computed. net481 was computed. |
-
- Newtonsoft.Json (>= 13.0.4)
NuGet packages
This package is not used by any NuGet packages.
GitHub repositories
This package is not used by any popular GitHub repositories.
Moves to the Google Cloud Agent Search API and updates Newtonsoft.Json to 13.0.4.