
Security News
ECMAScript 2025 Finalized with Iterator Helpers, Set Methods, RegExp.escape, and More
ECMAScript 2025 introduces Iterator Helpers, Set methods, JSON modules, and more in its latest spec update approved by Ecma in June 2025.
XiansAi.Agent.GoogleSearch
Advanced tools
A Google Search implementation for AI agents that provides structured search results from Google Custom Search API.
A lightweight C# library for integrating Google's Custom Search JSON API into your applications. This library provides a simple interface to perform web searches programmatically using Google's search capabilities.
Before using this library, you'll need:
Install the package via NuGet:
dotnet add package XiansAi.Agent.GoogleSearch
Here's a basic example of how to use the library:
using XiansAi.Agent.GoogleSearch;
// Initialize the search engine
var apiKey = "your_api_key";
var searchEngine = new SearchEngine(apiKey);
try
{
// Perform a search with a limit of 5 results
var results = await searchEngine.SearchAsync("NoIsolation AS Norway", 5);
// Process the results
foreach (var item in results.Items)
{
Console.WriteLine($"Title: {item.Title}");
Console.WriteLine($"URL: {item.Link}");
Console.WriteLine($"Snippet: {item.Snippet}");
Console.WriteLine();
}
}
catch (SearchException ex)
{
Console.WriteLine($"Search failed: {ex.Message}");
throw;
}
The library throws SearchException
for any API-related errors. Always wrap your search calls in a try-catch block to handle potential errors gracefully.
This project is licensed under 99x commercial license. Contact 99x for more information.
For support, please open an issue in the GitHub repository.
FAQs
A Google Search implementation for AI agents that provides structured search results from Google Custom Search API.
We found that xiansai.agent.googlesearch demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
ECMAScript 2025 introduces Iterator Helpers, Set methods, JSON modules, and more in its latest spec update approved by Ecma in June 2025.
Security News
A new Node.js homepage button linking to paid support for EOL versions has sparked a heated discussion among contributors and the wider community.
Research
North Korean threat actors linked to the Contagious Interview campaign return with 35 new malicious npm packages using a stealthy multi-stage malware loader.