@cryptodevops/n8n-nodes-google-search
v1.5.0
Published
Custom n8n node for performing Google searches with AI agent tool support
Maintainers
Keywords
Readme
n8n-nodes-google-search
Custom n8n node for performing Google searches via the Google Custom Search API.
Features
- Custom Google search
- Support for multiple search parameters
- Filtering by language, country, file type
- Site-specific search
- Configurable SafeSearch
- AI Agent Tool Support: Can be used as a tool by AI agents in n8n
Installation
Prerequisites
Google API Key: Get an API key from the Google Cloud Console
- Enable the "Custom Search API"
- Create an API key
Search Engine ID (CX): Create a custom search engine from the Custom Search control panel
- Configure your search engine
- Get the engine ID (CX)
Node Installation
npm install @cryptodevops/n8n-nodes-google-searchOr for development:
- Clone this repository
- Install dependencies:
npm install - Build the project:
npm run build - Install the node in n8n:
npm link
Configuration
- In n8n, add the "Google Search API" credentials
- Enter your API Key and Search Engine ID (CX)
- Use the "Google Search" node in your workflows
AI Agent Tool Usage
This node can be used as a tool by AI agents in n8n workflows. When used as a tool, the AI agent can automatically call this node to perform Google searches.
Setup for AI Agents
- Enable Community Tool Usage: Set the environment variable
N8N_COMMUNITY_PACKAGES_ALLOW_TOOL_USAGE=truein your n8n installation - Configure Credentials: Set up your Google Search API credentials as described above
- Add to Agent: The node will automatically appear as an available tool for AI agents
Tool Parameters for AI Agents
When used by AI agents, the node accepts these parameters:
query(required): The search querynum_results(optional): Number of results (1-10, default: 5)language(optional): Language code (e.g., "en", "fr", "de")country(optional): Country code (e.g., "us", "fr", "de")
Example AI Agent Usage
The AI agent can call this tool like:
{
"query": "latest AI developments 2024",
"num_results": 5,
"language": "en"
}The tool will return structured search results that the AI agent can use to answer questions or gather information.
Available Parameters
Main Parameters
- Query: Search term (required)
Additional Parameters
- Number of Results: Number of results (1-10)
- Start Index: Starting index for pagination
- Language: Language of results
- Country: Country code for geolocation
- Safe Search: SafeSearch filtering level
- File Type: File type restriction
- Site Search: Search within a specific site
Output Format
Each result contains:
title: Page titlelink: Page URLtext: Page excerpt (renamed from snippet)image: Main image URL (extracted from pagemap)thumbnail: Thumbnail image URL (extracted from pagemap)
License
MIT
