Overview
This node enables performing web searches using the Serper API, which provides Google search results programmatically. It is useful for automating information retrieval tasks such as gathering search results, related queries, and frequently asked questions from the web.
Common scenarios include:
- Automatically fetching search results for market research or competitive analysis.
- Integrating live web search data into workflows for content generation or monitoring.
- Extracting related topics and people also ask questions to enhance SEO or knowledge bases.
For example, you can input a query like "latest electric cars" and get structured search results along with related searches and popular questions about electric cars.
Properties
| Name | Meaning |
|---|---|
| Query | The search query to execute (e.g., "best programming languages 2024"). |
| Number of Results | Number of search results to return, between 1 and 100. |
| Country | Country code to localize results (e.g., "us" for United States, "uk" for United Kingdom). |
| Language | Language code for the search results (e.g., "en" for English, "es" for Spanish). |
| Safe Search | Safe search filter: either "Off" (no filter) or "Active" (filter explicit content). |
Output
The node outputs an array of JSON objects, each corresponding to one input item. Each output JSON contains:
query: The original search query string.searchParameters: Object containing the parameters used (num,gl,hl,safe).organic: Array of organic search results returned by the API.peopleAlsoAsk: Array of questions related to the query that people commonly ask.relatedSearches: Array of related search terms suggested by the API.searchInformation: Metadata about the search (e.g., total results, time taken).
If the node encounters an error and is set to continue on failure, it outputs an object with an error field describing the issue.
The node does not output binary data.
Dependencies
- Requires an active Serper API key credential configured in n8n.
- Makes authenticated POST requests to
https://google.serper.dev/search. - Uses JSON payloads and expects JSON responses.
Troubleshooting
- Missing Query Parameter: If the "Query" property is empty, the node throws an error stating the query parameter is required. Ensure you provide a valid search query.
- Missing or Invalid API Key: The node requires a valid Serper API key. Without it, an error will be thrown indicating the API key is missing. Verify your credentials are correctly set up.
- Rate Limits or API Errors: If the Serper API returns errors due to rate limits or invalid parameters, these will propagate as node errors unless "Continue On Fail" is enabled.
- Invalid Number of Results: The number of results is clamped between 1 and 100. Providing values outside this range will be adjusted automatically.
Links and References
- Serper API Documentation — Official documentation for the Serper search API.
- Google Search Parameters — For understanding country and language codes in search queries.