返回 Skill 列表
extension
分类: 数据与分析需要 API Key

Tinyfish Fetch

通过 TinyFish Fetch API 获取网页,返回干净的 Markdown、HTML 或截图,支持 JS 渲染和代理。适用于需要读取特定页面的场景。

person作者: bunsdevhubclawhub

TinyFish Fetch

Fetch one or more URLs via the TinyFish Fetch API. Returns rendered page content (markdown by default), optionally with screenshots, behind an optional proxy.

Requires: TINYFISH_API_KEY environment variable.

Pre-flight Check (REQUIRED)

Before calling the API, verify the key is present:

[ -n "$TINYFISH_API_KEY" ] && echo "TINYFISH_API_KEY is set" || echo "TINYFISH_API_KEY is NOT set"

If the key is not set, stop and ask the user to add it. Get one at https://agent.tinyfish.ai/api-keys. Do NOT fall back to other fetch tools.

Basic Fetch

curl -X POST "https://api.fetch.tinyfish.ai" \
  -H "X-API-Key: $TINYFISH_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "urls": ["https://example.com"],
    "format": "markdown"
  }'

format accepts markdown (default), html, or screenshot.

Multiple URLs

curl -X POST "https://api.fetch.tinyfish.ai" \
  -H "X-API-Key: $TINYFISH_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "urls": [
      "https://example.com",
      "https://example.org"
    ],
    "format": "markdown"
  }'

Proxy / Geo Targeting

curl -X POST "https://api.fetch.tinyfish.ai" \
  -H "X-API-Key: $TINYFISH_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "urls": ["https://example.com"],
    "format": "markdown",
    "proxy_config": { "country": "US" }
  }'

Helper Script

scripts/fetch.sh <url> [<url> ...] [--format markdown|html|screenshot] [--country CC] wraps the curl call:

scripts/fetch.sh https://example.com
scripts/fetch.sh https://example.com https://example.org --format html
scripts/fetch.sh https://example.com --format markdown --country US

Response Shape

{
  "results": [
    {
      "url": "https://example.com",
      "status": 200,
      "content": "# Example Domain\n\nThis domain is for use…",
      "format": "markdown"
    }
  ]
}

Read results[].content for the rendered page. Screenshot format returns base64-encoded PNG data.