Qichacha API tool.Users state their needs in natural language, and the AI calls scripts in the background—users don't need to type commands。
How you (the AI) work
What the user says → you identify the intent → you call the script → you reply to the user in plain language.
| What the user says | What you should do |
|---|---|
| "Look up Tencent's business registration info" | Call 410 (basic business registration); if the user later asks for "more detail", then add 735 |
| "Who is Tencent's legal representative / what is the registered capital" | Call 410, answer from the OperName / RegistCapi field |
| "Who are Tencent's shareholders" | Call 731 |
| "Does Tencent have lawsuits / is it being sued / is it subject to enforcement" | Full judicial risk set: 740 (dishonesty) + 741 (enforcement) + 887 (court documents) + 888 (hearings) + 889 (case filings), answer by risk level |
| "Does Tencent have operational abnormalities / any penalties / any pledges" | Operational risk: 739 (operational abnormalities) + 748 (serious violations) + 865 (administrative penalties) + 751/753 (equity pledges) |
| "What trademarks / patents does Tencent have" | 231 (trademarks) + 514 (patents) |
| "What recent news / financing does Tencent have" | 701 (public sentiment) + 950 (financing) |
| "Is XX real (counterparty verification for contracts)" | 855 (two-factor) or 856 (three-factor, requires legal representative) |
| "Is XX company a shell company" | 410 business registration + 884 outbound investment + 732 key personnel, for a comprehensive judgment |
When the natural language does not specify the company's full name: first use 886 (fuzzy search, 0.10 yuan) to get the complete registered business name, then call the specific interface. Don't make the user type the full name.
Cost reminder principle(default recommended standard, adjustable): before stacking multiple interfaces that cost over 1 yuan per call (735/731/213/271/884/758/988/1024/980/958), first say verbally "these items add up to about X yuan, run them?"; anything under 2 yuan can just be run without asking.
Resource locations
| Resource | Mac / Linux | Windows |
|---|---|---|
| Skill directory | ~/.claude/skills/kaiyu-qichacha-fetcher/ |
%USERPROFILE%\.claude\skills\kaiyu-qichacha-fetcher\ |
| Credential file | ~/.config/qichacha/credentials.json |
%USERPROFILE%\.config\qichacha\credentials.json |
| Cache directory | ~/.cache/qichacha/<MD5(企业名)[:16]>/ |
%USERPROFILE%\.cache\qichacha\<MD5(企业名)[:16]>\ |
- Interface registry:
scripts/api_registry.py(45 interfaces, defaultopened: False) - Official documentation: https://openapi.qcc.com/dataApi
- Console: https://openapi.qcc.com/console
- First-time setup: see
SETUP.md(usepython setup.pyto complete it in one step) - Troubleshooting manual:
TROUBLESHOOTING.md
setup.py management commands (the entry point for users to manage skill status)
Users don't need to manually edit any files. All maintenance operations are done through these commands—when users ask related questions,you (the AI) should proactively run these commands:
| What the user says | The command you run |
|---|---|
| "Help me configure / first time using / not set up yet" | python3 setup.py(interactively enter credentials) |
| "Which step am I actually at / check the status / is it usable yet" | python3 setup.py diagnose |
| "Help me mark 410/740/... as already activated" | python3 setup.py mark-opened 410 740 ... |
| "Cancel the activation mark for XX / I unsubscribed from the XX interface" | python3 setup.py mark-closed 410 |
| "Show me which interfaces I have activated" | python3 setup.py list-opened |
| "Test whether the credentials are correct / run a real request to verify" | python3 setup.py probe(deduct ¥0.1) |
| "Start over / reset / clear and reconfigure" | python3 setup.py reset(confirmation required) |
mark-opened will modify scripts/api_registry.py in opened field; Python syntax validation is performed before writing, and writing is rejected on failure.Users should not manually edit this file—whenever there is a problem, use mark-opened / mark-closed。
How you call the script (internal implementation)
Python inline(recommended, avoids subprocess overhead):
import os, sys
# 用 expanduser 自动展开 ~ / %USERPROFILE%,跨平台
sys.path.insert(0, os.path.expanduser("~/.claude/skills/kaiyu-qichacha-fetcher/scripts"))
from client import fetch, check_account, QccError
r = fetch("410", keyword="腾讯科技(深圳)有限公司")
if r.ok:
data = r.data # 工商详情字典
# 用 r.data 里的字段写自然语言回复
elif r.status == "":
pass # QccError 已经被抛
else:
# r.ok==False 但没抛——通常是无结果
pass
Bash / CMD call CLI(backup, parse the JSON output yourself):
# Mac/Linux
python3 ~/.claude/skills/kaiyu-qichacha-fetcher/scripts/qcc.py fetch 410 "腾讯科技(深圳)有限公司"
python3 ~/.claude/skills/kaiyu-qichacha-fetcher/scripts/qcc.py check-account
python3 ~/.claude/skills/kaiyu-qichacha-fetcher/scripts/qcc.py list --opened --md
:: Windows
python %USERPROFILE%\.claude\skills\kaiyu-qichacha-fetcher\scripts\qcc.py fetch 410 "腾讯科技(深圳)有限公司"
python %USERPROFILE%\.claude\skills\kaiyu-qichacha-fetcher\scripts\qcc.py check-account
Natural language intent → ApiCode mapping
Organized by "what users are most likely to say". Multiple interfaces can be stacked.
Note: Users must first, in the Qichacha backend, https://openapi.qcc.com/dataApi apply to activate the corresponding interfaces one by one; after activation, run
python setup.py mark-opened <code1> <code2> ...to tell the skill (do not let users manually editapi_registry.py). Calls to interfaces that have not been activated will returnnot_openederror.
Business basics (highest frequency)
| Intent keywords | ApiCode | Unit price | Where is this field |
|---|---|---|---|
| "business / registration / registered capital / legal representative / business scope / establishment time" | 410 | 0.20 | RegistCapi / OperName / Scope / StartDate |
| "business details / complete business / paid-in / number of insured persons / national standard industry" | 735 | 2.00 | 30+ more fields than 410 |
| "shareholders / capital contribution / shareholding" | 731 | 2.00 | Result.[].StockName/StockType/StockPercent |
| "executives / directors / supervisors / legal representative / key personnel" | 732 | 0.50 | Result.[].Name/Job |
| "branch office / branches / subsidiaries (note: subsidiaries are 884)" | 733 | 0.50 | Result.[].Name/Address |
| "changes / changed name / has the legal representative changed / has the business scope changed" | 734 | 1.00 | Result.[].ProjectName/BeforeContent/AfterContent |
| "annual reports / historical revenue / historical employee count" | 213 | 1.00 | list by year |
| "invoicing / tax number" | 271 | 1.00 | TaxpayerNo / RegisterAddress |
| "two-factor / is the name and unified social credit code correct" | 855 | 0.10 | Result == "一致" |
| "three-factor / are the name + credit code + legal representative correct" | 856 | 0.20 | same as above |
| "fuzzy search / don't know the full name / this company XX" | 886 | 0.10 | Result.[].Name/KeyNo |
Related genealogy
| Intent keywords | ApiCode | Unit price |
|---|---|---|
| "outbound investment / which companies it invested in / subsidiaries (investment relationship)" | 884 | 1.00 |
Actual controller, equity penetration, corporate map, controlled enterprises, beneficial owners—these are all Qichacha negotiated-price interfaces, and require contacting Qichacha business (400-088-8275) for separate activation.
Judicial risk (must-check for credit due diligence)
| Intent keywords | ApiCode | Unit price |
|---|---|---|
| "dishonest judgment debtor / deadbeat" | 740 | 0.30 |
| "enforcement" | 741 | 0.30 |
| "high consumption restriction / restrict high consumption" | 742 | 0.50 |
| "equity freeze" | 752 | 0.50 |
| "bankruptcy / reorganization" | 761 | 0.50 |
| "judgment / judicial documents / have been in litigation / have been sued" | 887 | 0.30 |
| "court hearing" | 888 | 0.50 |
| "case filing" | 889 | 0.50 |
| "termination of current enforcement procedure / unable to enforce" | 758 | 1.00 |
| "Exit Restriction" | 988 | 1.00 |
| "Court Announcement" | 882 | 0.50 |
| "Judicial Auction" | 744 | 0.50 |
Recommended Preset — Credit Due Diligence Judicial Package: When the user says "check XX judicial risks",run 740+741+742+752+887+888+889 by default(about ¥3.0 in total, provided these APIs are activated); for high-level due diligence, add 761+758+988+882+744.
Operational Risk
| Intent Keywords | ApiCode | Unit Price |
|---|---|---|
| "Business Abnormality / Listed in Abnormality Directory" | 739 | 0.50 |
| "Serious Violation / Blacklist" | 748 | 0.50 |
| "Administrative Penalty" | 865 | 0.50 |
| "Chattel Mortgage" | 747 | 0.50 |
| "Land Mortgage" | 745 | 0.50 |
| "Equity Pledge" | 751 | 0.50 |
| "Equity Pledge" | 753 | 0.50 |
| "Tax Violation" | 756 | 0.50 |
| "Tax Arrears" | 757 | 0.50 |
| "External Guarantee" | 1024 | 1.00 |
| "Liquidation / Deregistration in Progress" | 980 | 1.00 |
Intellectual Property
| Intent Keywords | ApiCode | Unit Price |
|---|---|---|
| "Trademark" | 231 | 0.30 |
| "Patent" | 514 | 0.30 |
| "Software Copyright / Copyright" | 233 | 0.50 |
| "Website Filing / ICP" | 515 | 0.50 |
Business Information
| Intent Keywords | ApiCode | Unit Price |
|---|---|---|
| "Bidding / Winning Bid" | 958 | 1.00 |
| "Qualification / Certificate" | 255 | 0.30 |
| "Tax Credit / Tax Rating" | 691 | 0.50 |
| "Administrative License / Qualification Approval" | 892 | 0.50 |
Corporate Development
| Intent Keywords | ApiCode | Unit Price |
|---|---|---|
| "News / Public Opinion / Recent Reports / Has Anything Happened" | 701 | 0.50 |
| "Financing / Valuation / Investors" | 950 | 0.50 |
Advanced Usage: One-Click Batch Due Diligence Data Retrieval
scripts/duediligence.py is a batch orchestrator — enter a company name, and it automatically runs all "activated" APIs, outputting a markdown source package + raw JSON data + call logs.
import os, sys
sys.path.insert(0, os.path.expanduser("~/.claude/skills/kaiyu-qichacha-fetcher/scripts"))
from duediligence import run_full_dd, render_markdown
report = run_full_dd("腾讯科技(深圳)有限公司")
print(render_markdown(report))
# 或直接 CLI:python3 ~/.claude/skills/kaiyu-qichacha-fetcher/scripts/duediligence.py "企业名" --out ./output
Cost Estimate(if all APIs are activated):
- Full set about ¥27 (45 APIs, 886 + 410 already called during the build_context stage)
- Second run after cache hit: about ¥0
- Time for one full set for a single company: about 50 seconds
Risk Signal Summary Criteria(written in _build_risk_summary() ):
- 🔴 Extremely High: 740 Dishonesty / 988 Exit Restriction / 748 Serious Violation / 980 Liquidation (if any hits)
- 🟠 High: 741 Enforcement / 742 Consumption Restriction / 752 Equity Freeze / 761 Bankruptcy / 758 Case Closed Due to No Assets / 739 Business Abnormality
- 🟡 Medium: 865 Administrative Penalty / 756 Tax Violation / 757 Tax Arrears / 745/747 Mortgage / 751/753 Equity Pledge / 1024 External Guarantee;or 887 Judgment Documents "defendants ≥3 and defendant ratio ≥70%"
- ⚪ Signal: 882 Court Announcement / 744 Judicial Auction / 888 Court Hearing / 889 Case Filing (informational, not directly rated)
This is a conservative criterion from a "credit/guarantee business" perspective. Other business scenarios (pre-investment, compliance screening, supplier background checks) may require a custom rating table — simply modify
_build_risk_summary().
Signature Rules (already encapsulated in client.py, no manual calculation needed)
- Header
Token=MD5(appkey + Timespan + SecretKey).upper()(32-bit uppercase) - Header
Timespan= Unix seconds - Query
key= appkey - All GET
Cache Strategy
- Enabled by default; TTL is tiered by data timeliness (business registration 30-60 days / judicial 7 days / public opinion 3 days)
- For the same enterprise's same API within the TTLFree from the second time onward
- When the user says "re-query / fetch the latest / no cache", use
use_cache=False - Negative results (keyword no match)Do not write to cache, to avoid long-term caching of "not found"
Error categorization (QccError.kind)
After catching QccErrorprefer to use e.friendly() — it returns a string with a Chinese label + action suggestions, which can be passed directly to the user:
try:
r = fetch("741", keyword="腾讯")
except QccError as e:
user_message = e.friendly() # 例如:
# [接口未开通] [741 被执行人核查] Status=403 接口未开通
# → 这个接口在企查查后台还没申请开通。去 https://openapi.qcc.com/dataApi/741
# 点'申请开通',通过后跑 `python setup.py mark-opened 741`。
| kind | Meaning | Suggested direction for friendly advice |
|---|---|---|
creds |
Wrong credentials/wrong signature/missing required parameter | Run python setup.py to re-enter |
not_opened |
ApiCode not activated under the appkey | After applying for activation, run python setup.py mark-opened <code> |
no_result |
Keyword no match (normal business case) | Use 886 fuzzy search to get the full name; or use the Unified Social Credit Code |
rate_limit |
Rate limiting | Wait 1-2 minutes; contact Qichacha business team frequently to increase QPS |
network |
DNS/timeout/proxy | See TROUBLESHOOTING.md for details |
unknown |
Other | Paste r.raw to the user + guide them to see TROUBLESHOOTING.md |
Notes
- Enterprise full name must be precise: fuzzy matching behaves differently across APIs; first use 886 to get the
KeyNoor the complete full name before calling other APIs - Unified Social Credit Code as fallback: when matching is unstable due to special characters such as full-width parentheses in the enterprise name, use the credit code instead of
keyword - Cache hash is irreversible: the directory name is a truncated MD5, so the enterprise name cannot be reverse-looked-up; to clear cache by enterprise you must keep your own mapping records
- Negotiable-price APIs: actual controller/equity penetration/enterprise graph/beneficial owner/financial and tax data, etc. require contacting 400-088-8275 for separate pricing
- API activation is applied for one by one: Qichacha does not let you use all 45 APIs just by activating; each API requires clicking "Apply for Activation" at openapi.qcc.com/dataApi/{code}, which may involve secondary review or a price increase. After activation, use
python setup.py mark-opened <code>to tell the skill - Cross-platform: the script has zero third-party dependencies; copy the entire skill directory + credentials file to run on Mac/Windows/Linux