Overview
This node provides a tool for performing web searches using the Brave Search API. It allows users to input a search query along with optional parameters such as country, language, result count, safe search level, freshness of results, and more. The node then queries the Brave Search API and returns formatted search results.
Common scenarios where this node is beneficial include:
- AI agents or workflows needing up-to-date information from the web.
- Automating research tasks by retrieving relevant web content snippets.
- Filtering search results by region, language, or content type.
- Integrating web search capabilities into larger automation pipelines.
Practical example: An AI assistant can use this node to fetch the latest news articles about "climate change" limited to English language sources from the US, returning a concise list of titles, URLs, and snippets for quick review.
Properties
Name | Meaning |
---|---|
Tool Settings | Informational notice area for tool configuration. |
Tool Description | A detailed description of the tool’s purpose, inputs, and outputs. Helps AI models understand when and how to use the tool effectively. |
API Options | Collection of optional parameters to customize the Brave Search API request. Includes: • Result Count (1-20) • Result Offset (0-9) • Safe Search (Off, Moderate, Strict) • Freshness filter (e.g., pw, pm, date range) • Result Filter (comma-separated types like web, videos, news) • Include Extra Snippets (boolean) • Country code (2-character) • Search Language (e.g., en, de, fr) |
Output & Debugging | Informational notice area related to output format and debugging options. |
Output Format | Choose between: • Raw JSON String — returns the full raw JSON response from the API. • Simplified List — returns a human-readable list of search results with title, URL, and snippet. Recommended for most AI agents. |
Debug Mode | Enable debug mode to log detailed request and response information for troubleshooting purposes. |
Output
The node outputs data on the ai_tool
output channel with the following structure:
If Simplified List output format is selected (default):
- A string containing a numbered list of search results.
- Each entry includes:
- Title of the result (or "No Title" if missing).
- URL of the result (or "No URL" if missing).
- A concise snippet extracted from the description, truncated to 1000 characters with newline characters replaced by spaces.
- Example snippet of output:
1. Example Title URL: https://example.com Snippet: This is a brief summary of the page content... 2. Another Title URL: https://another.com Snippet: Another snippet describing the page...
If Raw JSON String output format is selected:
- The full JSON response from the Brave Search API as a string.
Binary data is not produced by this node.
Dependencies
- Requires an active Brave Search API subscription with a valid API key credential.
- The node expects the API base URL and API key to be configured in the credentials.
- Uses HTTP GET requests to the Brave Search API endpoint
/res/v1/web/search
. - Optional debug logging depends on n8n's internal logger.
Troubleshooting
Common issues:
- Invalid or missing API key credential will cause authentication errors.
- Exceeding allowed parameter ranges (e.g., count > 20 or offset > 9) may cause API errors.
- Network connectivity problems can prevent successful API calls.
- Unexpected API response structures may cause the simplified output formatting to fail, falling back to raw JSON output.
Error messages:
- Brave Search API request failed: Indicates an error response from the API, including HTTP status code and message. Check API key validity and request parameters.
- Unexpected error during Brave Search: Covers other runtime exceptions; check logs for details.
Resolutions:
- Verify API key and subscription status.
- Ensure input parameters respect documented limits.
- Enable debug mode to get detailed logs for diagnosing issues.
- Review network settings and firewall rules that might block API access.