360 Secure SkillHub
360 安全技能中心

X Search 1.0.0

该 Skill 通过 Python 脚本调用 xAI Responses API 的 x_search 工具,由 Grok 实时检索 X(Twitter)帖子并生成带引用的汇总。支持按指定账号、排除账号、日期范围和图片/视频理解等参数筛选;需要配置 XAI_API_KEY,且 --handles 与 --exclude 不可同时使用。

perfectworldltd
perfectworldltd
热度 54.94
最近更新 2026-05-11 17:36:45
分类:搜索依赖:代码执行 / 第三方 API / 内部调用大模型应用场景:研究 / 社交媒体 / 摘要总结

安装技能

复制下面的话术发给你的 Agent,它会通过 secure-skills 检索并安装该技能。

执行命令安装此 skill: npx secure-skills-cli add x-search-1-0-0
Metadata
name
x-search
description
Search X (Twitter) posts using the xAI API. Use when the user wants to find tweets, search X/Twitter, look up what people are saying on X, or find social media posts about a topic.
homepage
https://docs.x.ai/developers/tools/x-search
metadata
{"openclaw":{"emoji":"𝕏","requires":{"bins":["python3"],"env":["XAI_API_KEY"]},"primaryEnv":"XAI_API_KEY","install":[{"id":"python-brew","kind":"brew","formula":"python","bins":["python3"],"label":"Install Python (brew)"}]}}

X Search

Search X (Twitter) posts using the xAI Grok API with real-time access to X content.

Setup

  1. Get your API key: https://console.x.ai
  2. Set environment variable:
    export XAI_API_KEY="xai-your-key-here"
    
  3. Or set skills."x-search".apiKey / skills."x-search".env.XAI_API_KEY in ~/.openclaw/openclaw.json

Usage

python3 {baseDir}/scripts/search.py "what is trending in AI right now"

Useful flags:

# Filter by handles (max 10)
python3 {baseDir}/scripts/search.py --handles jaaneek,OpenClaw "latest posts"

# Exclude handles (max 10)
python3 {baseDir}/scripts/search.py --exclude spambot,crypto_shill "trending AI"

# Date range (YYYY-MM-DD)
python3 {baseDir}/scripts/search.py --from 2026-03-01 --to 2026-03-20 "xAI grok updates"

# Enable image/video understanding in posts
python3 {baseDir}/scripts/search.py --images --video "product demos"

Notes

  • Uses the xAI Responses API with x_search tool (Grok performs the search and summarizes results)
  • Cannot use --handles and --exclude at the same time
  • Results include citations with links to original X posts
  • Present results in a readable format with post content, authors, and citations