x-search
Compare original and translation side by side
🇺🇸
Original
English🇨🇳
Translation
ChineseX Search
X(原Twitter)帖子搜索
Search X (Twitter) posts using xAI's Grok API with keyword search, semantic search, user filtering, and date range capabilities.
借助关键词搜索、语义搜索、用户筛选和日期范围功能,使用xAI的Grok API搜索X(原Twitter)帖子。
Instructions for Agents
Agent使用说明
When invoking this skill:
- Execute the script using the Bash tool with appropriate parameters based on the user's request
- Parse the output which contains both the analysis and citations sections
- CRITICAL: Always include the citations in your response to the user. The script output contains a "Citations:" section with numbered X post URLs that MUST be presented to the user
- Format your response to include:
- The analysis/findings from Grok
- The complete citations list with all referenced post URLs
The script will return formatted output with citations. You MUST include these citations in your response to the user.
调用此技能时:
- 执行脚本:根据用户请求,使用Bash工具并传入合适的参数
- 解析输出:输出内容包含分析和引用两部分
- 重要提示:在给用户的回复中必须包含引用内容。脚本输出的“Citations:”部分包含带编号的X帖子URL,必须展示给用户
- 回复格式要求:需包含以下内容:
- Grok生成的分析/发现结果
- 包含所有引用帖子URL的完整引用列表
Quick Start
快速入门
Basic X search:
bash
scripts/x_search.sh "What are people saying about AI?"基础X搜索:
bash
scripts/x_search.sh "What are people saying about AI?"Environment Setup
环境配置
Required environment variables:
- : Your xAI API key (required)
XAI_API_KEY - : API host URL (optional, defaults to https://api.x.ai)
XAI_API_HOST
所需环境变量:
- : 你的xAI API密钥(必填)
XAI_API_KEY - : API主机地址(可选,默认值为https://api.x.ai)
XAI_API_HOST
Search Options
搜索选项
Date Range Filtering
日期范围筛选
Restrict search to specific time period:
bash
scripts/x_search.sh "AI developments" --from-date 2025-01-01 --to-date 2025-02-06将搜索限制在特定时间段:
bash
scripts/x_search.sh "AI developments" --from-date 2025-01-01 --to-date 2025-02-06User Handle Filtering
用户账号筛选
Search only specific users (max 10):
bash
scripts/x_search.sh "latest updates" --allowed-handles elonmusk,gdbExclude specific users (max 10):
bash
scripts/x_search.sh "tech news" --excluded-handles spamaccount,bot123Note: Cannot use both and in the same request.
--allowed-handles--excluded-handles仅搜索特定用户的帖子(最多10个):
bash
scripts/x_search.sh "latest updates" --allowed-handles elonmusk,gdb排除特定用户的帖子(最多10个):
bash
scripts/x_search.sh "tech news" --excluded-handles spamaccount,bot123注意:同一请求中不能同时使用和参数。
--allowed-handles--excluded-handlesMedia Understanding
媒体内容识别
Enable image analysis in posts:
bash
scripts/x_search.sh "AI art trends" --enable-imagesEnable video analysis in posts:
bash
scripts/x_search.sh "product demos" --enable-videos启用帖子中的图片分析:
bash
scripts/x_search.sh "AI art trends" --enable-images启用帖子中的视频分析:
bash
scripts/x_search.sh "product demos" --enable-videosCombined Options
组合选项
All options can be combined:
bash
scripts/x_search.sh "climate change discussion" \
--from-date 2025-01-01 \
--excluded-handles climateskeptic \
--enable-images所有选项可以组合使用:
bash
scripts/x_search.sh "climate change discussion" \
--from-date 2025-01-01 \
--excluded-handles climateskeptic \
--enable-imagesEnable Reasoning Model
启用推理模型
Use flag to switch to the reasoning model for deeper analysis:
--thinkingbash
scripts/x_search.sh "complex topic requiring deep analysis" --thinkingThis uses instead of the default .
grok-4-1-fast-reasoninggrok-4-1-fast-non-reasoning使用参数切换到推理模型以进行深度分析:
--thinkingbash
scripts/x_search.sh "complex topic requiring deep analysis" --thinking该模式使用模型,而非默认的模型。
grok-4-1-fast-reasoninggrok-4-1-fast-non-reasoningOutput Format
输出格式
The script automatically parses the JSON response and outputs:
- Text content: Grok's formatted analysis and findings
- Citations: List of X post URLs with reference numbers
Example output:
undefined脚本会自动解析JSON响应并输出以下内容:
- 文本内容:Grok生成的格式化分析和发现结果
- 引用列表:带引用编号的X帖子URL列表
输出示例:
undefinedResponse:
Response:
[Analysis text with inline citation markers]
[Analysis text with inline citation markers]
Citations:
Citations:
[1] https://x.com/i/status/...
[2] https://x.com/i/status/...
undefined[1] https://x.com/i/status/...
[2] https://x.com/i/status/...
undefinedUsage Notes
使用注意事项
- Default model: for fast search responses
grok-4-1-fast-non-reasoning - With flag:
--thinkingfor deeper reasoninggrok-4-1-fast-reasoning - The script uses curl to query the xAI Responses API endpoint
- Output is automatically parsed with jq for readability
- Date format: ISO8601 (YYYY-MM-DD)
- Handle limits: 10 maximum for allowed/excluded lists
- 默认模型:,用于快速搜索响应
grok-4-1-fast-non-reasoning - 启用参数时:使用
--thinking进行深度推理grok-4-1-fast-reasoning - 脚本使用curl调用xAI Responses API接口
- 输出会自动通过jq解析以提升可读性
- 日期格式:ISO8601(YYYY-MM-DD)
- 账号数量限制:允许/排除的用户账号列表最多10个