mcpField
B
byted-byteplus-infoquest-search

byted-byteplus-infoquest-search

github.com/bytedance生产力47743 次安装今天更新
代码仓库

关于 byted-byteplus-infoquest-search

这是一项通过 BytePlus InfoQuest API 搜索网页和图片、提取页面内容的 Python 技能,适用于需要按日期或站点筛选的研究任务。

主要功能

  1. 01按日期筛选网页搜索
  2. 02限定站点搜索
  3. 03按尺寸筛选图片
  4. 04提取 URL 页面内容

适用场景

  1. 01查找近期主题报道
  2. 02在指定站点搜索项目
  3. 03按主题和尺寸查找图片

安装

复制下面的命令,在终端中运行。

$npx skills add https://github.com/bytedance/agentkit-samples --skill byted-byteplus-infoquest-search

安装后在 Claude Code 中输入/byted-byteplus-infoquest-search确认已加载。

包含的文件

除 SKILL.md 外,安装时一起下载的参考资料和脚本。

LICENSE
scripts/
extract.py
search.py

详细介绍

Byted InfoQuest

使用 BytePlus InfoQuest API 进行 AI 优化的网页搜索、图片搜索和内容提取。返回简洁、相关的结果,并支持时间筛选、站点专属搜索和图片搜索。

提示:InfoQuest 目前无法在中国大陆地区使用。

环境变量

使用此技能前,请确保已设置以下环境变量:

  • INFOQUEST_API_KEY:网页搜索、图片搜索和内容提取服务的 API 密钥

网页搜索

python3 scripts/search.py "query"
python3 scripts/search.py "query" -d 7
python3 scripts/search.py "query" -s github.com

图片搜索

python3 scripts/search.py "query" -i
python3 scripts/search.py "query" -i -z l
python3 scripts/search.py "query" -i -s unsplash.com -d 30

选项

  • -d, --days <number>:搜索最近 N 天内的内容(默认:不限时间)
  • -s, --site <domain>:在指定站点内搜索(例如,github.com、unsplash.com)
  • -i, --image:执行图片搜索(默认:网页搜索)
  • -z, --image-size <size>:图片尺寸筛选:l(大)、m(中)、i(图标)

从 URL 提取内容

python3 scripts/extract.py "https://example.com/article"

示例

搜索近期新闻
# Search for AI news from last 3 days
python3 scripts/search.py "artificial intelligence news" -d 3
站点专属研究
# Search for Python projects on GitHub
python3 scripts/search.py "Python machine learning" -s github.com
图片搜索示例
# Search for cat images
python3 scripts/search.py "cat" -i

# Search for large landscape images
python3 scripts/search.py "landscape" -i -z l

# Search for icons from specific site
python3 scripts/search.py "logo" -i -z i -s github.com

# Search for recent images
python3 scripts/search.py "sunset" -i -d 7
内容提取
# Extract content from a single article
python3 scripts/extract.py "https://example.com/article"

注意事项

API 访问
搜索功能
  • 时间筛选:使用 -d 搜索最近 N 天内的内容(例如,-d 7)
  • 站点筛选:使用 -s 进行站点专属搜索(例如,-s github.com)
  • 图片搜索:使用 -i 搜索图片,并可选择使用尺寸筛选(-z)
  • 图片尺寸选项:l(大)、m(中)、i(图标)
图片搜索用法

图片搜索会返回可用作图片生成参考的图片 URL。每个结果包含:

  • title:图片标题或描述
  • image_url:图片的直接 URL

用法提示:将 image_url 值用作图片生成的参考图片。如有需要,请先下载图片。

快速设置

  1. 设置 API 密钥:

    export INFOQUEST_API_KEY=<REPLACE_WITH_YOUR_KEY>
    
  2. 安装所需的 Python 包:

    pip install requests
    
  3. 测试设置:

    # Test web search
    python3 scripts/search.py "test search"
    
    # Test image search
    python3 scripts/search.py "test" -i
    

错误处理

API 会针对以下情况返回以 "Error:" 开头的错误消息:

  • 身份验证失败
  • 网络超时
  • 响应为空
  • 响应格式无效
  • 图片尺寸参数无效(必须为 'l'、'm' 或 'i')

与 Node.js 版本的区别

  • 需要 Python 3.6+
  • 使用 requests 库代替 fetch
  • 使用 argparse 简化参数解析
  • 功能和 API 端点相同

评论

支持 Markdown