grok-search
Search the web or X/Twitter using xAI Grok server-side tools (web_search, x_search) via the xAI Responses API. Use when you need tweets/threads/users from X, want Grok as an altern…
notabhay
@notabhay
What This Skill Does
Searches the web or X/Twitter using xAI Grok server-side tools via the xAI Responses API, returning structured JSON with citations. Supports web search, X search, chat, and model listing through bundled Node.js scripts.
Replaces manual X/Twitter API calls and general web search tools like Brave by providing a single CLI that returns agent-friendly JSON with validated citations.
When to Use It
- Search X/Twitter for recent tweets or threads matching a query
- Retrieve structured JSON results with citations for web research
- Find tweets from specific X handles within a date range
- Use Grok as an alternative search engine for general web queries
- Extract citation URLs only from search results for quick reference
Install
$ openclaw skills install @notabhay/grok-searchRun xAI Grok locally via bundled scripts (search + chat + model listing). Default output for search is pretty JSON (agent-friendly) with citations.
API key
The script looks for an xAI API key in this order:
XAI_API_KEYenv var~/.clawdbot/clawdbot.json→env.XAI_API_KEY~/.clawdbot/clawdbot.json→skills.entries["grok-search"].apiKey- fallback:
skills.entries["search-x"].apiKeyorskills.entries.xai.apiKey
Run
Use {baseDir} so the command works regardless of workspace layout.
Search
-
Web search (JSON):
node {baseDir}/scripts/grok_search.mjs "<query>" --web
-
X/Twitter search (JSON):
node {baseDir}/scripts/grok_search.mjs "<query>" --x
Chat
-
Chat (text):
node {baseDir}/scripts/chat.mjs "<prompt>"
-
Chat (vision):
node {baseDir}/scripts/chat.mjs --image /path/to/image.jpg "<prompt>"
Models
- List models:
node {baseDir}/scripts/models.mjs
Useful flags
Output:
--links-onlyprint just citation URLs--texthide the citations section in pretty output--rawinclude the raw Responses API payload on stderr (debug)
Common:
--max <n>limit results (default 8)--model <id>(defaultgrok-4-1-fast)
X-only filters (server-side via x_search tool params):
--days <n>(e.g. 7)--from YYYY-MM-DD/--to YYYY-MM-DD--handles @a,@b(limit to these handles)--exclude @bots,@spam(exclude handles)
Output shape (JSON)
{
"query": "...",
"mode": "web" | "x",
"results": [
{
"title": "...",
"url": "...",
"snippet": "...",
"author": "...",
"posted_at": "..."
}
],
"citations": ["https://..."]
}
Notes
citationsare merged/validated from xAI response annotations where possible (more reliable than trusting the model’s JSON blindly).- Prefer
--xfor tweets/threads,--webfor general research.
Top skills in this category
Multi Search Engine
@gpyangyoujunMulti search engine integration with 16 engines (7 CN + 9 Global). Supports advanced search operators, time filters, site search, privacy engines, and Wolfra...
Agent Browser
@matrixyHeadless browser automation CLI optimized for AI agents with accessibility tree snapshots and ref-based element selection
Openai Whisper
@steipeteLocal speech-to-text with the Whisper CLI (no API key).
Tavily Search
@jacky1n7Search the public web through Tavily and return structured results with URLs and snippets. Use when an agent needs current information, source discovery, link lookup, news or finance search, or a fallback for unavailable built-in web search. Do not use for private or authenticated pages.
Baidu web search
@ide-reaSearch the web using Baidu AI Search Engine (BDSE). Use for live information, documentation, or research topics.