<!-- BusyBot node reference — https://busybot.net/tools/grok-x-search/ -->

> Node: Grok X Search (`grok_x_search`) · Action · v1
> Category: AI · Credentials: xAI (`xai`)
> Updated: 2026-08-16

# Grok X Search

> Search X/Twitter posts using xAI Grok with live data access.

## Overview

Grok X Search asks a Grok model a question and lets it search live X/Twitter posts while answering. The search runs on xAI's servers; Grok decides when to use it and comes back with a synthesized response plus the X posts it cited, along with the model name, token usage, and status.

**Category:** AI  
**Tool Name:** `grok_x_search`  
**Version:** 1

**Appearance:** Icon: `brain` | Color: `#000000`

## Node Type

**Action** — processes input items and produces output

## Input / Output

| Direction | Port(s) |
|-----------|--------|
| Input | `Input` |
| Output | `Output`, `Error` |

## Credentials

This tool requires **xAI** credentials.
See the [Credentials Guide](https://busybot.net/credentials/xai/) for setup instructions.

### Parameters

| Parameter | Type | Required | Default | Description |
|-----------|------|----------|---------|-------------|
| Model | `options` | No | Platform default | The Grok model to use for X search. |
| | | | | Options: the Grok chat models currently available — the dropdown tracks the model catalog, so it changes as xAI's line-up changes. |
| System Prompt | `string` | No | — | Optional system prompt to guide how the model synthesizes X search results. Supports expressions like {{ $json.persona }}. |
| Search Query | `string` | Yes | — | The search query to find relevant X/Twitter posts. If empty, falls back to the input item's "message" or "query" field. Supports expressions. |
| Options | `collection` | No | `{}` | Optional search and output settings — add only the fields you want to override. |
| — Max Tokens | `number` | No | `4096` | Maximum number of tokens to generate in the response. |
| — Temperature | `number` | No | `0.7` | Controls randomness. Lower values produce more factual results; higher values more creative. Range: 0-2. |
| — Response Field Name | `string` | No | `response` | The output field name where the search response text will be stored. |
| Include Input | `boolean` | No | `false` | Whether to include the original input item fields in the output alongside the search results. |
| Max Concurrency | `number` | No | `10` | Maximum number of items to process concurrently. |

## Output Data

One output item per input item. The answer text is written to the field named by Response Field Name (`response` by default). The rest of the input JSON is carried over only when Include Input is on; binary data from the input item is forwarded.

- `response` — the synthesized answer drawn from X posts, under whatever name Response Field Name is set to.
- `citations` — an array of the X posts the answer cited, each `{ "url": "...", "title": "..." }`. `title` is an empty string when the post did not supply one. **This field is only present when at least one post was cited** — test for it before reading it downstream.
- `model` — the model that produced the answer.
- `usage` — the token counts reported by xAI for the request.
- `finishReason` — the status xAI reported for the request.

Reference the result downstream by expression, e.g. `{{ $json.response }}` or `{{ $json.citations[0].url }}`. To fan out one item per cited post, follow this node with a Split Out node on `citations`.

## Usage Examples

- Search X posts about a trending topic using Grok
- Monitor X/Twitter mentions of a brand
- Find recent X posts about a specific event
- Analyze sentiment from X posts about a product launch
- Get summarized X post results with source citations

## Example Configuration

Search X for a topic with the defaults:

```json
{
  "type": "grok_x_search",
  "parameters": {
    "userMessage": "What are people saying about the new product launch?"
  }
}
```

Monitor brand mentions and keep the source item alongside — say the time window you want in the query itself, since the node has no date parameter:

```json
{
  "type": "grok_x_search",
  "parameters": {
    "systemPrompt": "You are a social listening analyst. Summarise the overall sentiment in three sentences.",
    "userMessage": "Posts from the last 7 days mentioning {{ $json.brand }}",
    "includeInput": true,
    "maxConcurrency": 3,
    "options": {
      "maxTokens": 1024,
      "temperature": 0.2,
      "responseFieldName": "sentimentSummary"
    }
  }
}
```

### Error Handling

| Mode | Behavior |
|------|----------|
| **stop** | Halts workflow on first error |
| **continue** | Skips failed items, passes successful ones through |
| **errorPort** | Routes failed items to Error output port |

## Tips

Grok X Search queries live X/Twitter posts using the xAI Grok API with search parameters set to restrict results exclusively to X content. Use it when workflows need real-time social media data from X, such as tracking trending topics, monitoring brand mentions, or analyzing public sentiment. There is no date-range parameter — express recency in the query text. It returns a synthesized response text, X post citations, model name, token usage, and finish reason.