Overview
The Brave Search node allows users to perform web searches using the Brave Search API, specifically supporting a "News Search" operation. This node is useful for retrieving news articles based on user-defined search queries with various filtering and localization options. Practical applications include monitoring current events, gathering news data for analysis, or integrating news content into workflows.
Properties
| Name | Meaning |
|---|---|
| Query | The user's search query term. Cannot be empty. Maximum of 400 characters and 50 words. |
| Count | Number of news results to return (1 to 50). Controls how many news items are retrieved per request. |
| Additional Parameters | A collection of optional parameters to refine the search: - Country: Limits results to a specific country (2-character country codes, e.g., US, GB, DE). - Search Language: Language of the search query (2-character codes). - User Interface Language: Preferred language for the response UI (language-country format, e.g., en-US). - Offset: Number of result sets to skip for pagination (0-9). - Spellcheck: Enable or disable spellcheck (default true). - Safe Search: Level of safe search filtering (off, moderate, strict). - Freshness: Filter results by recency (all time, past 24 hours, past 7 days, past month, past year). - Extra Snippets: Enable up to 5 additional excerpts in results (boolean). - Goggles: Custom re-ranking URLs to influence search results (multiple URLs allowed). |
Output
The node outputs an array of JSON objects representing the news search results returned by the Brave Search API. Each item contains structured data about individual news articles matching the query, including metadata such as titles, snippets, URLs, publication dates, and possibly other fields provided by the API.
No binary data output is indicated.
Dependencies
- Requires an API key credential for authenticating with the Brave Search API.
- The node uses the
httpRequestWithAuthenticationhelper method to make authenticated HTTP requests. - No additional external dependencies beyond the Brave Search API and n8n's standard HTTP request capabilities.
Troubleshooting
- Empty Query Error: Since the query cannot be empty, ensure the "Query" property is set; otherwise, the API may reject the request.
- Exceeded Limits: Requesting more than 50 results or offsetting beyond supported ranges may cause errors or fewer results returned.
- Invalid Country or Language Codes: Using unsupported or incorrectly formatted country/language codes can lead to no results or API errors.
- API Authentication Errors: Ensure the API key credential is correctly configured and valid.
- Network Issues: Connectivity problems will cause request failures; verify network access to the Brave Search API endpoint.
- Handling Failures: If "Continue On Fail" is enabled, failed requests will return error details per item instead of stopping execution.
Links and References
- Brave Search API Documentation (for detailed API parameters and usage)
- RFC 9110 - Accept-Language Header (explains language tag formats used in UI language property)