clawby-data

Compare original and translation side by side

🇺🇸

Original

English
🇨🇳

Translation

Chinese

Clawby Data Analysis

Clawby 数据分析

Fetch real financial data through the Clawby aggregated data API and analyze it. The single source of truth for every interface — its params (required · format · example) and ⚠️ pitfalls — is
api/catalog/
(start at
api/catalog/_index.yaml
). Always read the relevant category yaml before calling.
The full machine catalog is
api/clawby.yaml
(server-generated, versioned).
Works with any AI agent — Claude Code, Codex, OpenClaw, Hermes, and anything that can run shell commands or call an HTTP API: just an API key + the catalog + plain
curl
.
通过 Clawby 聚合数据 API 获取真实金融数据并进行分析。每个接口的唯一事实来源——其参数(必填 · 格式 · 示例)和 ⚠️ 注意事项——是
api/catalog/
(从
api/catalog/_index.yaml
开始)。调用前务必阅读相关类别的 yaml。
完整的机器目录为
api/clawby.yaml
(由服务器生成,带版本)。
适用于任何 AI Agent——Claude Code、Codex、OpenClaw、Hermes,以及任何能够运行 shell 命令或调用 HTTP API 的工具:只需一个 API key + 目录 + 简单的
curl
。

Quick start

快速开始

bash
undefined
bash
undefined

1. Auth (once): sign in at https://www.openclawby.com/ → export CLAWBY_API_KEY=pk_xxx

1. Auth (once): sign in at https://www.openclawby.com/ → export CLAWBY_API_KEY=pk_xxx

2. Find the interface in api/catalog/<category>/ (routing table below)

2. Find the interface in api/catalog/<category>/ (routing table below)

3. Call it:

3. Call it:

curl -s -X POST https://api.openclawby.com/api/relay
-H "X-API-Key: $CLAWBY_API_KEY" -H "Content-Type: application/json"
-d '{"name":"<interface name from catalog>","params":{ ... }}'
curl -s -X POST https://api.openclawby.com/api/relay
-H "X-API-Key: $CLAWBY_API_KEY" -H "Content-Type: application/json"
-d '{"name":"<interface name from catalog>","params":{ ... }}'

→ {source, data, credits:{remaining,used_total}}

→ {source, data, credits:{remaining,used_total}}

undefined
undefined

Core workflow · Gather ALL available data first, then analyze

核心工作流 · 先收集所有可用数据,再进行分析

Completeness is the goal. A thin answer from a single source is a failure even when correct — go broad first, analyze second. Apply this to every request.
  1. Turn the request into a data checklist. Ask "what would a thorough analyst pull?" and list every relevant dimension. Over-collect on purpose (a stock → quote, short data, dark pool, options, financials, sentiment, peers; a token → DEX price/liquidity, holders, funding & OI, odds, social buzz).
  2. For each item, sweep ALL FOUR source layers — never stop at the first hit:
    • Layer 1 — Clawby data (
      /api/relay
      ): scan the catalog for every interface that touches the item and call them all. Primary, authoritative.
    • Layer 2 — Local akshare (
      akdata/
      , read-only): China markets (A-shares · HK · futures · convertible bonds · ETFs · boards · northbound flows · dragon-tiger list · shareholder data) and global macro (CPI · non-farm · PMI · rate decisions) — 1080 interfaces Layer 1 does not carry. Runs locally on the user's machine with no Clawby key and no credits. Guide:
      akdata/akshare.md
      .
    • Layer 3 — Execution connectors (
      exec/
      , read-only use): the Binance / Bitget / OKX / Polymarket CLIs expose market data, order books, funding, smart-money and news the other layers may not have. Read-only needs no confirmation.
    • Layer 4 — Your own web access: news, filings, official docs, macro context — fill every remaining gap.
  3. Maximize coverage. If two layers supply the same metric, fetch both and cross-check. Fire independent fetches in parallel. Never skip a reachable source.
  4. Track coverage, then analyze. Ground every claim in collected data; if a source failed, say so instead of silently dropping the dimension.
  5. Offer a formal report when it fits — for substantial asset analysis, offer a professional PDF research report (see Professional analysis reports). Ask first.
目标是保证完整性。 即使答案正确,如果只依赖单一来源也属于失败——先广泛收集,再进行分析。必须对每个请求遵循此原则。
  1. 将请求转化为数据检查清单。 询问:“一名严谨的分析师会拉取哪些数据?”并列出所有相关维度。刻意进行过度收集(股票 → 行情、空头数据、暗池、期权、财务数据、情绪、同行;代币 → DEX 价格/流动性、持有者、资金费率与 OI、赔率、社交热度)。
  2. 针对每个项目扫描全部四个来源层——绝不要在首次命中后停止:
    • 第 1 层——Clawby 数据(
      /api/relay
      ):扫描目录,查找所有与该项目相关的接口并全部调用。这是主要且权威的数据源。
    • 第 2 层——本地 akshare(
      akdata/
      ,只读):中国市场(A 股 · 港股 · 期货 · 可转债 · ETF · 板块 · 北向资金 · 龙虎榜 · 股东数据)和全球宏观数据(CPI · 非农 · PMI · 利率决议)——包含 1080 个第 1 层未覆盖的接口。在用户机器上本地运行,无需 Clawby key,也不消耗 credits。使用指南:
      akdata/akshare.md
      。
    • 第 3 层——执行连接器(
      exec/
      ,只读使用):Binance / Bitget / OKX / Polymarket CLI 提供其他层可能没有的市场数据、订单簿、资金费率、智能资金和新闻。只读操作无需确认。
    • 第 4 层——你自己的 Web 访问能力:新闻、文件、官方文档、宏观背景——填补所有剩余空白。
  3. 最大化覆盖范围。 如果两个来源层提供同一指标,则同时获取并交叉验证。并行发起相互独立的请求。绝不要跳过任何可访问的来源。
  4. 追踪覆盖情况,然后进行分析。 每项结论都必须以已收集的数据为依据;如果某个来源失败,应明确说明,而不是悄然丢弃相应维度。
  5. 在适合时提供正式报告——对于全面的资产分析,可提供专业 PDF 研究报告(参见专业分析报告)。先征求用户同意。

