# Google Search

**Action ID:** `google_search`

## Description

Search Google for recent results.

## Connection

| Name               | Description                                 | Required | Category |
| ------------------ | ------------------------------------------- | -------- | -------- |
| PixelML Connection | The PixelML connection to call PixelML API. | True     | pixelml  |

## Input Parameters

| Name          | Type    | Required | Default | Description                                   |
| ------------- | ------- | :------: | ------- | --------------------------------------------- |
| search\_query | string  |     ✓    | -       | What do you want to search for?               |
| top\_k        | integer |     -    | 5       | Number of top search results to return (1-10) |

<details>

<summary>View JSON Schema</summary>

```json
{
  "description": "GoogleSearch node runner input.",
  "properties": {
    "search_query": {
      "description": "What do you want to search for?",
      "title": "Search Query",
      "type": "string"
    },
    "top_k": {
      "default": 5,
      "description": "Number of top search results to return",
      "maximum": 10,
      "minimum": 1,
      "title": "Top k",
      "type": "integer"
    }
  },
  "required": [
    "search_query"
  ],
  "title": "GoogleSearchNodeRunnerInput",
  "type": "object"
}
```

</details>

## Output Parameters

| Name            | Type  | Description                                                  |
| --------------- | ----- | ------------------------------------------------------------ |
| search\_results | array | Array of search result objects with title, snippet, and link |

<details>

<summary>View JSON Schema</summary>

```json
{
  "$defs": {
    "GoogleSearchResult": {
      "description": "Google search result.",
      "properties": {
        "title": {
          "title": "Title",
          "type": "string"
        },
        "snippet": {
          "title": "Snippet",
          "type": "string"
        },
        "link": {
          "title": "Link",
          "type": "string"
        }
      },
      "required": [
        "title",
        "snippet",
        "link"
      ],
      "title": "GoogleSearchResult",
      "type": "object"
    }
  },
  "description": "GoogleSearch node runner output.",
  "properties": {
    "search_results": {
      "description": "Top k search results",
      "items": {
        "$ref": "#/$defs/GoogleSearchResult"
      },
      "title": "Search Results",
      "type": "array"
    }
  },
  "required": [
    "search_results"
  ],
  "title": "GoogleSearchNodeRunnerOutput",
  "type": "object"
}
```

</details>

## How It Works

This node performs Google searches through the PixelML API and returns structured search results. You provide a search query, and the node retrieves the top matching results including title, snippet, and URL. The top\_k parameter controls how many results are returned (1-10). Results are presented in relevance order as determined by Google's algorithm.

## Usage Examples

### Example 1: Search for Product Information

**Input:**

```
search_query: "best electric cars 2024"
top_k: 5
```

**Output:**

```
search_results: [
  {
    "title": "Top 10 Electric Cars of 2024 - Auto Review",
    "snippet": "Comprehensive review of the best electric vehicles available in 2024...",
    "link": "https://autoreview.com/top-electric-cars-2024"
  },
  {
    "title": "2024 Electric Car Buyer's Guide",
    "snippet": "Everything you need to know about buying an electric car this year...",
    "link": "https://carguide.com/electric-2024"
  }
]
```

### Example 2: Search for Recent News

**Input:**

```
search_query: "latest AI developments"
top_k: 3
```

**Output:**

```
search_results: [
  {
    "title": "Major AI Breakthrough Announced Today",
    "snippet": "Researchers unveil new language model with enhanced capabilities...",
    "link": "https://technews.com/ai-breakthrough"
  }
]
```

### Example 3: Research Competitor Information

**Input:**

```
search_query: "competitor company latest product launch"
top_k: 10
```

**Output:**

```
search_results: [... 10 search results ...]
```

## Common Use Cases

* **Market Research**: Gather information about competitors, products, or market trends
* **Content Research**: Find sources and references for content creation
* **News Monitoring**: Track latest news and updates on specific topics
* **SEO Analysis**: Understand what content ranks for specific keywords
* **Product Research**: Find product reviews, comparisons, and specifications
* **Trend Analysis**: Identify trending topics and discussions in your industry
* **Fact Checking**: Verify information by searching for authoritative sources

## Error Handling

| Error Type           | Cause                                         | Solution                                        |
| -------------------- | --------------------------------------------- | ----------------------------------------------- |
| Connection Failed    | Invalid or expired PixelML connection         | Verify your PixelML connection credentials      |
| Empty Query          | Search query is empty or null                 | Provide a non-empty search query string         |
| No Results Found     | Query returned no matching results            | Try different search terms or broader keywords  |
| Rate Limit Exceeded  | Too many search requests in short period      | Space out requests or upgrade your PixelML plan |
| Invalid top\_k Value | top\_k is outside allowed range (1-10)        | Set top\_k between 1 and 10                     |
| Service Unavailable  | Google search service temporarily unavailable | Retry the request after a short delay           |
| Query Too Complex    | Search query is too long or complex           | Simplify the search query                       |

## Notes

* **Result Limit**: Maximum 10 results per search. For more comprehensive research, perform multiple searches with different queries.
* **Search Freshness**: Results reflect Google's current index. Very recent content may not appear immediately.
* **Cost Per Search**: Each search operation consumes PixelML API credits. Monitor usage to control costs.
* **Query Syntax**: Use natural language queries. Advanced Google search operators may not be supported.
* **Result Structure**: Each result includes title, snippet (description), and full URL.
* **Rate Limiting**: PixelML implements rate limiting. Space out searches appropriately.
* **Regional Results**: Results may vary by region. The node uses PixelML's default regional settings.
* **Link Validity**: URLs are returned as-is. Verify links are accessible before using them in production.


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.agenticflow.ai/reference/nodes/google_search.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
