skills$openclaw/xai-search
aydencook034.0k

by aydencook03

xai-search – OpenClaw Skill

xai-search is an OpenClaw Skills integration for coding workflows. Search X/Twitter and the web in real-time using xAI's Grok API with agentic search tools.

4.0k stars3.0k forksSecurity L1
Updated Feb 7, 2026Created Feb 7, 2026coding

Skill Snapshot

namexai-search
descriptionSearch X/Twitter and the web in real-time using xAI's Grok API with agentic search tools. OpenClaw Skills integration.
owneraydencook03
repositoryaydencook03/xai-search
languageMarkdown
licenseMIT
topics
securityL1
installopenclaw add @aydencook03/xai-search
last updatedFeb 7, 2026

Maintainer

aydencook03

aydencook03

Maintains xai-search in the OpenClaw Skills directory.

View GitHub profile
File Explorer
4 files
.
scripts
xai-search.py
1.8 KB
_meta.json
455 B
SKILL.md
2.9 KB
SKILL.md

name: xai-search description: Search X/Twitter and the web in real-time using xAI's Grok API with agentic search tools. metadata: {"clawdbot":{"emoji":"🔍"}}

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
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

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)

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:

# 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)
README.md

No README available.

Permissions & Security

Security level L1: Low-risk skills with minimal permissions. Review inputs and outputs before running in production.

Requirements

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

FAQ

How do I install xai-search?

Run openclaw add @aydencook03/xai-search in your terminal. This installs xai-search into your OpenClaw Skills catalog.

Does this skill run locally or in the cloud?

OpenClaw Skills execute locally by default. Review the SKILL.md and permissions before running any skill.

Where can I verify the source code?

The source repository is available at https://github.com/openclaw/skills/tree/main/skills/aydencook03/xai-search. Review commits and README documentation before installing.