Skill structure

Skill 结构

clawby-data/
├── SKILL.md            ← this file (managed — refreshed on update; re-read after updating)
├── update-protocol.md  ← first-run + update rules (read at Step 0)
├── manifest.json       ← version + managed file list
├── api/
│   ├── catalog/        ← per-category interface docs (params + gotchas) — READ before calling
│   ├── clawby.yaml     ← full machine catalog (all interfaces)
│   └── index.yaml      ← catalog registry
├── akdata/             ← local akshare executor: China markets + global macro; guide akdata/akshare.md
├── exec/               ← trade-execution connectors; registry exec/index.yaml
├── script/             ← connector helpers: baw/ (fast one-shot scripts) + 42space/ (42.space automated trading); see each dir's README
├── rpc/                ← BYOK RPC (EVM + non-EVM; Ankr/Alchemy/BlockPI) using the user's OWN key — or a NO-KEY public endpoint for 8 chains; registry rpc/index.yaml
├── social/             ← BYOK social & search (Desearch, TwexAPI) using the user's OWN key; registry social/index.yaml
├── llm/                ← BYOK LLM APIs (DeepSeek/OpenAI/Claude/Qwen/Kimi/GLM/OpenRouter) using the user's OWN key; registry llm/index.yaml
├── defi/               ← DeFi connectors: LI.FI cross-chain bridge/swap quotes + Earn yield (key OPTIONAL — no-key tier); registry defi/index.yaml
├── custom/             ← BYOK for user-defined vault providers; first use records the API into local/custom-apis/ for quick reuse; registry custom/index.yaml
├── account/            ← account self-service (email login → key · usage · Key Vault management) via /api/self/*; registry account/index.yaml
├── report/             ← PDF report guide + stylesheet
├── data/               ← misc reference data
└── local/              ← local state / caches; the ONLY folder preserved across updates
clawby-data/
├── SKILL.md            ← this file (managed — refreshed on update; re-read after updating)
├── update-protocol.md  ← first-run + update rules (read at Step 0)
├── manifest.json       ← version + managed file list
├── api/
│   ├── catalog/        ← per-category interface docs (params + gotchas) — READ before calling
│   ├── clawby.yaml     ← full machine catalog (all interfaces)
│   └── index.yaml      ← catalog registry
├── akdata/             ← local akshare executor: China markets + global macro; guide akdata/akshare.md
├── exec/               ← trade-execution connectors; registry exec/index.yaml
├── script/             ← connector helpers: baw/ (fast one-shot scripts) + 42space/ (42.space automated trading); see each dir's README
├── rpc/                ← BYOK RPC (EVM + non-EVM; Ankr/Alchemy/BlockPI) using the user's OWN key — or a NO-KEY public endpoint for 8 chains; registry rpc/index.yaml
├── social/             ← BYOK social & search (Desearch, TwexAPI) using the user's OWN key; registry social/index.yaml
├── llm/                ← BYOK LLM APIs (DeepSeek/OpenAI/Claude/Qwen/Kimi/GLM/OpenRouter) using the user's OWN key; registry llm/index.yaml
├── defi/               ← DeFi connectors: LI.FI cross-chain bridge/swap quotes + Earn yield (key OPTIONAL — no-key tier); registry defi/index.yaml
├── custom/             ← BYOK for user-defined vault providers; first use records the API into local/custom-apis/ for quick reuse; registry custom/index.yaml
├── account/            ← account self-service (email login → key · usage · Key Vault management) via /api/self/*; registry account/index.yaml
├── report/             ← PDF report guide + stylesheet
├── data/               ← misc reference data
└── local/              ← local state / caches; the ONLY folder preserved across updates

Your own RPC / social / LLM keys via the Key Vault (BYOK)

通过 Key Vault 使用你自己的 RPC / 社交 / LLM 密钥(BYOK)

rpc/
lets you make EVM JSON-RPC calls with the user's own Ankr / Alchemy / BlockPI node key, fetched at run time from the Clawby Key Vault. These calls go straight to the provider — not through Clawby
/api/relay
, and they do NOT use Clawby credits
.
Flow: fetch the key once (
GET https://api.openclawby.com/api/vault/<provider>
with
CLAWBY_API_KEY
; if the user set a trusted-IP whitelist, this machine's public IP must be on it, and their vault retrieval switch must be ON) → keep it in memory only, never write it to disk → build the provider's endpoint URL and POST JSON-RPC. Start at
rpc/index.yaml
(auth flow + JSON-RPC primer + file map + security). Per-provider endpoint template, full chain/network lists and enhanced methods:
rpc/<provider>.md
(ankr/alchemy/blockpi). The complete standard EVM JSON-RPC method catalog (params + request/response for eth_/net_/web3_/trace_/debug_*):
rpc/evm-methods.md
. Non-EVM chains — Solana, TRON, TON, Sui, XRP, Aptos, NEAR — each have their own method guide in
rpc/non-evm/
. The fetched key sits inside the endpoint URL, so treat the whole URL as a secret. No key for a chain?
rpc/index.yaml
→
public_fallback
has a built-in no-key public endpoint for 8 chains — BSC, ETH, Base, Arbitrum, X Layer, Robinhood, Solana, Tron — used automatically when the vault has no key (no credits; rate-limited, so prefer a vaulted key for heavy/archive reads).
Social & search data uses the same vault pattern —
social/
holds BYOK connectors for social/search providers: Desearch (
social/desearch/
— X/Twitter, TikTok, Facebook, Instagram, Web/SERP, AI search, People search; raw
Authorization
key) and TwexAPI (
social/twexapi/
— deep X/Twitter: advanced search, users, tweets/replies, followers & following, communities, lists, trending, sentiment;
Authorization: Bearer
token). Fetch the user's key from
/api/vault/<provider>
, call the provider directly (billed to the user's own provider plan — never Clawby credits), and start at
social/index.yaml
(each provider's
_index.yaml
carries its base URL, auth and file map).
LLM APIs use the same vault pattern —
llm/
holds BYOK connectors for DeepSeek, OpenAI, Claude (Anthropic), Qwen, Kimi, GLM and OpenRouter. Fetch the user's key from
/api/vault/<provider>
, then call the model API directly (billed to the user's own LLM plan — never Clawby credits). Six are OpenAI-compatible (shared
POST {base}/chat/completions
spec — streaming, tools, params — in
llm/index.yaml
); Claude uses the Anthropic Messages API (
llm/claude.md
). Per-provider base URL + current model ids + quirks:
llm/<provider>.md
.
DeFi / cross-chain uses the same vault pattern, but the key is OPTIONAL —
defi/
holds connectors for on-chain DeFi protocols. LI.FI (
defi/lifi/
) is a cross-chain bridge & DEX aggregator across 65+ EVM chains + Solana: best-route swap/bridge quotes that return a signable transaction, transfer-status tracking, chain/token/tool discovery, and a DeFi yield (Earn) API for vaults and a wallet's positions. It works with no key (public rate limits) or with the user's own LI.FI key from the vault (slug
lifi
). Quotes/data are read-only; to execute a returned transaction, sign it with the user's wallet via
exec/baw
(risk: high — confirm). Start at
defi/index.yaml
→
defi/lifi/_index.yaml
→
defi/lifi/overview.md
.
Custom / user-defined providers — for any key the user stored under the vault's "custom" entry (their own slug + field names), follow
custom/index.yaml
: on first use, look up that provider's API doc and record how to call it into
local/custom-apis/<slug>.md
(local/ persists across updates), then reuse that note next time instead of re-researching.
rpc/
允许使用用户自己的 Ankr / Alchemy / BlockPI 节点密钥发起 EVM JSON-RPC 调用。密钥在运行时从 Clawby Key Vault 获取。这些调用会直接连接到服务商——不会经过 Clawby
/api/relay
,也不消耗 Clawby credits
。
流程:先获取一次密钥(
GET https://api.openclawby.com/api/vault/<provider>
,并带上
CLAWBY_API_KEY
;如果用户设置了可信 IP 白名单,则本机的公网 IP 必须位于其中,同时用户必须开启 vault 检索开关)→ 仅在内存中保存,绝不写入磁盘→ 构造服务商 endpoint URL 并发送 POST JSON-RPC 请求。从
rpc/index.yaml
开始(认证流程 + JSON-RPC 入门 + 文件映射 + 安全说明)。每个服务商的 endpoint 模板、完整链/网络列表及增强方法:
rpc/<provider>.md
(ankr/alchemy/blockpi)。完整的标准 EVM JSON-RPC 方法目录(参数与请求/响应示例,涵盖
eth_*
/
net_*
/
web3_*
/
trace_*
/
debug_*
):
rpc/evm-methods.md
。非 EVM 链——Solana、TRON、TON、Sui、XRP、Aptos、NEAR——各自有方法指南,位于
rpc/non-evm/
。获取的密钥位于 endpoint URL 内部,因此应将整个 URL 视为机密。某条链没有密钥?
rpc/index.yaml
→
public_fallback
内置了适用于 8 条链的免密钥公共 endpoint——BSC、ETH、Base、Arbitrum、X Layer、Robinhood、Solana、Tron——当 vault 中没有密钥时会自动使用(不消耗 credits;存在速率限制,因此大量读取或归档查询时优先使用 vault 中的密钥)。
社交与搜索数据采用相同的 vault 模式——
social/
存放使用用户自有密钥的 BYOK 社交/搜索服务商:Desearch(
social/desearch/
——X/Twitter、TikTok、Facebook、Instagram、Web/SERP、AI search、People search;使用原始
Authorization
key)和 TwexAPI(
social/twexapi/
——深度 X/Twitter:高级搜索、用户、推文/回复、粉丝与关注、社区、列表、热门内容、情绪;使用
Authorization: Bearer
token)。从
/api/vault/<provider>
获取用户密钥,然后直接调用服务商(费用计入用户自己的服务商套餐——绝不消耗 Clawby credits),并从
social/index.yaml
开始(每个服务商的
_index.yaml
包含 base URL、认证方式和文件映射)。
LLM API采用相同的 vault 模式——
llm/
存放使用用户自有密钥的 BYOK 连接器:DeepSeek、OpenAI、Claude(Anthropic)、Qwen、Kimi、GLM 和 OpenRouter。从
/api/vault/<provider>
获取用户密钥,然后直接调用模型 API(费用计入用户自己的 LLM 套餐——绝不消耗 Clawby credits)。其中六个兼容 OpenAI(共享
POST {base}/chat/completions
规范——streaming、tools、params;见
llm/index.yaml
);Claude 使用 Anthropic Messages API(见
llm/claude.md
)。每个服务商的 base URL、当前 model id 和注意事项:
llm/<provider>.md
。
DeFi / 跨链采用相同的 vault 模式,但密钥可选——
defi/
存放链上 DeFi 协议连接器。LI.FI(
defi/lifi/
)是覆盖 65+ EVM 链和 Solana 的跨链桥与 DEX 聚合器:最佳路径 swap/bridge 报价会返回可签名交易,并提供交易状态跟踪、链/代币/工具发现,以及 DeFi 收益(Earn)API,可查询金库和钱包持仓。它支持免密钥使用(受公共速率限制),也可使用用户自己的 LI.FI 密钥(vault slug 为
lifi
)。报价和数据操作均为只读;若要执行返回的交易,应使用
exec/baw
通过用户钱包签名(风险:高——必须确认)。从
defi/index.yaml
→
defi/lifi/_index.yaml
→
defi/lifi/overview.md
开始。
自定义/用户定义服务商——对于用户存储在 vault“自定义”条目下的任意密钥(用户自己的 slug 和字段名),遵循
custom/index.yaml
:首次使用时,查找该服务商的 API 文档,并将调用方式记录到
local/custom-apis/<slug>.md
(
local/
会在更新后保留),之后直接复用该说明,无需重复研究。

Account self-service (manage the user's Clawby account)

账户自助服务(管理用户自己的 Clawby 账户)

account/
lets you manage the user's own Clawby account from the agent — everything scoped to the caller's own key, never cross-account. If there is no
CLAWBY_API_KEY
(or
GET /api/account
returns 401), bootstrap it: email the user a code (
POST /api/account/email-code
), exchange it for their key (
POST /api/account/email-login
), and keep the key in memory only. Then read the account (
GET /api/account
→ plan, membership, EVM wallet, email; usage via
GET /api/self/usage
) and manage the Key Vault — add/edit/delete interface keys, the trusted-IP whitelist, the retrieval master switch — via
/api/self/*
. Full flow + endpoints:
account/index.yaml
; vault management:
account/vault.md
. Confirm with the user before any destructive change (deleting a key or IP, turning retrieval off).
account/
允许 Agent 管理用户自己的 Clawby 账户——所有操作仅限于调用者自己的 key,绝不访问其他账户。如果没有
CLAWBY_API_KEY
(或
GET /api/account
返回 401),则进行初始化:向用户邮箱发送验证码(
POST /api/account/email-code
),用验证码换取密钥(
POST /api/account/email-login
),并且仅在内存中保存密钥。随后读取账户信息(
GET /api/account
→ 套餐、会员权益、EVM 钱包、邮箱;用量通过
GET /api/self/usage
查询),并通过
/api/self/*
管理 Key Vault——添加/编辑/删除接口密钥、可信 IP 白名单、检索总开关。完整流程与 endpoint:
account/index.yaml
;vault 管理:
account/vault.md
。任何破坏性变更前必须向用户确认(删除密钥或 IP、关闭检索功能)。

Step 0 · First use in a session

第 0 步 · 会话中的首次使用

  1. Check the user's plan & balance (free call):
    curl -s https://api.openclawby.com/api/account -H "X-API-Key: $CLAWBY_API_KEY"
    →
    {plan, payg_balance, rate_per_min, accessible_providers, free_providers, rate_per_sec}
    (
    rate_per_sec
    = the per-API-key per-second request limit, default 5).
  2. Version check (≤ once per 24h), then ASK — follow
    update-protocol.md
    : if
    manifest.json
    is older than 24h, compare the remote version; on a difference ask the user before updating. Never auto-update. Updates refresh every file except
    local/
    — including this SKILL.md (re-read it afterward).
  3. Executor CLIs install lazily — do NOT install anything up front. Only when the user first asks to trade on a venue, check/install that one connector (see
    update-protocol.md
    Step A).
  1. 检查用户套餐与余额(免费调用):
    curl -s https://api.openclawby.com/api/account -H "X-API-Key: $CLAWBY_API_KEY"
    →
    {plan, payg_balance, rate_per_min, accessible_providers, free_providers, rate_per_sec}
    (
    rate_per_sec
    = 每个 API key 每秒的请求限制,默认值为 5)。
  2. 版本检查(每 24 小时最多一次),然后询问——遵循
    update-protocol.md
    :如果
    manifest.json
    已超过 24 小时未更新,则比较远程版本;发现差异时,更新前先询问用户。绝不自动更新。更新会刷新除
    local/
    以外的所有文件——包括
    SKILL.md
    (更新后需重新读取)。
  3. 按需延迟安装执行器 CLI——不要预先安装任何内容。只有当用户首次要求在某个场所交易时,才检查并安装对应的连接器(参见
    update-protocol.md
    中的步骤 A)。

Auth

认证

  • Base URL:
    https://api.openclawby.com
    ; send the key in the
    X-API-Key
    header.
  • Read the key from the
    CLAWBY_API_KEY
    env var. If unset, the user has no key — tell them to sign in at https://www.openclawby.com/ (free) and
    export CLAWBY_API_KEY=pk_xxx
    .
    Never invent a key.
  • Base URL:
    https://api.openclawby.com
    ;通过
    X-API-Key
    请求头发送密钥。
  • 从
    CLAWBY_API_KEY
    环境变量读取密钥。如果未设置,则用户没有密钥——告知用户登录 https://www.openclawby.com/(免费)并执行
    export CLAWBY_API_KEY=pk_xxx
    。
    绝不虚构密钥。

Symbol formats

标的格式

  • Stocks:
    US:TICKER
    (GME →
    US:GME
    ) · Crypto:
    BASE:USD
    (BTC →
    BTC:USD
    ) · Forex:
    BASE:USD
    (
    EUR:USD
    )
  • 股票:
    US:TICKER
    (GME →
    US:GME
    )· 加密货币:
    BASE:USD
    (BTC →
    BTC:USD
    )· 外汇:
    BASE:USD
    (
    EUR:USD
    )

Locate an interface

定位接口

Pick the category from the Routing table below (the full category list is
api/catalog/_index.yaml
), then open that category's yaml — it lists every interface with its params and ⚠️ gotchas — and ALWAYS read it before calling. The complete machine-readable list of all interfaces is
api/clawby.yaml
.
从下方路由表中选择类别(完整类别列表见
api/catalog/_index.yaml
),然后打开该类别的 yaml——其中列出了每个接口的参数和 ⚠️ 注意事项——调用前务必阅读。完整的机器可读接口列表位于
api/clawby.yaml
。

Routing table — which catalog file answers which need

路由表——哪个目录文件可满足对应需求

Interface details (params + ⚠️ gotchas) live in the catalog file — read it, then call via
/api/relay
:
NeedInterface prefixCatalog
US equities: quotes · candles · short interest/volume · borrow fee · FTDs · dark pool · options chain/max-pain · Reddit mentions · screener · dividends/splits(various)
api/catalog/equities/
Crypto derivatives (cross-exchange): funding · open interest · liquidations · long/short ratios · taker volume · ETF flows · market indicators (fear&greed, RSI…) · whale/exchange reserves
funding_*
open_interest_*
liquidation_*
etf_*
…
api/catalog/derivatives/
Hyperliquid perps: mids · contexts (funding/OI/mark) · order book · candles · a wallet's positions/fills
hyperliquid_*
api/catalog/perps/
Prediction markets / betting odds (Polymarket)
polymarket_*
api/catalog/prediction-markets/
Address labels (who owns an address) · AML risk score · address profile/trace/counterparties
address_*
api/catalog/address-intel/
DEX pairs & token market data, any chain (DexScreener)
dexscreener_*
api/catalog/dex/
On-chain DEX/memecoin intel: security audit · holders/traders PnL · trending · smart-money/KOL · signals · new launches · swap quotes (read-only)
dex_*
api/catalog/dex-trading/
US company financials & SEC filings
sec_*
api/catalog/filings/
Mobula on-chain wallet / token / market data (80+ chains) — Pro-only
mobula_*
api/catalog/mobula/
Cross-interface mini-flows (details in the catalog):
  • SEC:
    sec_cik_lookup
    (ticker→10-digit CIK) first →
    sec_company_concept
    (
    cik
    + us-gaap
    concept
    , e.g.
    Revenues
    ,
    NetIncomeLoss
    ,
    EarningsPerShareDiluted
    ) per line item → assemble by period (
    fy
    /
    fp
    /
    form
    ). Filings/profile:
    sec_submissions
    .
  • Polymarket:
    polymarket_events
    /
    polymarket_markets
    → read
    clobTokenIds
    → per token id
    polymarket_price
    /
    midpoint
    /
    orderbook
    (a 0–1 price = implied probability); history via
    polymarket_price_history
    .
  • Routing rule — queries vs execution: all read-only DEX/memecoin lookups go through
    dex_*
    relay interfaces; to execute (swap, TP/SL orders, launch) use
    exec/gmgn/
    . Same split everywhere: data via relay, execution via
    exec/
    .
接口详情(参数 + ⚠️ 注意事项)位于目录文件中——阅读后再通过
/api/relay
调用:
需求接口前缀目录
美国股票:行情 · K 线 · 空头持仓/成交量 · 借券费 · FTD · 暗池 · 期权链/max pain · Reddit 提及 · 筛选器 · 股息/拆股(各种)
api/catalog/equities/
加密货币衍生品(跨交易所):资金费率 · 未平仓量 · 清算 · 多空比 · 主动成交量 · ETF 资金流 · 市场指标(恐惧与贪婪、RSI 等)· 巨鲸/交易所储备
funding_*
open_interest_*
liquidation_*
etf_*
…
api/catalog/derivatives/
Hyperliquid 永续合约:中间价 · contexts(资金费率/OI/标记价)· 订单簿 · K 线 · 钱包持仓/成交
hyperliquid_*
api/catalog/perps/
预测市场/投注赔率(Polymarket)
polymarket_*
api/catalog/prediction-markets/
地址标签(地址归属)· AML 风险评分 · 地址画像/追踪/交易对手
address_*
api/catalog/address-intel/
任意链的 DEX 交易对与代币市场数据(DexScreener)
dexscreener_*
api/catalog/dex/
链上 DEX/Memecoin 情报:安全审计 · 持有者/交易者 PnL · 热门项目 · 智能资金/KOL · 信号 · 新项目 · swap 报价(只读)
dex_*
api/catalog/dex-trading/
美国公司财报与 SEC 文件
sec_*
api/catalog/filings/
Mobula 链上钱包/代币/市场数据(80+ 链)——仅限 Pro
mobula_*
api/catalog/mobula/
跨接口迷你流程(详情见目录):
  • SEC:先调用
    sec_cik_lookup
    (ticker→10 位 CIK),然后对每个报表项目调用
    sec_company_concept
    (
    cik
    + us-gaap
    concept
    ,例如
    Revenues
    、
    NetIncomeLoss
    、
    EarningsPerShareDiluted
    ),再按期间(
    fy
    /
    fp
    /
    form
    )组装。文件/资料:
    sec_submissions
    。
  • Polymarket:
    polymarket_events
    /
    polymarket_markets
    → 读取
    clobTokenIds
    → 对每个 token id 调用
    polymarket_price
    /
    midpoint
    /
    orderbook
    (0–1 的价格 = 隐含概率);历史数据通过
    polymarket_price_history
    获取。
  • 路由规则——查询与执行分离:所有只读 DEX/Memecoin 查询都通过
    dex_*
    relay 接口;如需执行(swap、止盈/止损单、项目创建),则使用
    exec/gmgn/
    。其他场景也遵循相同规则:数据通过 relay 获取,执行通过
    exec/
    完成。

China markets & global macro (akdata/ — runs locally)

中国市场与全球宏观数据(akdata——本地运行)

akdata/
wraps the akshare Python library on the user's own machine: 1080 read-only interfaces for A-shares, HK, CN futures & options, convertible bonds, ETFs & funds, industry/concept boards, northbound (Stock Connect) flows, the dragon-tiger list, shareholder data, and global macro. No Clawby key, no credits. Full guide:
akdata/akshare.md
— read it before the first call.
bash
P=~/.clawby/akvenv/bin/python; cd akdata
$P ak.py doctor                           # first use in a session (see below)
$P ak.py find 龙虎榜                       # locate an interface (Chinese or English)
$P ak.py doc stock_lhb_detail_em           # params + formats + gotchas — ALWAYS read first
$P ak.py call stock_lhb_detail_em --start_date 20260701 --end_date 20260710 --rows 30
Routing — which layer owns which asset:
AskUse
US equities · options · dark pool · short interestLayer 1 relay (faster, maintained)
crypto · DEX · on-chain · prediction markets · socialLayer 1 relay
A-shares · HK · CN futures · convertible bonds · ETFs
akdata/
dragon-tiger list · northbound flows · limit-up pool · shareholder counts
akdata/
(relay has no equivalent)
global macro: CPI · non-farm · PMI · rate decisions
akdata/
(relay has no equivalent)
Prefer the relay wherever both can answer — akshare mirrors public Chinese websites and breaks when they change layout.
akdata/
also needs a local akshare install (lazy:
python3 -m venv ~/.clawby/akvenv && ~/.clawby/akvenv/bin/pip install akshare
, ~20 s) and network reach to Chinese sources.
ak.py doctor
reports both, and probes every upstream host twice — through the proxy and direct — so you can tell whether to add
--no-proxy
for a given host. Large results: default budget is 30 rows / 20 000 chars, then use
--summary
or
--out data.csv
.
akdata/
在用户自己的机器上封装 akshare Python 库:提供 1080 个只读接口,覆盖 A 股、港股、中国期货与期权、可转债、ETF 与基金、行业/概念板块、北向(沪深港通)资金、龙虎榜、股东数据以及全球宏观数据。无需 Clawby key,不消耗 credits。完整指南:
akdata/akshare.md
——首次调用前务必阅读。
bash
P=~/.clawby/akvenv/bin/python; cd akdata
$P ak.py doctor                           # first use in a session (see below)
$P ak.py find 龙虎榜                       # locate an interface (Chinese or English)
$P ak.py doc stock_lhb_detail_em           # params + formats + gotchas — ALWAYS read first
$P ak.py call stock_lhb_detail_em --start_date 20260701 --end_date 20260710 --rows 30
路由——每类资产由哪一层负责:
需求使用方式
美国股票 · 期权 · 暗池 · 空头持仓第 1 层 relay(更快,且有维护)
加密货币 · DEX · 链上数据 · 预测市场 · 社交数据第 1 层 relay
A 股 · 港股 · 中国期货 · 可转债 · ETF
akdata/
龙虎榜 · 北向资金 · 涨停板池 · 股东户数
akdata/
(relay 没有对应接口)
全球宏观数据:CPI · 非农 · PMI · 利率决议
akdata/
(relay 没有对应接口)
当两层都能回答时,优先使用 relay——akshare 只是镜像中国公共网站,网站布局变化时容易失效。
akdata/
还需要在本地安装 akshare(按需安装:
python3 -m venv ~/.clawby/akvenv && ~/.clawby/akvenv/bin/pip install akshare
,约 20 秒),并需要能够访问中国来源。
ak.py doctor
会检查以上条件,并分别通过代理和直连探测每个上游主机两次,从而判断是否需要为特定主机添加
--no-proxy
。大型结果:默认预算是 30 行/20 000 字符,然后使用
--summary
或
--out data.csv
。

Trade execution (exec/)

交易执行(exec/)

Everything above is read-only data. To place trades, use the connectors under
exec/
(registry:
exec/index.yaml
; per-venue guide = each
entry
file). They run locally with the user's own keys — never routed through Clawby:
VenueGuideTool
Binance (spot/futures/margin/options/earn)
exec/binance/binance.md
binance-cli
Bitget (spot/margin/futures UTA,
--paper-trading
)
exec/bitget/bitget.md
bgc
OKX (spot/swap/futures/bots,
--demo
)
exec/okx/okx.md
okx
Polymarket (CLOB V2 orders, own wallet key)
exec/polymarket/polymarket.md
@polymarket/client
SDK
GMGN (on-chain swap/TP-SL/launch, 9 chains)
exec/gmgn/gmgn.md
gmgn-cli
Binance Agentic Wallet (on-chain Web3: swap/send/limit/DeFi/prediction/x402)
exec/baw/baw.md
baw
Rule for any
risk: high
action
(order / transfer / withdrawal): restate the order — venue · pair · side · size · price type — show the exact command, get the user to type
CONFIRM
, prefer testnet when unsure. Read-only queries need no confirmation.
以上内容均为只读数据。如需下单交易,请使用
exec/
下的连接器(注册表:
exec/index.yaml
;每个场所的指南 = 对应
entry
文件)。它们在本地运行,使用用户自己的密钥——绝不通过 Clawby 路由:
场所指南工具
Binance(现货/期货/杠杆/期权/earn)
exec/binance/binance.md
binance-cli
Bitget(现货/杠杆/期货 UTA,
--paper-trading
)
exec/bitget/bitget.md
bgc
OKX(现货/swap/期货/机器人,
--demo
)
exec/okx/okx.md
okx
Polymarket(CLOB V2 订单,使用自己的钱包密钥)
exec/polymarket/polymarket.md
@polymarket/client
SDK
GMGN(链上 swap/止盈止损/项目创建,支持 9 条链)
exec/gmgn/gmgn.md
gmgn-cli
Binance Agentic Wallet(链上 Web3:swap/send/limit/DeFi/prediction/x402)
exec/baw/baw.md
baw
任何
risk: high
操作的规则
(订单/转账/提现):重述订单——场所 · 交易对 · 方向 · 数量 · 价格类型——展示准确的命令,要求用户输入
CONFIRM
,不确定时优先使用测试网。只读查询无需确认。

42.space automated trading (script/42space/)

42.space 自动化交易(script/42space/)

When the user says "42space", read
script/42space/README.md
— the full host-agent playbook — and follow it. It automates prediction-market trading on 42.space (BNB Smart Chain): wallet-only login (import mnemonic · create a wallet · BN AI wallet/baw) → balance check → silent Clawby identity (API key + free Identity SBT) → one of three trading modes. Runs locally (needs Node ≥18 + ethers —
cd script/42space && npm install
; run the commands from that folder); wallet secrets stay in
local/42space.json
(chmod 600), never routed through Clawby.
StepCommands
Status / log in
node 42space.mjs status
·
import-mnemonic
(phrase on stdin) ·
create-wallet
·
use-baw <address>
Balance
node 42space.mjs balance
→
{address, usdt, bnb, needs_funding, bnb_status}
— USDT ≤ 10 → deposit USDT (BSC only);
bnb_status
none
= 0 BNB → stop and wait for BNB, never trade
Identity (silent)
node 42space.mjs identity
(add
--dry-run
to preview) — Clawby key (
CLAWBY_API_KEY
env wins, else fetched with the wallet) + auto-mints the free Identity SBT when missing (needs BNB, else skipped
no_bnb
) + silently binds the 42 invite code (once per wallet);
key_ok: false
blocks the AI modes
Fast mode — volume farming, no LLM
node daemon.mjs fast --amount 1 --target <volume> [--slippage 3] [--approve-max] [--live]
— cheapest market under 3% round-trip cost, atomic buy+sell, until the target volume
AI one-shot — you do the reasoning
node 42space.mjs ai-data --market <42.space link or 0x address>
(or
--all [--fields a,b]
) → pick with the README's win-rate rubric →
node trade.mjs buy <market> <tokenId> 5
(dry first, then add
--live
) →
node trade.mjs set-operator <market> --live
→ hold
Take-profit — auto-exit at +X%
node daemon.mjs take-profit [--pct 50] [--interval 30] [--live]
— watch the positions a live
buy
recorded and sell each once it is up ≥ X% (default 50) instead of holding to settlement; DRY without
--live
Claim settled wins
node 42space.mjs claim-settled [--live]
Manual on-chain
node trade.mjs
quote
/
buy
/
sell
/
roundtrip
/
set-operator
/
claim
/
status
Everything is DRY unless
--live
: run the dry command first, show the user the quoted numbers, and get their go-ahead before any
--live
. AI picks put real money at risk, and a market's price is not a probability.
当用户提到 “42space” 时,阅读
script/42space/README.md
——这是完整的 host-agent 操作手册——并遵循其中说明。它在 BNB Smart Chain 上自动执行预测市场交易:仅钱包登录(导入助记词 · 创建钱包 · BN AI wallet/baw)→ 余额检查 → 静默 Clawby 身份验证(API key + 免费 Identity SBT)→ 从三种交易模式中选择一种。它在本地运行(需要 Node ≥18 + ethers——执行
cd script/42space && npm install
;从该目录运行命令);钱包机密始终保存在
local/42space.json
(chmod 600),绝不通过 Clawby 路由。
步骤命令
状态/日志登录
node 42space.mjs status
·
import-mnemonic
(通过 stdin 输入短语)·
create-wallet
·
use-baw <address>
余额
node 42space.mjs balance
→
{address, usdt, bnb, needs_funding, bnb_status}
——USDT ≤ 10 → 充值 USDT(仅限 BSC);
bnb_status
none
= 0 BNB → 停止并等待 BNB,绝不交易
身份验证(静默)
node 42space.mjs identity
(添加
--dry-run
可先预览)——Clawby key(优先使用
CLAWBY_API_KEY
环境变量,否则通过钱包获取)+ 自动铸造免费 Identity SBT(缺少 BNB 时跳过,并显示
bnb_needs_bnb
)→ 静默绑定 42 邀请码(每个钱包仅一次);
key_ok: false
会阻止 AI 模式
快速模式——刷成交量,不使用 LLM
node daemon.mjs fast --amount 1 --target <volume> [--slippage 3] [--approve-max] [--live]
——选择往返成本低于 3% 的最便宜市场,执行原子化买入+卖出,直到达到目标成交量
AI 单次模式——由你进行推理
node 42space.mjs ai-data --market <42.space link or 0x address>
(或
--all [--fields a,b]
)→ 按 README 中的胜率标准选择 →
node trade.mjs buy <market> <tokenId> 5
(先 dry run,再添加
--live
)→
node trade.mjs set-operator <market> --live
→ 持仓
止盈——达到 X% 后自动退出
node daemon.mjs take-profit [--pct 50] [--interval 30] [--live]
——监视 AI 模式记录在案的
buy
交易持仓,当某个持仓上涨达到指定阈值(默认 50%)时退出(默认为 DRY 模式,不添加
--live
)
领取已结算赢款
node trade.mjs claim-settled [--live]
手动链上操作
node trade.mjs
quote
/
buy
/
sell
/
roundtrip
/
set-operator
/
claim
/
status
除非添加
--live
,否则所有操作均为 DRY:先运行 dry 命令,向用户展示报价数字,获得用户同意后才能执行任何
--live
操作。AI 选出的交易会让真实资金面临风险,而且市场价格并不等于概率。

Key gotchas (highest-frequency; the full list lives in each catalog file)

关键注意事项(最高频问题;完整列表位于各目录文件中)

  • Dark pool needs
    date
    (a real trading day
    YYYY-MM-DD
    ; empty result → step back a day); the levels interface also needs
    decimals
    .
  • Options chain uses
    underlying
    +
    expiration
    (not
    symbol
    ).
  • Reddit top mentions and OHLC bars take
    start
    as Unix seconds —
    date -u -d '7 days ago' +%s
    (Linux) /
    date -u -v-7d +%s
    (mac).
  • Quotes are delayed 30 minutes; the screener is real-time.
  • Derivatives: aggregated/coin endpoints take
    symbol=BTC
    ; single-exchange ones take a pair
    BTC USDT
    style (
    BTCUSDT
    ) — check the catalog entry.
  • address_labels / address_risk use special coin ids (
    ETH
    ,
    BNB
    ,
    POL-Polygon
    ,
    ETH-Base
    ,
    TRX
    ,
    SOL
    ,
    SUI
    …) — see
    api/catalog/address-intel/
    .
  • 暗池需要
    date
    (必须是真实的交易日,格式为
    YYYY-MM-DD
    ;结果为空时,应向前回退一天);levels 接口还需要
    decimals
    。
  • 期权链使用
    underlying
    +
    expiration
    (不是
    symbol
    )。
  • Reddit 热门提及和 OHLC K 线的
    start
    参数采用 Unix 秒——
    date -u -d '7 days ago' +%s
    (Linux)/
    date -u -v-7d +%s
    (macOS)。
  • 行情延迟 30 分钟;筛选器为实时数据。
  • 衍生品:聚合/coin endpoint 使用
    symbol=BTC
    ;单交易所接口使用
    BTC USDT
    形式的交易对(
    BTCUSDT
    )——请检查目录条目。
  • address_labels
    /
    address_risk
    使用特殊 coin id(
    ETH
    、
    BNB
    、
    POL-Polygon
    、
    ETH-Base
    、
    TRX
    、
    SOL
    、
    SUI
    等)——参见
    api/catalog/address-intel/
    。

Plan & access

套餐与访问权限

Most data is free. Each account has a plan (
free
/
standard
/
pro
, shown by the Step-0
/api/account
call);
accessible_providers
there lists the sources this key can call. A few sources are Pro-only — e.g. Mobula on-chain wallet / token / market data — and return
403 pro_only
for non-Pro accounts.
Pro is granted by the Clawby team (app membership) — it is not self-serve and cannot be purchased, so never suggest the user buy anything. If a Pro-only source is blocked, note it in one short line (which source, what it would have added) and continue with the data you can access.
大多数数据免费。每个账户都有一个套餐(
free
/
standard
/
pro
,可在第 0 步的
/api/account
调用中查看);其中的
accessible_providers
会列出该 key 可以调用的来源。少数来源仅限 Pro——例如 Mobula 链上钱包/代币/市场数据——非 Pro 账户会收到
403 pro_only
。
Pro 由 Clawby 团队授予(应用会员权益),并非自助购买,也无法直接购买,因此绝不能建议用户购买。若某个 Pro-only 来源被屏蔽,只需用简短一句话说明(说明是哪个来源以及它原本能补充什么数据),然后继续使用当前可访问的数据。

Professional analysis reports (PDF)

专业分析报告(PDF)

When the user wants a formal write-up (research report / due-diligence / memo): offer it first, then follow
report/report-guide.md
end-to-end — gather ALL data (Layers 1–3), 10 required sections, required charts (price w/ levels, scenario targets, unlock schedule for crypto, metric trends, risk matrix), styled A4 HTML (
report/report.css
) → PDF via headless Chromium (fallbacks: weasyprint / wkhtmltopdf). Ask where to save; include a not investment advice disclaimer.
当用户需要正式说明(研究报告/尽职调查/备忘录)时:先主动提供该选项,然后严格遵循
report/report-guide.md
完整执行——收集全部数据(第 1–3 层)、完成 10 个必需章节和必需图表(价格与关键水平、情景目标、代币解锁计划、指标趋势、风险矩阵)、生成带样式的 A4 HTML(
report/report.css
),再通过无头 Chromium 转换为 PDF(后备方案:weasyprint / wkhtmltopdf)。询问保存位置;加入不构成投资建议的免责声明。

Errors

错误

  • 401 invalid/missing key → tell the user to set
    CLAWBY_API_KEY
    .
  • 403
    pro_only
    → a Pro-only source (e.g. Mobula) and this account isn't Pro: say so in one short line and carry on with accessible data (Pro can't be bought — don't point to any purchase page).
  • 402 (rare, legacy) → treat that source as unavailable and continue with the others.
  • 429 per-API-key rate limit (~5 requests/sec —
    rate_per_sec
    in
    /api/account
    ) → slow down and retry.
  • 502 "Upstream HTTP 4xx" = bad params (missing required / wrong symbol format) → fix against the interface's catalog entry.
  • Empty
    data
    = nothing for that date/symbol (dark pool: try an earlier trading day).
  • 401 密钥无效或缺失 → 告知用户设置
    CLAWBY_API_KEY
    。
  • 403
    pro_only
    → 来源仅限 Pro(如 Mobula),而当前账户不是 Pro:用简短一句话说明,然后继续处理可访问的数据(Pro 无法购买——不要指向任何购买页面)。
  • 402(少见,旧版遗留)→ 将该来源视为不可用,并继续使用其他来源。
  • 429 每个 API key 的速率限制(约 5 请求/秒——见
    /api/account
    中的
    rate_per_sec
    )→ 放慢速度后重试。
  • 502 “Upstream HTTP 4xx” = 参数错误(缺少必填参数或标的格式错误)→ 根据接口目录条目进行修正。
  • data
    为空
    = 该日期/标的没有数据(暗池:尝试更早的交易日)。

Output

输出

  • Analyze only real numbers from
    data
    ; never fabricate. For multi-dimensional questions, fetch several interfaces and combine.
  • If you need to cite a source, say "Clawby data". Write naturally and concisely — no raw interface names/links in user-facing prose.
  • End with a short note: "Not investment advice."
  • 只分析
    data
    中的真实数字;绝不编造。对于多维度问题,应获取多个接口并合并分析。
  • 如果需要引用来源,请写“Clawby 数据”。表达应自然、简洁;面向用户的说明中不要出现原始接口名称或链接。
  • 结尾添加简短说明:“不构成投资建议。”