mcpField
R
report-download

report-download

github.com/terancejiangDocuments7642 installsUpdated 34w ago
Repository

About report-download

A workflow skill for finding and downloading A-share and Hong Kong stock financial report PDFs. It searches by stock code, year, and report type, filters candidate documents, and saves the selected file locally.

Key features

  1. 01Detect market and format stock codes
  2. 02Search by report type and year
  3. 03Extract PDF links from specified sources
  4. 04Filter out summaries and other non-target files
  5. 05Download PDFs and return local paths

Use cases

  1. 01Retrieving an annual report for a stock
  2. 02Finding A-share quarterly or interim reports
  3. 03Saving a Hong Kong stock report locally

Install

Copy the command and run it in a terminal.

$npx skills add https://github.com/terancejiang/skill_financial_report_download --skill report-download

After installing, type/report-downloadin Claude Code to confirm it loaded.

Bundled filesscripts/download_report.py

Details

From the project README

Financial Report PDF Downloader

Download A-share and Hong Kong stock financial report PDFs from stockn.xueqiu.com (雪球) with notice.10jqka.com.cn (同花顺) as fallback. Both sources enable reliable automated downloads.

Workflow

Input (stock code, year, report type)
  → Step 0: Parse & detect market
  → Step 1: WebSearch for PDF on stockn.xueqiu.com
  → Step 2: Extract matching PDF URLs
  → Step 3: Identify correct report (filter out summaries, audit reports, etc.)
  → Step 4: Python script downloads PDF to local disk
  → Output: local PDF file path

Step 0: Parse Input

Parse user input into three parts:

  • stock_code (required): stock ticker
  • year (optional): defaults to latest available
  • report_type (optional): defaults to 年报
Market Detection
PatternMarketFormattingExample
6-digit starting with 6Shanghai A-sharePrefix SH600887 → SH600887
6-digit starting with 0 or 3Shenzhen A-sharePrefix SZ300750 → SZ300750
1-5 digitsHong KongZero-pad to 5 digits700 → 00700
Already has SH/SZ prefixUse as-is—SH600887
Report Type Mapping
User Inputreport_typeA-share Search KeywordHK Search KeywordPublish Time
年报 / annual年报年度报告annual reportNext year Mar-Apr
中报 / interim中报半年度报告interim reportSame year Aug-Sep
一季报 / Q1一季报第一季度报告(A-share only)Same year Apr
三季报 / Q3三季报第三季度报告(A-share only)Same year Oct

Step 1: Search for the Report

Use WebSearch with this query pattern:

A-share: site:stockn.xueqiu.com {formatted_code} {search_keyword} {year} HK: site:stockn.xueqiu.com {formatted_code} {hk_search_keyword} {year}

If no year specified: try current year first, then previous year. If no results from Xueqiu:

  1. Retry with 同花顺: site:notice.10jqka.com.cn {formatted_code} {search_keyword} {year}
    • Can also try with company name, e.g.: site:notice.10jqka.com.cn 伊利股份 2024 年度报告
  2. If still no results: retry without any site: prefix as a last resort.

Step 2: Extract PDF Links

Filter search results for PDF URLs from supported sources:

  • https://stockn.xueqiu.com/.../*.pdf
  • https://notice.10jqka.com.cn/.../*.pdf

Step 3: Identify Correct Report

Exclude results with titles containing: 摘要, 审计报告, 公告, 利润分配, 可持续发展, 股东大会, ESG, summary, auditor, dividend, 更正, 补充, 意见, 内部控制

Prefer results where:

  1. Title contains the report keyword (e.g. "年度报告") WITHOUT "摘要"
  2. URL date closest to expected publish date
  3. If tied, pick first result

If no candidates remain: inform user and suggest verifying stock code/year/report type.

Step 4: Download the PDF

Install dependency if needed:

pip install requests --break-system-packages

Run the download script (located at ${CLAUDE_PLUGIN_ROOT}/skills/report-download/scripts/download_report.py):

python3 ${CLAUDE_PLUGIN_ROOT}/skills/report-download/scripts/download_report.py \
  --url "<PDF_URL>" \
  --stock-code "<formatted_stock_code>" \
  --report-type "<report_type>" \
  --year "<year>" \
  --save-dir "."
Parse Output

The script prints a structured block between ---RESULT--- and ---END---:

  • status: SUCCESS or FAILED
  • filepath: absolute path to downloaded file
  • filesize: file size in bytes
  • message: status message
Report to User

On success: Report file path, size (human-readable MB), stock code, year, report type. On failure: Report error message. Suggest checking URL accessibility, retrying, or verifying inputs.

Comments

Markdown supported