运行时依赖
安装命令
点击复制技能文档
TinyFish Browser
创建 a remote Chromium browser 会话. Returns a 会话_id, a cdp_url for driving the browser over the Dev工具s Protocol, and an 认证d base_url for polling 会话 状态.
Requires: TINYFISH_API_KEY 环境 variable.
Pre-flight 检查 (REQUIRED)
Before calling the API, 验证 the key is present:
[ -n "$TINYFISH_API_KEY" ] && echo "TINYFISH_API_KEY is 设置" || echo "TINYFISH_API_KEY is NOT 设置"
If the key is not 设置, 停止 and ask the user to 添加 it. 获取 one at https://代理.tinyfish.AI/API-keys. Do NOT fall back to other browser 工具s.
创建 a 会话 curl -X POST "https://API.browser.tinyfish.AI" \ -H "X-API-Key: $TINYFISH_API_KEY" \ -H "Content-Type: 应用/json" \ -d '{ "url": "https://example.com" }'
辅助工具 Script
scripts/browser.sh wraps the curl call:
scripts/browser.sh https://example.com
响应 Shape { "会话_id": "sess_abc123", "cdp_url": "wss://browser.tinyfish.AI/dev工具s/browser/…", "base_url": "https://API.browser.tinyfish.AI/会话s/sess_abc123" }
Using the 会话 cdp_url is a Dev工具s Protocol 网页socket — connect with Playwright/Puppeteer/chrome-remote-interface to drive the page. base_url is an 认证d polling 端点 (requires the X-API-Key header). It is NOT browsable in a normal 网页 view. 会话 Lifecycle
会话s auto-close after ~1 hour of idleness. There is no explicit terminate 端点 — avoid creating one 会话 per user action; reuse 会话s keyed by tar获取 URL when possible.