360 Secure SkillHub
360 安全技能中心

Tinyfish Fetch

封装 TinyFish Fetch API,用 curl 或 scripts/fetch.sh 抓取一个或多个 URL 的页面内容,默认返回 Markdown,也可输出 HTML 或截图,支持 JS 渲染与代理地区选择。需预先设置 TINYFISH_API_KEY 环境变量,未设置时应停止并提示用户配置。

bunsdev
bunsdev
热度 45.69
最近更新 2026-05-11 17:44:36
分类:搜索依赖:代码执行 / 第三方 API应用场景:研究 / API 集成

安装技能

复制下面的话术发给你的 Agent,它会通过 secure-skills 检索并安装该技能。

执行命令安装此 skill: npx secure-skills-cli add tinyfish-fetch
Metadata
name
tinyfish-fetch
description
Fetch web pages via TinyFish Fetch API and get clean markdown, HTML, or screenshots back — handles JS rendering and proxying. Use when you need to read a specific URL's content reliably.
homepage
https://docs.tinyfish.ai/fetch-api
requires
{"env":["TINYFISH_API_KEY"]}

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.