Install
openclaw skills install cn-security-code-resolver-openclaw-skillResolve A-share stocks, ETFs, funds, and other mainland China securities from Chinese names into tradable codes using Eastmoney search. This skill should be used when a user asks for a security code, ticker, exchange suffix, or wants a portfolio file enriched with Chinese market instrument codes.
openclaw skills install cn-security-code-resolver-openclaw-skillResolve Chinese security names into exchange-tradable codes with a deterministic first pass and a verifiable fallback. Use the bundled script to query Eastmoney's public suggest API, then return the best match with enough metadata for confirmation.
Use this skill when the task involves any of the following:
600938.SH, 510880.SH, or Eastmoney QuoteIDDo not use this skill for:
Run the bundled resolver script:
python3 skills/cn-security-code-resolver/scripts/resolve_cn_security.py "中国海油"
Batch mode:
python3 skills/cn-security-code-resolver/scripts/resolve_cn_security.py "红利ETF华泰柏瑞" "苏美达" "中国海油" "海油发展" "中海油服"
Prefer rows where:
Name exactly matches the queried Chinese nameSecurityTypeName matches user intent (沪A, 深A, 基金, etc.)MarketType / QuoteID indicate mainland trading venueFor mainland cash equities and ETFs, map exchange suffixes as:
6, 5, or 9 → usually SH0, 1, 2, or 3 → usually SZIf the returned result is ambiguous, show the top 3 candidates and ask for confirmation instead of guessing.
Use this output shape when replying:
标的:中海油服
A股代码:601808
交易所:上交所
类型:沪A
标准代码:601808.SH
QuoteID:1.601808
When writing portfolio JSON or other structured files, prefer storing both:
code: raw numeric code, e.g. 601808exchangeSuffix: SH or SZ when it can be derived confidentlyOptional enriched fields:
quoteIdsecurityTypeNamemarketTypesource: "eastmoney_suggest"If the first result looks suspicious:
Good verification signals:
scripts/resolve_cn_security.py
references/eastmoney-api.md
python3 skills/cn-security-code-resolver/scripts/resolve_cn_security.py "苏美达"
Expected top result:
600710 / 苏美达 / 沪Apython3 skills/cn-security-code-resolver/scripts/resolve_cn_security.py "红利ETF华泰柏瑞"
Expected top result:
510880 / 红利ETF华泰柏瑞 / 基金python3 skills/cn-security-code-resolver/scripts/resolve_cn_security.py "中海油服"
Expected top result:
601808 / 中海油服 / 沪A