🎁 Get the FREE AI Skills Starter Guide β€” Subscribe β†’
BytesAgainBytesAgain
πŸ¦€ ClawHub

xAI Grok Search

by @castanley

Search the web and X (Twitter) using xAI's Grok API with real-time access, citations, and image understanding

Versionv1.0.3
Installs22
Comments2
πŸ’‘ Examples

Web Search - Current Events

const result = await search_web({ 
  query: "latest AI regulation developments" 
});

Web Search - Specific Domains

const result = await search_web({
  query: "UN climate summit latest",
  allowed_domains: ["un.org", "gov.uk", "grokipedia.com"]
});

X Search - Social Sentiment

const result = await search_x({
  query: "new iPhone reactions opinions"
});

X Search - Specific Handles

const result = await search_x({
  query: "AI thoughts",
  allowed_x_handles: ["elonmusk", "cstanley"],
  from_date: "2025-01-01"
});

X Search - With Media

const result = await search_x({
  query: "Mars landing images",
  enable_image_understanding: true,
  enable_video_understanding: true
});

βš™οΈ Configuration

Required Environment Variables

export XAI_API_KEY="your-xai-api-key-here"

Get your API key from: https://console.x.ai/

πŸ“‹ Tips & Best Practices

Web Search

  • Use allowed_domains to limit to specific domains (max 5)
  • Use excluded_domains for known bad sources (max 5)
  • Cannot use both at same time
  • Enable image understanding only when needed
  • X Search

  • Use allowed_x_handles to focus on specific accounts (max 10)
  • Use excluded_x_handles to filter noise (max 10)
  • Cannot use both at same time
  • Don't include @ symbol in handles
  • Use ISO8601 date format: YYYY-MM-DD
  • Media understanding adds API costs
  • View on ClawHub
    TERMINAL
    clawhub install grok

    πŸ§ͺ Use this skill with your agent

    Most visitors already have an agent. Pick your environment, install or copy the workflow, then run the smoke-test prompt above.

    πŸ” Can't find the right skill?

    Search 60,000+ AI agent skills β€” free, no login needed.

    Search Skills β†’