[{"data":1,"prerenderedAt":309},["ShallowReactive",2],{"docs-page-auth":3},{"_path":4,"_dir":5,"_draft":6,"_partial":6,"_locale":7,"title":8,"description":9,"body":10,"_type":303,"_id":304,"_source":305,"_file":306,"_stem":307,"_extension":308},"\u002Fdocs\u002Fauth","docs",false,"","鉴权与权限","API Key、scope、K 线策略与限流",{"type":11,"children":12,"toc":293},"root",[13,22,45,75,96,102,120,127,163,169,197,203,246,252,287],{"type":14,"tag":15,"props":16,"children":18},"element","h2",{"id":17},"鉴权-auth",[19],{"type":20,"value":21},"text","鉴权 {#auth}",{"type":14,"tag":23,"props":24,"children":25},"p",{},[26,28,35,37,43],{"type":20,"value":27},"除 ",{"type":14,"tag":29,"props":30,"children":32},"code",{"className":31},[],[33],{"type":20,"value":34},"GET \u002Fv1\u002Fhealth",{"type":20,"value":36},"、本文档与 ",{"type":14,"tag":29,"props":38,"children":40},{"className":39},[],[41],{"type":20,"value":42},"\u002Fpublic\u002Fv1\u002F*",{"type":20,"value":44}," 元数据外，数据接口均需 API Key。",{"type":14,"tag":46,"props":47,"children":51},"pre",{"className":48,"code":49,"language":50,"meta":7,"style":7},"language-http shiki shiki-themes github-dark","GET \u002Fv1\u002Frealtime?symbol=603778.SS\nX-API-Key: tg_xxxxxxxxxxxxxxxxxxxxxxxx\n","http",[52],{"type":14,"tag":29,"props":53,"children":54},{"__ignoreMap":7},[55,66],{"type":14,"tag":56,"props":57,"children":60},"span",{"class":58,"line":59},"line",1,[61],{"type":14,"tag":56,"props":62,"children":63},{},[64],{"type":20,"value":65},"GET \u002Fv1\u002Frealtime?symbol=603778.SS\n",{"type":14,"tag":56,"props":67,"children":69},{"class":58,"line":68},2,[70],{"type":14,"tag":56,"props":71,"children":72},{},[73],{"type":20,"value":74},"X-API-Key: tg_xxxxxxxxxxxxxxxxxxxxxxxx\n",{"type":14,"tag":23,"props":76,"children":77},{},[78,80,86,88,94],{"type":20,"value":79},"也支持查询参数 ",{"type":14,"tag":29,"props":81,"children":83},{"className":82},[],[84],{"type":20,"value":85},"?api_key=tg_xxx",{"type":20,"value":87},"（不推荐，易泄露到日志）。Key 在用户中心签发，",{"type":14,"tag":89,"props":90,"children":91},"strong",{},[92],{"type":20,"value":93},"完整 Key 仅显示一次",{"type":20,"value":95},"。",{"type":14,"tag":15,"props":97,"children":99},{"id":98},"权限说明-permissions",[100],{"type":20,"value":101},"权限说明 {#permissions}",{"type":14,"tag":23,"props":103,"children":104},{},[105,107,112,114,119],{"type":20,"value":106},"权限分两层：",{"type":14,"tag":89,"props":108,"children":109},{},[110],{"type":20,"value":111},"接口权限（scope）",{"type":20,"value":113}," 与 ",{"type":14,"tag":89,"props":115,"children":116},{},[117],{"type":20,"value":118},"K 线数据策略",{"type":20,"value":95},{"type":14,"tag":121,"props":122,"children":124},"h3",{"id":123},"接口权限-permissions-scopes",[125],{"type":20,"value":126},"接口权限 {#permissions-scopes}",{"type":14,"tag":23,"props":128,"children":129},{},[130,132,138,140,146,148,154,156,162],{"type":20,"value":131},"未开通相应 scope 时返回 ",{"type":14,"tag":29,"props":133,"children":135},{"className":134},[],[136],{"type":20,"value":137},"403",{"type":20,"value":139},"。各套餐接口差异见 ",{"type":14,"tag":29,"props":141,"children":143},{"className":142},[],[144],{"type":20,"value":145},"GET \u002Fpublic\u002Fv1\u002Fcatalog",{"type":20,"value":147}," 的 ",{"type":14,"tag":29,"props":149,"children":151},{"className":150},[],[152],{"type":20,"value":153},"scope_rows",{"type":20,"value":155},"（含各档位 ✓\u002F— 对照）与 ",{"type":14,"tag":29,"props":157,"children":159},{"className":158},[],[160],{"type":20,"value":161},"tier_columns",{"type":20,"value":95},{"type":14,"tag":121,"props":164,"children":166},{"id":165},"k-线数据策略-permissions-kline",[167],{"type":20,"value":168},"K 线数据策略 {#permissions-kline}",{"type":14,"tag":23,"props":170,"children":171},{},[172,174,180,182,188,190,195],{"type":20,"value":173},"在拥有 ",{"type":14,"tag":29,"props":175,"children":177},{"className":176},[],[178],{"type":20,"value":179},"kline",{"type":20,"value":181}," scope 的前提下，限制可请求的周期、条数、复权方式与技术指标。超出套餐上限时条数会自动裁切。",{"type":14,"tag":29,"props":183,"children":185},{"className":184},[],[186],{"type":20,"value":187},"GET \u002Fv1\u002Fme",{"type":20,"value":189}," 可查看当前 Key 的 ",{"type":14,"tag":29,"props":191,"children":193},{"className":192},[],[194],{"type":20,"value":179},{"type":20,"value":196}," 摘要。",{"type":14,"tag":121,"props":198,"children":200},{"id":199},"账号状态-permissions-account",[201],{"type":20,"value":202},"账号状态 {#permissions-account}",{"type":14,"tag":204,"props":205,"children":206},"ul",{},[207,218,229],{"type":14,"tag":208,"props":209,"children":210},"li",{},[211,213],{"type":20,"value":212},"用户中心「接口测试」无有效 Key → ",{"type":14,"tag":29,"props":214,"children":216},{"className":215},[],[217],{"type":20,"value":137},{"type":14,"tag":208,"props":219,"children":220},{},[221,223],{"type":20,"value":222},"账号已过期 → ",{"type":14,"tag":29,"props":224,"children":226},{"className":225},[],[227],{"type":20,"value":228},"401",{"type":14,"tag":208,"props":230,"children":231},{},[232,234,239,241],{"type":20,"value":233},"账号或 Key 已禁用 → ",{"type":14,"tag":29,"props":235,"children":237},{"className":236},[],[238],{"type":20,"value":228},{"type":20,"value":240}," \u002F ",{"type":14,"tag":29,"props":242,"children":244},{"className":243},[],[245],{"type":20,"value":137},{"type":14,"tag":15,"props":247,"children":249},{"id":248},"限流规则-rate-limit",[250],{"type":20,"value":251},"限流规则 {#rate-limit}",{"type":14,"tag":23,"props":253,"children":254},{},[255,257,262,264,270,272,278,280,286],{"type":20,"value":256},"采用",{"type":14,"tag":89,"props":258,"children":259},{},[260],{"type":20,"value":261},"每分钟固定窗口",{"type":20,"value":263},"计数：全局限流（账号下所有接口合计）与各 scope 分接口限流。触发限流返回 ",{"type":14,"tag":29,"props":265,"children":267},{"className":266},[],[268],{"type":20,"value":269},"429",{"type":20,"value":271},"，响应含 ",{"type":14,"tag":29,"props":273,"children":275},{"className":274},[],[276],{"type":20,"value":277},"retry_after",{"type":20,"value":279},"（秒），Header 含 ",{"type":14,"tag":29,"props":281,"children":283},{"className":282},[],[284],{"type":20,"value":285},"Retry-After",{"type":20,"value":95},{"type":14,"tag":288,"props":289,"children":290},"style",{},[291],{"type":20,"value":292},"html .default .shiki span {color: var(--shiki-default);background: var(--shiki-default-bg);font-style: var(--shiki-default-font-style);font-weight: var(--shiki-default-font-weight);text-decoration: var(--shiki-default-text-decoration);}html .shiki span {color: var(--shiki-default);background: var(--shiki-default-bg);font-style: var(--shiki-default-font-style);font-weight: var(--shiki-default-font-weight);text-decoration: var(--shiki-default-text-decoration);}",{"title":7,"searchDepth":68,"depth":68,"links":294},[295,296,302],{"id":17,"depth":68,"text":21},{"id":98,"depth":68,"text":101,"children":297},[298,300,301],{"id":123,"depth":299,"text":126},3,{"id":165,"depth":299,"text":168},{"id":199,"depth":299,"text":202},{"id":248,"depth":68,"text":251},"markdown","content:docs:auth.md","content","docs\u002Fauth.md","docs\u002Fauth","md",1783730014369]