Natural-language search with evidence chain (for your own orchestration) API
⭐ Natural language → structured candidates with an evidence chain, for you to orchestrate yourself. We do not generate an answer — you get "structured results + evidence metadata". How it differs from other endpoints: you do not need to know which endpoint to call first — just ask in plain language; we resolve the symbol and intent, then fetch. Every row carries an evidence object: endpoint / params / field_path / value / value_hash (16 chars) / hash_alg. Re-fetch with the same endpoint + params, recompute sha256 over the same record, and you should get the same value_hash — you do not have to trust us. ⚠️ Paid tier — Standard (¥29.9) and above. ⭐ scope (optional): ashare (our own data) · notice,news,report (filings / news / research) · web (open-web search, requires X-LLM-Key) · wechat (WeChat Official Accounts). ⚠️ With an explicit scope=web/wechat, only that channel is searched — if nothing is found you get an honest ok:false with the reason, never a silent substitute from another channel. ⭐ Web/WeChat rows also carry rerank_score (0–3, ≥1.5 is good) + quality (good/fair), plus sentence-level start_char/end_char. ⭐ replay=true runs one extra model pass to reconcile the output, marking match / non_deterministic / not_replayable / skipped_no_client — off by default; ⚠️ on the model path it is usually non_deterministic, which does not mean the conclusion is unreliable.
GET /v1/agent-searchGET /v1/agent-search?q=%E5%A4%AA%E6%9E%81%E5%AE%9E%E4%B8%9A&scope=curl "https://api.ashareapi.com/v1/agent-search?q=%E5%A4%AA%E6%9E%81%E5%AE%9E%E4%B8%9A&scope=&key=YOUR_KEY"q * · scope · depth · max_results · clarify · claim · replay · authority_min · recency* = requiredQuick start
Replace the key below with yours (free endpoints need no key):
# 注:q 的值已做 URL 编码(含 [ ] 空格 等)
# 推荐:Authorization 头(密钥不进日志)
curl -H "Authorization: Bearer YOUR_KEY" \
"https://api.ashareapi.com/v1/agent-search?q=%E5%A4%AA%E6%9E%81%E5%AE%9E%E4%B8%9A&scope="
# 快速测试:直接浏览器打开(?key= 会留在日志/历史里,别用于生产)
curl "https://api.ashareapi.com/v1/agent-search?q=%E5%A4%AA%E6%9E%81%E5%AE%9E%E4%B8%9A&scope=&key=YOUR_KEY"import requests
r = requests.get(
"https://api.ashareapi.com/v1/agent-search",
headers={"Authorization": "Bearer YOUR_KEY"},
params={"q": "太极实业"},
timeout=30,
)
print(r.json())const r = await fetch("https://api.ashareapi.com/v1/agent-search?q=%E5%A4%AA%E6%9E%81%E5%AE%9E%E4%B8%9A&scope=", {
headers: { Authorization: "Bearer YOUR_KEY" },
});
console.log(await r.json());Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
| q | string | Yes | Keyword: a stock name (Chinese works) or a code |
| scope | string | No | Data-source scope (optional): ashare (our own data) / notice,news,report (filings & news) / web (open-web search, needs X-LLM-Key) / wechat (WeChat Official Accounts). Blank = auto-select by the question. |
| depth | string | No | Depth: fast / standard (default) / deep — controls the time and tool-call budget. |
| max_results | integer | No | Maximum number of result rows (default 10, max 50). |
| clarify | boolean | No | Only disambiguate the symbol; do not fetch data (returns 1–4 options with explanations). |
| claim | string | No | The assertion text to verify (optional). Only when provided can the result be marked contradicted. |
| replay | boolean | No | Replay reconciliation (optional, default false). Runs one extra model pass and compares the output: match / non_deterministic / not_replayable / skipped_no_client. ⚠️ On the model path it is usually non_deterministic — this does not mean the conclusion is unreliable. |
| authority_min | number | No | Minimum authority score (0–1). Rows below it are filtered out; the number dropped is echoed in dropped_by_authority. |
| recency | string | No | Time window, e.g. 7d / 24h (optional). Out-of-window items are still returned but marked unverified. |
qstringYesscopestringdepthstringmax_resultsintegerclarifybooleanclaimstringreplaybooleanauthority_minnumberrecencystringResponse fields
The table below is captured from real API calls (not inferred): each row gives the field name, its type and one real sample value, so you can align your parser.
dataEnvelope: ok / endpoint / tier / elapsed_ms / sourceProbed: 2026-10-20| Field | Type | Real sample value |
|---|---|---|
| rank | num | 1 |
| source_type | str | ashare_api |
| source_endpoint | str | /fund |
| source_params_json | str | {"code": "sz300750"} |
| field_path | str | main_net |
| value | str | -1294791163.00 |
| readable | str | -12.95 亿元 |
| unit | str | 亿元 |
| rule | str | value / 1e+08,保留 2 位小数(可反算回原值) |
| value_hash | str | bd545a6f7677b695 |
| hash_alg | str | sha256-v1 |
| as_of | str | 2026-10-21 |
| subject | str | 宁德时代 |
| subject_code | str | sz300750 |
| authority_score | num | 0.95 |
| authority_reason | str | data_point(base=1.0) × source_kind(0.95) × cov… |
| authority_source | str | authority.py |
| authority_parts | — | |
| upstream_authority | null | — |
| evidence | — | |
| date | str | 2026-10-21 |
Unified envelope: { ok, endpoint, tier, elapsed_ms, source, data }
Rows live in data; when upstream returns nothing you get ok:false and the call is not counted.
Free endpoints need no key (anonymous 5/min — 250 bars per request, 100k rows per day; solve one PoW challenge for 15/min). Paid tiers: Trial 30 · Standard 120 · Pro 300 · Unlimited 600 per minute; buyout packs are capped by total calls and never expire.
See the error code table →FAQ
General (applies to every endpoint)
Free endpoints do not: health, challenge, quote, kline, hot, market-overview and changedist work anonymously. Paid endpoints do: send Authorization: Bearer <your key>. ⚠️ The anonymous allowance is tiered by caller type: browsers (humans) get 5/min; scripts, SDKs and AI Agents (curl, requests, axios, openai user-agent strings) get 2/min — automated traffic is easier to abuse. Solving one PoW challenge (GET /v1/challenge, then send the X-PoW header) raises it to 15/min regardless of type. ⚠️ Also, anonymous calls are capped at 250 bars per request and 100k rows per day — use an API key for the full 1212 bars or unlimited daily volume.
No. When the upstream fails or returns nothing you get ok:false and the charge for that call is refunded (total_calls / usage_log / ep_log are rolled back together). Only calls that actually returned data count.
Quotes (quote / kline / orderbook / changedist) are real-time or current session; financials, shareholders, dividends and events are within T+1 of upstream disclosure. The source field in every response tells you which data channel actually served it.
No. code is a single-value parameter — one stock per call. For batches, issue concurrent calls and respect your tier per-minute limit.
Set up MCP once, then just ask the AI — it calls the endpoint itself. MCP exposes 39 tools covering quotes, financials, screening, sectors and macro.
Related endpoints
Set up MCP once, then just ask the AI — it calls the endpoint itself.