API 레퍼런스
DataSinking은 중국, 일본, 한국, 대만의 전문 재무 보고서를 간단한 REST API를 통해 Markdown으로 제공합니다. 원하는 인터페이스를 선택하세요: curl, Python, LLM, 또는 MCP 서버.
키 받기 후 apikey 쿼리 파라미터로 전달하세요. 속도 제한: 무료 1 req/s & 8,191 req/day · 연간 31 req/s & 131,071 req/day + batch download.
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용)
보고서는 장(chapter) 구조로 되어 있습니다. 섹션을 나열한 뒤 하나만 가져오세요 — 전체 보고서를 다운로드할 필요가 없습니다. 예를 들어 管理层讨论与分析 (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) curl "https://api.datasink.ing/documents/3?section=管理层讨论与分析&apikey=YOUR_API_KEY" # the notes (附注) live inside the financial-report chapter curl "https://api.datasink.ing/documents/3?section=财务报告&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', 'sgx', '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,
)LLM에서 사용하기
아무 LLM에 이 사이트를 가리키고 키를 제공한 뒤 자연어로 질문하세요 — 모델이 API를 읽고 호출하여 답을 돌려줍니다. 다섯 가지 작업은 각각 자연어 요청에 대응됩니다:
| “어떤 거래소를 지원하나요?” | → list_exchanges | GET /exchanges |
| “상하이 거래소에는 어떤 종목이 있나요?” | → list_stocks | GET /stocks |
| “마오타이의 연간 보고서를 나열해 줘.” | → list_reports | GET /documents |
| “문서 42를 보여줘.” | → get_report | GET /documents/:id |
| “마오타이의 2023년 매출 — 단위를 틀리지 마.” | → get_stock_reports | GET /documents + with_content |
You have access to DataSinking — an API for full-text financial reports (annual,
semi-annual, quarterly) from 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=管理层讨论与分析 (URL-encode non-ASCII; token-efficient for RAG)
Symbols are FMP-style: 600519.SS (Moutai), 005930.KS (Samsung), 7203.T (Toyota).
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 서버 (AI 에이전트용)
Claude, Cursor, OpenAI Codex, DeepSeek 또는 MCP 호환 클라이언트를 Model Context Protocol을 통해 직접 연결하세요 — 자연어로 질문하고, 코드 없이 사용할 수 있습니다.
{
"mcpServers": {
"datasinking": {
"command": "python",
"args": ["/path/to/mcp_server.py"],
"env": { "DATASINK_API_KEY": "YOUR_API_KEY" }
}
}
}도구에는 get_section이 포함됩니다 — 보고서의 한 장을 가져옵니다 (토큰 효율적, RAG에 이상적). 전체 설정 가이드: mcp-server.md.
반환되는 필드
모든 문서 객체에는 다음 필드가 포함됩니다 (목록 엔드포인트는 items 안에 total / page / size와 함께 감쌉니다):
| id | int | 문서 ID — /documents/{id} 및 batch에서 사용 |
| symbol | string | FMP 스타일 ticker, 예: 600519.SS |
| exchange | string | sse / szse / bj / jpx / ksc / koe / knx / twse / tpex / sgx |
| stock_code | string | 6자리 코드, 예: 600519 |
| stock_name | string | 회사명 |
| report_period | string | 보고 기간, YYYY-MM-DD (이 보고서가 다루는 회계 기간) |
| doc_type | string | annual / semiannual / q1 / q3 / amendment |
| title | string | 공시 제목 |
| word_count | int | Markdown 본문의 단어 수 |
| announcement_time | int | 밀리초 Unix 타임스탬프로 표시된 공시 시각 |
| content | string | 전체 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) | .SS | 600519.SS |
| 선전 (SZSE) | .SZ | 000001.SZ |
| 베이징 (BSE) | .BJ | 830799.BJ |
| 도쿄 (TSE) | .T | 7203.T |
| 한국 (KRX) | .KS | 005930.KS |
| 대만 (TWSE) | .TW | 2330.TW |