Felo Web Fetch Skill
When to Use
Trigger this skill when the user wants to:
- - Fetch or scrape content from a webpage URL
- Get article/main text from a link
- Convert a webpage to Markdown or plain text
- Capture readable content from a URL for summarization or processing
Trigger keywords (examples):
- - fetch webpage, scrape URL, fetch page content, web fetch, url to markdown
- Explicit:
/felo-web-fetch, "use felo web fetch" - Same intent in other languages (e.g. 网页抓取, 提取网页内容) also triggers this skill
Do NOT use for:
- - Real-time search or Q&A (use
felo-search) - Generating slides (use
felo-slides) - Local file content (read files directly)
Setup
1. Get API key
- 1. Visit felo.ai
- Open Settings -> API Keys
- Create and copy your API key
2. Configure environment variable
Linux/macOS:
CODEBLOCK0
Windows PowerShell:
CODEBLOCK1
How to Execute
Option A: Use the bundled script or packaged CLI
Script (from repo):
CODEBLOCK2
Packaged CLI (after npm install -g felo-ai): same options, with short forms allowed:
CODEBLOCK3
Options:
| Option | Default | Description |
|---|
| INLINECODE4 | (required) | Webpage URL to fetch |
| INLINECODE5 |
markdown | Output format:
html,
text,
markdown |
|
--target-selector | - | CSS selector: fetch only this element (e.g.
article.main,
#content) |
|
--wait-for-selector | - | Wait for this selector before fetching (e.g. dynamic content) |
|
--readability | false | Enable readability processing (main content only) |
|
--crawl-mode | fast |
fast or
fine |
|
--timeout | 60000 (script) / 60 (CLI) | Request timeout: script uses
milliseconds, CLI uses
seconds (e.g.
-t 90) |
|
--json /
-j | false | Print full API response as JSON |
How to write instructions (targetselector + outputformat)
When the user wants a specific part of the page or a specific output format, phrase the command like this:
- - Output format: "Fetch as text" / "Get markdown" / "Return html" → use
--format text, --format markdown, or --format html. - Target one element: "Only the main article" / "Just the content inside
#main" / "Fetch only article.main-content" → use --target-selector "article.main" or the selector they give (e.g. #main, .main-content, article .post).
Examples of user intents and equivalent commands:
| User intent | Command |
|---|
| "Fetch this page as plain text" | INLINECODE29 |
| "Get only the main content area" |
--url "..." --target-selector "main" or
article |
| "Fetch the div with id=content as markdown" |
--url "..." --target-selector "#content" --format markdown |
| "Just the article body, as HTML" |
--url "..." --target-selector "article .body" --format html |
Examples:
CODEBLOCK4
Option B: Call API with curl
CODEBLOCK5
API Reference (summary)
- - Endpoint: INLINECODE34
- Base URL:
https://openapi.felo.ai. Override with FELO_API_BASE env if needed. - Auth: INLINECODE37
Request body (JSON)
| Parameter | Type | Required | Default | Description |
|---|
| url | string | Yes | - | Webpage URL to fetch |
| crawl_mode |
string | No | fast |
fast or
fine |
| output_format | string | No | html |
html,
text,
markdown |
| with_readability | boolean | No | - | Use readability (main content) |
| with
linkssummary | boolean | No | - | Include links summary |
| with
imagessummary | boolean | No | - | Include images summary |
| target_selector | string | No | - | CSS selector for target element |
| wait
forselector | string | No | - | Wait for selector before fetch |
| timeout | integer | No | - | Timeout in milliseconds |
| with_cache | boolean | No | true | Use cache |
Response
Success (200):
CODEBLOCK6
Fetched content is in data.content; structure depends on output_format.
Error codes
| HTTP | Code | Description |
|---|
| 400 | - | Parameter validation failed |
| 401 |
INVALID
APIKEY | API key invalid or revoked |
| 500/502 | WEB
EXTRACTFAILED | Fetch failed (server or page error) |
Output Format
On success (script without --json):
- - Print the fetched content only (for direct use or piping).
With --json:
- - Print full API response including
code, message, data.
Error response to user:
CODEBLOCK7
Important Notes
- - Always check
FELO_API_KEY before calling; if missing, return setup instructions. - For long articles or slow sites, consider
--timeout or timeout in request body. - Use
output_format: "markdown" and with_readability: true for clean article text. - API may cache results; use
with_cache: false in body only when fresh content is required (script does not expose this by default).
References
Felo 网页抓取技能
使用时机
当用户希望执行以下操作时触发此技能:
- - 从网页 URL 抓取或提取内容
- 从链接获取文章/正文
- 将网页转换为 Markdown 或纯文本
- 从 URL 捕获可读内容以进行摘要或处理
触发关键词(示例):
- - 抓取网页、爬取 URL、获取页面内容、网页抓取、URL 转 Markdown
- 明确指令:/felo-web-fetch、使用 felo 网页抓取
- 其他语言的相同意图(例如 网页抓取、提取网页内容)也会触发此技能
不适用于:
- - 实时搜索或问答(使用 felo-search)
- 生成幻灯片(使用 felo-slides)
- 本地文件内容(直接读取文件)
设置
1. 获取 API 密钥
- 1. 访问 felo.ai
- 打开设置 -> API 密钥
- 创建并复制您的 API 密钥
2. 配置环境变量
Linux/macOS:
bash
export FELOAPIKEY=your-api-key-here
Windows PowerShell:
powershell
$env:FELOAPIKEY=your-api-key-here
如何执行
方式 A:使用捆绑脚本或打包的 CLI
脚本(来自仓库):
bash
node felo-web-fetch/scripts/runwebfetch.mjs --url https://example.com/article [选项]
打包的 CLI(在 npm install -g felo-ai 之后):相同选项,允许使用短格式:
bash
felo web-fetch -u https://example.com [选项]
短格式:-u(url)、-f(format)、-t(timeout,秒)、-j(json)
选项:
| 选项 | 默认值 | 描述 |
|---|
| --url | (必需) | 要抓取的网页 URL |
| --format |
markdown | 输出格式:html、text、markdown |
| --target-selector | - | CSS 选择器:仅抓取此元素(例如 article.main、#content) |
| --wait-for-selector | - | 在抓取前等待此选择器(例如动态内容) |
| --readability | false | 启用可读性处理(仅主要内容) |
| --crawl-mode | fast | fast 或 fine |
| --timeout | 60000(脚本)/ 60(CLI) | 请求超时:脚本使用
毫秒,CLI 使用
秒(例如 -t 90) |
| --json / -j | false | 以 JSON 格式打印完整 API 响应 |
如何编写指令(targetselector + outputformat)
当用户想要页面的特定部分或特定输出格式时,按如下方式表述命令:
- - 输出格式:以文本格式抓取 / 获取Markdown / 返回HTML → 使用 --format text、--format markdown 或 --format html。
- 定位一个元素:仅主文章 / 仅#main内部的内容 / 仅抓取article.main-content → 使用 --target-selector article.main 或他们给出的选择器(例如 #main、.main-content、article .post)。
用户意图与等效命令示例:
| 用户意图 | 命令 |
|---|
| 将此页面抓取为纯文本 | --url ... --format text |
| 仅获取主要内容区域 |
--url ... --target-selector main 或 article |
| 将 id=content 的 div 抓取为 Markdown | --url ... --target-selector #content --format markdown |
| 仅文章正文,以 HTML 格式 | --url ... --target-selector article .body --format html |
示例:
bash
基础:抓取为 Markdown
node felo-web-fetch/scripts/run
webfetch.mjs --url https://example.com
文章风格,带可读性
node felo-web-fetch/scripts/run
webfetch.mjs --url https://example.com/article --readability --format markdown
原始 HTML
node felo-web-fetch/scripts/run
webfetch.mjs --url https://example.com --format html --json
仅匹配 CSS 选择器的元素(例如主文章)
node felo-web-fetch/scripts/run
webfetch.mjs --url https://example.com --target-selector article.main --format markdown
特定输出格式 + 目标选择器
node felo-web-fetch/scripts/run
webfetch.mjs --url https://example.com --target-selector #content --format text
方式 B:使用 curl 调用 API
bash
curl -X POST https://openapi.felo.ai/v2/web/extract \
-H Authorization: Bearer $FELOAPIKEY \
-H Content-Type: application/json \
-d {url: https://example.com, outputformat: markdown, withreadability: true}
API 参考(摘要)
- - 端点:POST /v2/web/extract
- 基础 URL:https://openapi.felo.ai。如有需要,可通过 FELOAPIBASE 环境变量覆盖。
- 认证:Authorization: Bearer YOURAPIKEY
请求体(JSON)
| 参数 | 类型 | 必需 | 默认值 | 描述 |
|---|
| url | 字符串 | 是 | - | 要抓取的网页 URL |
| crawl_mode |
字符串 | 否 | fast | fast 或 fine |
| output_format | 字符串 | 否 | html | html、text、markdown |
| with_readability | 布尔值 | 否 | - | 使用可读性(主要内容) |
| with
linkssummary | 布尔值 | 否 | - | 包含链接摘要 |
| with
imagessummary | 布尔值 | 否 | - | 包含图片摘要 |
| target_selector | 字符串 | 否 | - | 目标元素的 CSS 选择器 |
| wait
forselector | 字符串 | 否 | - | 在抓取前等待的选择器 |
| timeout | 整数 | 否 | - | 超时时间(毫秒) |
| with_cache | 布尔值 | 否 | true | 使用缓存 |
响应
成功(200):
json
{
code: 0,
message: success,
data: {
content: { ... }
}
}
抓取的内容位于 data.content 中;结构取决于 output_format。
错误码
INVALID
APIKEY | API 密钥无效或已撤销 |
| 500/502 | WEB
EXTRACTFAILED | 抓取失败(服务器或页面错误) |
输出格式
成功时(脚本不带 --json):
带 --json:
- - 打印完整 API 响应,包括 code、message、data。
向用户返回错误响应:
markdown
网页抓取失败
- - 错误:<代码或消息>
- URL:<请求的 URL>
- 建议:<例如检查 URL、重试或使用 --timeout>
重要说明
- - 在调用前始终检查 FELOAPIKEY;如果缺失,返回设置说明。
- 对于长文章或慢速网站,考虑使用 --timeout 或请求体中的 timeout。
- 使用 outputformat: markdown 和 withreadability: true 获取干净的文章文本。
- API 可能会缓存结果;仅在需要最新内容时在请求体中使用 with_cache: false(脚本默认不暴露此选项)。
参考