API 参考

DataSinking 通过一个简单的 REST API,以 Markdown 形式提供来自美国、中国、英国、日本、韩国和台湾的上市公司财务报告全文。选择你的接入方式: curl, Python, LLM,或 MCP server。

获取 Key 并将其作为 apikey 查询参数传入。速率限制: 免费版 3 次/秒 且每 7 天 8,191 篇(batch 单次 ≤3 篇,滚动计算)· 年度版 31 次/秒 且 每 7 天 524,287 篇(batch 单次 ≤31 篇,滚动计算)· 免费版的用量还与网页访客共享每 7 天 524,287 篇的池子。

curl

每个请求都需要携带你的 apikey。

1. 列出交易所

curl "https://api.datasink.ing/exchanges?apikey=YOUR_API_KEY"

2. 列出某个交易所的股票

# China — Shanghai
curl "https://api.datasink.ing/stocks?exchange=sse&apikey=YOUR_API_KEY"

# Japan — Tokyo
curl "https://api.datasink.ing/stocks?exchange=jpx&apikey=YOUR_API_KEY"

# Korea — KOSDAQ
curl "https://api.datasink.ing/stocks?exchange=koe&apikey=YOUR_API_KEY"

# Taiwan — Taipei
curl "https://api.datasink.ing/stocks?exchange=twse&apikey=YOUR_API_KEY"

3. 列出某只股票的报告(元数据)

# China — Moutai (600519.SS)
curl "https://api.datasink.ing/documents?symbol=600519.SS&doc_type=annual&apikey=YOUR_API_KEY"

# Japan — Toyota (7203.T)
curl "https://api.datasink.ing/documents?symbol=7203.T&doc_type=annual&apikey=YOUR_API_KEY"

# Korea — Samsung Electronics (005930.KS)
curl "https://api.datasink.ing/documents?symbol=005930.KS&doc_type=annual&apikey=YOUR_API_KEY"

# Taiwan — TSMC (2330.TW)
curl "https://api.datasink.ing/documents?symbol=2330.TW&doc_type=annual&apikey=YOUR_API_KEY"

4. 获取单份报告(全文)

curl "https://api.datasink.ing/documents/42?apikey=YOUR_API_KEY"

5. 获取某只股票的报告(全文)

按报告期(report_period,而非披露日期), 或通过 order=desc&size=N 获取最近 N 份:

# latest 7 (full text)
curl "https://api.datasink.ing/documents?symbol=600519.SS&order=desc&size=7&with_content=1&apikey=YOUR_API_KEY"

# by reporting-period range (full text)
curl "https://api.datasink.ing/documents?symbol=600519.SS&report_period_from=2023-01-01&report_period_to=2023-12-31&with_content=1&apikey=YOUR_API_KEY"

6. 获取单个章节(用于 RAG)

报告按章节组织。先列出章节,然后只拉取你需要的那个章节——无需下载整份报告。例如,拉取 管理层讨论与分析(MD&A)章节,或 财务报告 以获取附注,并查找诸如 在建工程 这样的具体科目。

# list a report's sections
curl "https://api.datasink.ing/documents/3/sections?apikey=YOUR_API_KEY"

# pull one section only (fuzzy title match; non-ASCII titles must be URL-encoded)
curl "https://api.datasink.ing/documents/3?section=%E7%AE%A1%E7%90%86%E5%B1%82%E8%AE%A8%E8%AE%BA%E4%B8%8E%E5%88%86%E6%9E%90&apikey=YOUR_API_KEY"

# the notes (附注) live inside the financial-report chapter
curl "https://api.datasink.ing/documents/3?section=%E8%B4%A2%E5%8A%A1%E6%8A%A5%E5%91%8A&apikey=YOUR_API_KEY"

Python

pip install datasinking,然后使用五个函数:

from datasinking import DataSinking

ds = DataSinking("YOUR_API_KEY")

ds.list_exchanges()                          # -> ['bj', 'jpx', 'knx', 'koe', 'ksc', 'sse', 'szse', 'tpex', 'twse']
ds.list_stocks("sse")                        # -> list[dict], metadata
ds.list_reports("600519.SS", doc_type="annual")  # -> list[dict], metadata (no content)
ds.get_report(42)                            # -> dict, single report (full text)

# -> list[dict], full text. limit: latest N, -1 = all.
ds.get_stock_reports(
    "600519.SS",
    period_from="2023-01-01",   # by reporting period, not disclosure date
    period_to="2023-12-31",
    limit=7,                    # latest 7; -1 = all
    doc_type=None,
)

在 PyPI 上查看 · 完整源码和示例见 GitHub。

在 LLM 中使用

让任何 LLM 访问本站,给它你的 Key,然后用自然语言提问——模型会阅读 API、调用它,并把答案交给你。五个操作分别对应一种自然语言提问:

