U.S. SEC EDGAR fetch interface — resolve a ticker to its CIK, list recent filings (10-K / 10-Q / 8-K and friends) with primary-document URLs, and pull XBRL comp
复制下面这句话,粘贴给 Claude Code、Codex、Cursor 等 AI 编程工具,它会读取安装说明并在你确认后完成安装。
请阅读 https://ai.atlankj.com/install/asset/gh-sec-edgar-3e4f1b9166ab ,按照其中的说明把「sec-edgar」安装到你(当前 AI 工具)中。执行前先告诉我将运行的命令和写入的位置,等我确认。
查看 AI 将读取的安装说明正在读取 GitHub 原文…
内容来自 GitHub 原始文件,由原作者维护。在 GitHub 查看
The U.S. Securities and Exchange Commission (SEC) publishes free, no-auth JSON endpoints for every reporting company on its EDGAR system: a ticker-to-CIK directory, a recent-filings index, and the full set of XBRL ("companyfacts") financial concepts a company has reported. This skill documents how Vibe-Trading fetches that data through the bundled sec_edgar_client transport and the get_sec_filings agent tool.
This is the fetch skill — it covers how to get filing-index rows, document URLs, and us-gaap metric series out of EDGAR. The separate edgar-sec-filings skill is the methodology layer (how to read a 10-K, score insider activity, interpret 8-K items); for any actual data retrieval it delegates here.
Scope is the United States only. EDGAR has no coverage of A-shares, HK, or other non-U.S. markets — route those through tushare / yfinance / akshare instead.
Link convention: every link below that points into
references/is written relative to this document (references/...) — the form GitHub resolves when someone opens the file in a browser. Theread_filetool resolves the same string against the skill that owns it, so the agent and a human reader reach one file. Keep the relative form when adding new docs, and keep reference paths unique across skills: a path two skills both carry is reported as ambiguous rather than guessed.
Preferred path — the get_sec_filings tool (read-only, throttled, returns strict JSON):
{ "ticker": "AAPL", "form": "10-K", "limit": 5 }
{ "ticker": "MSFT", "metric": "Revenues", "limit": 8 }
The tool resolves the ticker to a CIK, fetches the filing index (optionally filtered by form), and — when metric is set — also pulls the XBRL series for that us-gaap concept. See sec-edgar/references/get_sec_filings_tool.md for the full parameter and envelope contract.
Script path — call the sec_edgar_client transport directly when you need raw JSON the tool does not surface (e.g. company address, all units of a concept):
from backtest.loaders.sec_edgar_client import cik_for, get_submissions, get_company_facts
cik = cik_for("AAPL") # "0000320193", or None if not in the SEC table
submissions = get_submissions(cik) # recent-filings index + company metadata
facts = get_company_facts(cik) # all reported XBRL concepts
A runnable end-to-end example lives at sec-edgar/scripts/sec_filings_example.py.
AAPL, msft). Resolved to a CIK via the SEC company-tickers table; an unlisted ticker returns an error envelope (tool) or None (cik_for).320193 → "0000320193"). The submissions and companyfacts endpoints require the padded form; document URLs use the un-padded form.10-K, 10-Q, 8-K, DEF 14A, 4). Omit to return all recent forms.us-gaap concept name (Revenues, NetIncomeLoss, Assets, StockholdersEquity). Case-sensitive — these are exact taxonomy element names.YYYY-MM-DD strings (e.g. 2023-09-30).dict).cik_for, get_submissions, get_company_facts, CIK padding, throttle bucket, contact User-Agent.filings[] and metric field shapes.User-Agent carrying a contact address; the client ships a compliant default and honors the VIBE_TRADING_SEC_UA override.backtest.loaders._http throttle under the "sec" host bucket (≈0.12s spacing floor, overridable via VIBE_TRADING_SEC_MIN_INTERVAL). Do not bypass the client with raw requests loops.sec_edgar_client is a thin REST client, not a DataLoaderProtocol. There is no source: "sec_edgar" backtest mode — EDGAR feeds the get_sec_filings tool, not the bar-loading layer.edgar-sec-filings methodology skill.