AgentSkillsCN

web-fetch-linkup

利用 Linkup API 从任意网页中抓取并提取纯净内容。

SKILL.md
--- frontmatter
name: web-fetch-linkup
description: Fetch and extract clean content from any web page using Linkup API
category: core
language: en
triggers:
  - linkup
  - fetch url
  - scrape webpage
  - web content
  - extract webpage

Web Fetch with Linkup

Fetch clean web content via the Linkup API using a standalone Python script.

Prerequisites

A .env file in the skill directory (.claude/skills/web-fetch-linkup/.env) with:

code
LINKUP_API_KEY=your_api_key_here

See .env.example for the template.

Workflow

Step 1: Collect the URL

Get the URL from the user via AskUserQuestion or directly if provided in the request.

Step 2: Fetch the content

Run the script using Bash:

bash
python3 .claude/skills/web-fetch-linkup/fetch.py "<URL>"

Options:

FlagEffect
--no-render-jsDisable JavaScript rendering (default: enabled)
--extract-imagesInclude image URLs in output
--include-raw-htmlInclude raw HTML in output

Examples:

bash
# Standard fetch (JS rendering enabled)
python3 .claude/skills/web-fetch-linkup/fetch.py "https://example.com/article"

# Static page, faster
python3 .claude/skills/web-fetch-linkup/fetch.py "https://example.com" --no-render-js

# With images
python3 .claude/skills/web-fetch-linkup/fetch.py "https://example.com" --extract-images

Step 3: Parse the response

The script outputs JSON on stdout with:

  • url — The fetched URL
  • markdown — The extracted content in Markdown format
  • images — (only with --extract-images) List of image URLs
  • rawHtml — (only with --include-raw-html) Raw HTML source

Step 4: Save the content

Create a file in fetched-content/ with the format:

Filename: {domain}-{YYYYMMDD-HHmmss}.md

Structure:

markdown
---
source: <URL>
fetched_at: <ISO timestamp>
---

# <Title inferred from content>

<Extracted markdown content>

Step 5: Confirm

Inform the user of the created file path.

Exit codes

CodeMeaning
0Success
1.env missing or LINKUP_API_KEY not set
3401 — Invalid or expired API key
4429 — Rate limit exceeded
5Other HTTP error
6Network error (DNS, timeout, etc.)

Error handling

ErrorAction
Exit 1Check .claude/skills/web-fetch-linkup/.env exists with LINKUP_API_KEY
Exit 3API key is invalid or expired — get a new one at https://app.linkup.so
Exit 4Rate limit — wait before retrying
Exit 5Check stderr for HTTP status details
Exit 6Network issue — retry with --no-render-js if timeout

Usage examples

Fetch an article:

"Fetch the content of https://example.com/article"

Fetch documentation:

"Use linkup to scrape https://docs.example.com/api"

Dynamic page:

"Extract content from this React page: https://app.example.com/dashboard"