“这个 API 覆盖哪些交易所?”→ list_exchangesGET /exchanges
“上海交易所有哪些股票?”→ list_stocksGET /stocks
“列出茅台的年报。”→ list_reportsGET /documents
“给我 42 号文档。”→ get_reportGET /documents/:id
“茅台 2023 年的营收——别把单位搞错。”→ get_stock_reportsGET /documents + with_content
Onboarding prompt — paste this into your AI agent
You have access to DataSinking — an API for full-text financial reports (annual,
semi-annual, quarterly) from the US, the UK, China, Japan, Korea and Taiwan, as clean Markdown.
Docs: https://datasink.ing/docs · Spec: https://api.datasink.ing/openapi.json
My API key: YOUR_API_KEY  (pass it as ?apikey=)

Workflow: list reports to get an id, then fetch by that id.
- List exchanges:  GET /exchanges
- List stocks:     GET /stocks?exchange=sse
- List reports:    GET /documents?symbol=600519.SS&doc_type=annual
                    → each item has an "id"
- Get one report:  GET /documents/{id}  (full Markdown)
- Get one section: GET /documents/{id}?section=%E7%AE%A1%E7%90%86%E5%B1%82%E8%AE%A8%E8%AE%BA%E4%B8%8E%E5%88%86%E6%9E%90  (= 管理层讨论与分析, URL-encoded — non-ASCII headings MUST be encoded; token-efficient for RAG)

Symbols are FMP-style: AAPL (Apple), 600519.SS (Moutai), 7203.T (Toyota), 005930.KS (Samsung).
Example: "Moutai's 2023 revenue" → list reports (doc_type=annual) → find 2023 → get that
report's section 主要财务指标 → read revenue with its unit (元/RMB).

返回的 content 以 YAML frontmatter 开头(身份标识 + 报告期),并会用 > 单位:元 标记单位行,这样模型就能按正确的量级读取每个数字。完整提示词见: llm-examples.md。机器可读的规范位于 https://api.datasink.ing/openapi.json。

MCP server(用于 AI Agent)

通过 Model Context Protocol 直接连接 Claude、Cursor、OpenAI Codex、DeepSeek 或任何兼容 MCP 的客户端——用自然语言提问,无需写代码。 各客户端配置(Claude Code / Claude Desktop / Cursor / Codex / WorkBuddy / 豆包工作 / Devin Desktop / DeepSeek Harness)→

托管版 —— 无需安装

{
  "mcpServers": {
    "datasinking": {
      "type": "http",
      "url": "https://api.datasink.ing/mcp?apikey=YOUR_API_KEY"
    }
  }
}

密钥是放在 URL 里的,注意别外传这份配置。支持自定义请求头的客户端,可以改用 Authorization: Bearer YOUR_API_KEY。

本地版 —— 自己运行

{
  "mcpServers": {
    "datasinking": {
      "command": "uvx",
      "args": ["--from", "datasinking[mcp]", "datasinking-mcp"],
      "env": { "DATASINK_API_KEY": "YOUR_API_KEY" }
    }
  }
}

通过 uvx 运行,同样无需安装。 想常驻安装:执行 pip install "datasinking[mcp]", 再把 "command" 改成 "datasinking-mcp"。

想用 Node 而不是 Python?同一个 server 也发在 npm 上,不需要 Python:

{
  "mcpServers": {
    "datasinking": {
      "command": "npx",
      "args": ["-y", "datasinking-mcp"],
      "env": { "DATASINK_API_KEY": "YOUR_API_KEY" }
    }
  }
}

Claude Code: claude mcp add --transport http datasinking https://api.datasink.ing/mcp --header "Authorization: Bearer YOUR_KEY"

工具包括 get_section——可拉取报告的单个章节(节省 token,非常适合 RAG)。完整配置指南见: mcp-server.md。

返回的字段

每个文档对象都包含以下字段(列表接口会将它们包裹在 items 中,并带有 total / page / size):

idint文档 ID —— 用于 /documents/{id} 和 batch 下载
symbolstringFMP 风格的 ticker,例如 600519.SS
exchangestringsse / szse / bj / jpx / ksc / koe / knx / twse / tpex
stock_codestring6 位数字代码,例如 600519
stock_namestring公司名称
report_periodstring报告期,YYYY-MM-DD(本报告所涵盖的会计期间)
doc_typestringannual / semiannual / q1 / q3 / amendment
titlestring公告标题
word_countintMarkdown 正文的字数
announcement_timeint披露时间,以毫秒为单位的 Unix 时间戳
contentstring完整 Markdown 正文 —— 仅在 with_content=1、单份文档或 batch 下载时返回

content 以一段 YAML frontmatter 开头(stock_code、 stock_name、 report_period、 announcement_date、 doc_type、 title),这样 LLM 无需从正文中猜测,即可读取文档标识和报告期。

Symbol 格式

Symbol 遵循 FMP / Yahoo 的约定,因此可以直接接入现有工作流:

交易所后缀示例
上海 (SSE).SS600519.SS
深圳 (SZSE).SZ000001.SZ
北京 (BSE).BJ830799.BJ
东京 (TSE).T7203.T
韩国 (KRX).KS005930.KS
台湾 (TWSE).TW2330.TW