Pro endpoint · Pro

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.

ProGET /v1/agent-search
Signature
GET /v1/agent-search?q=%E5%A4%AA%E6%9E%81%E5%AE%9E%E4%B8%9A&scope=
One-liner
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"
Parameters: q * · scope · depth · max_results · clarify · claim · replay · authority_min · recency* = required

Quick start

Replace the key below with yours (free endpoints need no key):

curl
# 注: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"
Python
import requests

r = requests.get(
    "https://api.ashareapi.com/v1/agent-search",
    headers={"Authorization": "Bearer YOUR_KEY"},
    params={"q": "太极实业"},
    timeout=30,
)
print(r.json())
JavaScript
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

qstringYes
Keyword: a stock name (Chinese works) or a code
scopestring
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.
depthstring
Depth: fast / standard (default) / deep — controls the time and tool-call budget.
max_resultsinteger
Maximum number of result rows (default 10, max 50).
clarifyboolean
Only disambiguate the symbol; do not fetch data (returns 1–4 options with explanations).
claimstring
The assertion text to verify (optional). Only when provided can the result be marked contradicted.
replayboolean
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_minnumber
Minimum authority score (0–1). Rows below it are filtered out; the number dropped is echoed in dropped_by_authority.
recencystring
Time window, e.g. 7d / 24h (optional). Out-of-window items are still returned but marked unverified.

Response 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.

Located in: dataEnvelope: ok / endpoint / tier / elapsed_ms / sourceProbed: 2026-10-20
FieldTypeReal sample value
ranknum1
source_typestrashare_api
source_endpointstr/fund
source_params_jsonstr{"code": "sz300750"}
field_pathstrmain_net
valuestr-1294791163.00
readablestr-12.95 亿元
unitstr亿元
rulestrvalue / 1e+08,保留 2 位小数(可反算回原值)
value_hashstrbd545a6f7677b695
hash_algstrsha256-v1
as_ofstr2026-10-21
subjectstr宁德时代
subject_codestrsz300750
authority_scorenum0.95
authority_reasonstrdata_point(base=1.0) × source_kind(0.95) × cov…
authority_sourcestrauthority.py
authority_parts—
upstream_authoritynull—
evidence—
datestr2026-10-21
Response

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.

Rate limits & quota

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)

Do these endpoints need an API key?

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.

Am I charged when the upstream returns nothing or errors?

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.

How fresh is the data?

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.

Can I request several stocks in one call?

No. code is a single-value parameter — one stock per call. For batches, issue concurrent calls and respect your tier per-minute limit.

How do I use this from Claude / Cursor / ChatGPT?

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.

Use it from an AI Agent?

Set up MCP once, then just ask the AI — it calls the endpoint itself.

← Back to the full endpoint reference