# Extracting Top-5 Customer and Supplier Tables from 250-Page China A-Share PDFs (Without Burning LLM Tokens)

> Source: <https://dev.to/bbscs/extracting-top-5-customer-and-supplier-tables-from-250-page-china-a-share-pdfs-without-burning-llm-e2n>
> Published: 2026-11-30 17:37:09+00:00

**Recommendation:** Skip full-document context: stream the PDF, scan for anchor keywords plus numeric table signals, expand hits by one page, and cache results by symbol and fiscal year to make repeat lookups cost zero tokens.
More in the playbook "Controlling LLM cost": <https://wpnews.pro/playbooks/llm-cost>

I run a small paper-trading setup that tracks China A-shares (Shanghai, Shenzhen, and Beijing exchanges). For event signals and supply-chain risk, official regulatory filings on CNINFO (China's equivalent of SEC EDGAR) are way cleaner than scraped news.

The catch is that Chinese annual reports are usually 200 to 300 page PDFs. If you dump the whole file into an LLM context window every time you want to check customer concentration, it is slow and expensive.

Here is the lightweight pipeline I ended up building to pull Top-5 customer and supplier disclosures on demand, plus a few real FY2025 extractions that stood out.

CNINFO exposes two public JSON endpoints that work reliably without headless browser scraping:

`POST http://www.cninfo.com.cn/new/information/topSearch/query?keyWord=300750` to resolve the company's `orgId`.` POST http://www.cninfo.com.cn/new/hisAnnouncement/query` with `category=category_ndbg_szsh` and `stock={symbol},{orgId}` to list annual reports.
One small gotcha: CNINFO mixes full annual reports, short summaries (`摘要`), English translations, and correction notices in the same category. Filtering out those suffixes and sorting by `(fiscal_year, announcementTime)` reliably picks the latest full Chinese report.

CSRC mandates a standard disclosure section in every A-share annual report covering Top-5 customers and Top-5 suppliers. Instead of saving 20MB PDFs to disk or parsing all 250 pages, I stream the PDF in memory with `pypdf`, skip the first 4 table-of-contents pages, and scan for anchor keywords (`主要销售客户`, `前五名客户`, `主要供应商`, `前五名供应商`) alongside numeric table signals (`%`, `万元`, `销售金额`, `采购金额`).

```
for idx in range(total_pages):
    if total_pages > 20 and idx < 4:
        continue
    txt = (reader.pages[idx].extract_text() or "").strip()
    if any(kw in txt for kw in STRONG_KEYWORDS) and any(
        sig in txt for sig in ("%", "万元", "销售金额", "采购金额", "占比")
    ):
        hit_pages.append(idx + 1)
```

Expanding each hit by `+1` page catches split tables while capping total context at 6 pages. That brings each extraction down to roughly 3,000 to 5,000 input tokens.

Two real-world quirks broke my first prototype:

`客户一`) instead of the real company name. The extraction prompt is strict about never guessing: if the PDF gives a real name, translate it to English; if it is anonymized, explicitly return `"anonymized": true`.`更正/修订公告`). Keeping both the old and corrected rows poisons downstream signals, so I added `filing_status: "superseded"` and `supersedes_id` linking to filter stale rows out by default.
Finally, each extracted result is cached in SQLite by `(symbol, fiscal_year)` along with the exact PDF page numbers so repeat lookups cost zero tokens.

| Company | Top-5 Customers | Top-5 Suppliers | Exact PDF Pages | Notable Detail | 
|---|---|---|---|---|
| **Luxshare (`002475`)** | 65.04% (RMB 216.2B) | 52.97% (RMB 132.0B) | pp. 19-20 | Customer #1 alone is 56.68% of total sales (anonymized) | 
| **CATL (`300750`)** | 38.96% (RMB 165.1B) | 10.38% (RMB 59.9B) | pp. 28-29, 209-210 | Largest single customer is 13.73%, 0% related-party | 
| **Kweichow Moutai (`600519`)** | 10.10% (RMB 17.0B) | 38.12% (RMB 3.5B) | pp. 11-13 | 3.77% related-party sales, 15.22% related-party purchases | 

I put up a public sandbox (no signup required) at [filings.cnpulse.cn](https://filings.cnpulse.cn) with preset buttons for Luxshare, CATL, and Moutai, or you can test any 6-digit A-share ticker via cURL:

```
curl -H "X-API-Key: cf_demo_public_readonly" \
  "https://filings.cnpulse.cn/v1/supply-chain/300750"
```

It also runs as a Streamable HTTP MCP server (published on the official MCP Registry as `cn.cnpulse.filings/chinafilings`):

```
{
  "mcpServers": {
    "chinafilings": {
      "url": "https://filings.cnpulse.cn/mcp",
      "headers": {
        "X-API-Key": "cf_demo_public_readonly"
      }
    }
  }
}
```

If you work with Asian equity data, what other tables buried inside CNINFO annual reports would be worth extracting next? And if you test a weird A-share ticker whose PDF layout trips up the page matcher, drop the code in the comments.
