Skip to content
Back to skills

Xai Search

BSecurity

Search X/Twitter and the web in real-time using xAI's Grok API with agentic search tools.

  • 33 stars
  • 0 votes
  • 0 copies
  • 2 views
  • Added September 5, 2026
content-marketingpythongobashapi

Works with

  • api

Security analysis

B88/100
  • mediumUses curl or wget to download content
  • mediumInstalls packages at runtime which could introduce malicious dependencies

Pro scans all 2 files and shows the line behind each finding

Scanned September 5, 2026

npx -y skills add dvcrn/openclaw-skills-marketplace --skill xai-search --agent claude-code

Installs into .claude/skills of the current project.

Are you the author of Xai Search?

Add the live security badge to your README. It updates with every re-scan.

Security grade badge for Xai Search
[![Security: B — Skills Directory](https://www.skillsdirectory.com/api/skills/dvcrn-xai-search/badge)](https://www.skillsdirectory.com/skills/dvcrn-xai-search)

More formats (shields.io, HTML) on the badges page. Keep it an A: scan every change in CI with Pro.

Download with Pro
SKILL.md
---
name: xai-search
description: "Search X/Twitter and the web in real-time using xAI's Grok API with agentic search tools."
---

# xAI Search (Grok API)

Use xAI's agentic search to query X/Twitter and the web in real-time. This leverages Grok's `web_search` and `x_search` tools.

**Docs:** https://docs.x.ai/docs/

## Requirements

- `XAI_API_KEY` environment variable
- Python 3 + xai-sdk: `pip install xai-sdk`

## Quick Usage (curl)

### Web Search
```bash
curl -s https://api.x.ai/v1/chat/completions \
  -H "Authorization: Bearer $XAI_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "model": "grok-3-fast",
    "messages": [{"role": "user", "content": "YOUR QUERY HERE"}],
    "tools": [{"type": "function", "function": {"name": "web_search"}}]
  }' | jq -r '.choices[0].message.content'
```

### X/Twitter Search
```bash
curl -s https://api.x.ai/v1/chat/completions \
  -H "Authorization: Bearer $XAI_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "model": "grok-3-fast",
    "messages": [{"role": "user", "content": "YOUR QUERY HERE"}],
    "tools": [{"type": "function", "function": {"name": "x_search"}}]
  }' | jq -r '.choices[0].message.content'
```

### Combined (Web + X)
```bash
curl -s https://api.x.ai/v1/chat/completions \
  -H "Authorization: Bearer $XAI_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "model": "grok-3-fast",
    "messages": [{"role": "user", "content": "YOUR QUERY HERE"}],
    "tools": [
      {"type": "function", "function": {"name": "web_search"}},
      {"type": "function", "function": {"name": "x_search"}}
    ]
  }' | jq -r '.choices[0].message.content'
```

## Helper Script

For convenience, use the `xai-search.py` script in the `scripts/` folder:

```bash
# Web search (adjust path to your skill location)
python ~/.clawdbot/skills/xai-search/scripts/xai-search.py web "latest news about AI"

# X/Twitter search  
python ~/.clawdbot/skills/xai-search/scripts/xai-search.py x "what are people saying about Clawdbot"

# Both
python ~/.clawdbot/skills/xai-search/scripts/xai-search.py both "current events today"
```

## Models

- `grok-3-fast` — fast, good for quick searches
- `grok-4-1-fast` — reasoning model, better for complex queries

## X Search Filters

You can filter X searches by:
- `allowed_x_handles` / `excluded_x_handles` — limit to specific accounts
- `from_date` / `to_date` — date range (ISO8601 format)
- `enable_image_understanding` — analyze images in posts
- `enable_video_understanding` — analyze videos in posts

## Web Search Filters

- `allowed_domains` / `excluded_domains` — limit to specific sites
- `enable_image_understanding` — analyze images on pages

## Tips

- For breaking news: use X search
- For factual/research queries: use web search or both
- For sentiment/opinions: use X search
- The model will make multiple search calls if needed (agentic)

Files in this skill

  • SKILL.md2.8 KB
  • scripts/xai-search.py1.8 KB

Attribution

Is this your skill, or is something wrong with this listing? Request removal or report an issue. Author removals are honored within 72 hours.

Comments

Loading comments…