From 01e2dffb16a204ef185f6fe65713a831603abfc2 Mon Sep 17 00:00:00 2001 From: zhuhao Date: Tue, 1 Sep 2026 21:59:02 +0800 Subject: [PATCH 1/2] =?UTF-8?q?feat:=20=E5=90=8C=E6=AD=A5=E5=85=AC?= =?UTF-8?q?=E5=BC=80=E6=8E=A5=E5=8F=A3=E5=B9=B6=E5=8D=87=E7=BA=A7=20SDK=20?= =?UTF-8?q?=E8=87=B3=201.0.0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - 按公开接口文档更新 API mixin、Endpoint 注册表及 API Reference - 统一接口调用为 GET 查询参数传输 - 增加 FTSHARE_API_KEY 参数及环境变量鉴权支持 - 移除未发布接口及相关实现 - 更新接口契约、客户端行为测试和 SDK 版本号 --- docs/API_REFERENCE.md | 4410 +++++++++----------------- pyproject.toml | 2 +- src/ftshare/__init__.py | 10 +- src/ftshare/apis/__init__.py | 2 - src/ftshare/apis/bond.py | 141 +- src/ftshare/apis/economic.py | 126 +- src/ftshare/apis/etf.py | 176 +- src/ftshare/apis/forex.py | 35 - src/ftshare/apis/fund.py | 117 - src/ftshare/apis/futures.py | 382 +-- src/ftshare/apis/hk.py | 759 +---- src/ftshare/apis/index.py | 89 +- src/ftshare/apis/llm_corpus.py | 61 +- src/ftshare/apis/spot.py | 35 - src/ftshare/apis/stock.py | 2010 +++--------- src/ftshare/apis/unpublished.py | 192 -- src/ftshare/apis/us.py | 456 --- src/ftshare/base.py | 59 +- src/ftshare/client.py | 7 +- src/ftshare/endpoints/__init__.py | 2 - src/ftshare/endpoints/bond.py | 53 +- src/ftshare/endpoints/economic.py | 58 + src/ftshare/endpoints/etf.py | 61 +- src/ftshare/endpoints/forex.py | 6 - src/ftshare/endpoints/fund.py | 16 +- src/ftshare/endpoints/futures.py | 102 +- src/ftshare/endpoints/hk.py | 106 +- src/ftshare/endpoints/index.py | 39 +- src/ftshare/endpoints/llm_corpus.py | 13 +- src/ftshare/endpoints/spot.py | 6 - src/ftshare/endpoints/stock.py | 522 +-- src/ftshare/endpoints/unpublished.py | 39 - src/ftshare/endpoints/us.py | 60 - tests/endpoint_cases.py | 161 +- tests/test_client.py | 362 +-- tests/test_endpoint_contracts.py | 50 +- 36 files changed, 2835 insertions(+), 7890 deletions(-) delete mode 100644 src/ftshare/apis/unpublished.py delete mode 100644 src/ftshare/endpoints/unpublished.py diff --git a/docs/API_REFERENCE.md b/docs/API_REFERENCE.md index 8f4d3e9..c9bfe94 100644 --- a/docs/API_REFERENCE.md +++ b/docs/API_REFERENCE.md @@ -1,46 +1,29 @@ # FTShare Python SDK API Reference -本文档由 SDK 方法 docstring 和 `ftshare.endpoints.ENDPOINTS` 生成。接口分组与 `ftshare-doc/api-doc` 顶层专题保持一致。 +本文档由 SDK 公开方法和 `ftshare.endpoints.ENDPOINTS` 生成。 ## 汇总 | 指标 | 数量 | |---|---:| -| SDK 方法总数 | 217 | +| SDK 方法总数 | 193 | ## 专题分布 -接口分组、`src/ftshare/apis/` 方法模块和 `src/ftshare/endpoints/` 注册表模块均按 `ftshare-doc/api-doc` 顶层专题对齐。 - | ftshare-doc 专题 | SDK 方法数 | API mixin 模块 | Endpoint 模块 | |---|---:|---|---| -| 股票数据 | 106 | `ftshare.apis.stock` | `ftshare.endpoints.stock` | -| 港股数据 | 15 | `ftshare.apis.hk` | `ftshare.endpoints.hk` | -| 美股数据 | 9 | `ftshare.apis.us` | `ftshare.endpoints.us` | -| 指数专题 | 10 | `ftshare.apis.index` | `ftshare.endpoints.index` | +| 股票数据 | 103 | `ftshare.apis.stock` | `ftshare.endpoints.stock` | +| 港股数据 | 2 | `ftshare.apis.hk` | `ftshare.endpoints.hk` | +| 美股数据 | 1 | `ftshare.apis.us` | `ftshare.endpoints.us` | +| 指数专题 | 12 | `ftshare.apis.index` | `ftshare.endpoints.index` | | ETF专题 | 10 | `ftshare.apis.etf` | `ftshare.endpoints.etf` | -| 公募基金 | 20 | `ftshare.apis.fund` | `ftshare.endpoints.fund` | +| 公募基金 | 18 | `ftshare.apis.fund` | `ftshare.endpoints.fund` | | 期货数据 | 14 | `ftshare.apis.futures` | `ftshare.endpoints.futures` | -| 债券专题 | 4 | `ftshare.apis.bond` | `ftshare.endpoints.bond` | -| 宏观经济 | 17 | `ftshare.apis.economic` | `ftshare.endpoints.economic` | -| 大模型语料 | 5 | `ftshare.apis.llm_corpus` | `ftshare.endpoints.llm_corpus` | -| 现货数据 | 2 | `ftshare.apis.spot` | `ftshare.endpoints.spot` | -| 外汇数据 | 1 | `ftshare.apis.forex` | `ftshare.endpoints.forex` | -| 未发布 | 4 | `ftshare.apis.unpublished` | `ftshare.endpoints.unpublished` | - -## 使用方式 - -```python -import ftshare as ft - -market = ft.market_api() -df = market.baidu_financial_calendar( - start_date="2026-05-26", - end_date="2026-05-27", - category="economic", - limit=5, -) -``` +| 债券专题 | 5 | `ftshare.apis.bond` | `ftshare.endpoints.bond` | +| 宏观经济 | 23 | `ftshare.apis.economic` | `ftshare.endpoints.economic` | +| 大模型语料 | 4 | `ftshare.apis.llm_corpus` | `ftshare.endpoints.llm_corpus` | +| 现货数据 | 1 | `ftshare.apis.spot` | `ftshare.endpoints.spot` | +| 外汇数据 | 0 | `ftshare.apis.forex` | `ftshare.endpoints.forex` | ## 接口索引 @@ -48,156 +31,134 @@ df = market.baidu_financial_calendar( | SDK 方法 | 接口名称 | HTTP | Path | 参数 | 来源文档 | |---|---|---|---|---|---| -| [`abnormal_trading_details`](#api-abnormal-trading-details) | 龙虎榜明细 | `GET` | `api/v1/market/data/abnormal-trading-details` | `date` | `龙虎榜明细.md` | -| [`abnormal_trading_overview`](#api-abnormal-trading-overview) | 龙虎榜总览 | `GET` | `api/v1/market/data/abnormal-trading-overview` | `date` | `龙虎榜总览.md` | -| [`auction_results`](#api-auction-results) | 集合竞价结果 | `GET` | `api/v1/market/data/auction-results` | `ts_code`, `trade_date`, `start_date`, `end_date`, `page`, `page_size` | `集合竞价结果.md` | +| [`abnormal_trading_details`](#api-abnormal-trading-details) | 龙虎榜明细 | `GET` | `api/v1/market/data/abnormal-trading-details` | `date`, `page`, `page_size` | `龙虎榜明细.md` | +| [`abnormal_trading_overview`](#api-abnormal-trading-overview) | 龙虎榜总览 | `GET` | `api/v1/market/data/abnormal-trading-overview` | `date`, `page`, `page_size` | `龙虎榜总览.md` | +| [`ashare_interactions`](#api-ashare-interactions) | e互动 | `GET` | `api/v3/market/data/ashare-interactions` | `start_date`, `end_date`, `trade_code`, `company_name`, `industry_code`, `industry_name`, `data_source`, `page`, `page_size` | `e互动.md` | +| [`ashare_news_sentiment_factors`](#api-ashare-news-sentiment-factors) | A股新闻情绪因子 | `GET` | `api/v3/market/data/ashare-news-sentiment-factors` | `trade_code`, `start_date`, `end_date`, `page`, `page_size` | `A股新闻情绪因子.md` | +| [`ashare_rating_factor_snapshot`](#api-ashare-rating-factor-snapshot) | A股相关性 Top-K | `GET` | `api/v3/market/data/ashare-rating-factor-snapshot` | `trade_code`, `date`, `top_k` | `A股相关性Top-K.md` | +| [`auction_results`](#api-auction-results) | 集合竞价结果 | `GET` | `api/v2/market/data/auction-results` | `ts_code`, `trade_date`, `start_date`, `end_date`, `page`, `page_size` | `集合竞价结果.md` | | [`balance`](#api-balance) | A股资产负债表 | `GET` | `api/v1/market/data/finance/balance` | `stock_code`, `year`, `report_type`, `page`, `page_size` | `A股资产负债表.md` | -| [`block_trades`](#api-block-trades) | 大宗交易 | `GET` | `api/v1/market/data/block-trades` | `date` | `大宗交易.md` | +| [`block_trades`](#api-block-trades) | 大宗交易 | `GET` | `api/v1/market/data/block-trades` | `date`, `page`, `page_size` | `大宗交易.md` | | [`bse_mapping`](#api-bse-mapping) | 北交所映射 | `GET` | `api/v1/market/data/bse-mapping` | `o_code`, `n_code` | `北交所映射.md` | | [`cashflow`](#api-cashflow) | A股现金流量表 | `GET` | `api/v1/market/data/finance/cashflow` | `stock_code`, `year`, `report_type`, `page`, `page_size` | `A股现金流量表.md` | -| [`cashflow_stock_code`](#api-cashflow-stock-code) | 现金流支持股票代码 | `GET` | `api/v1/market/data/finance/cashflow-stock-code` | - | `现金流支持股票代码.md` | +| [`cashflow_stock_code`](#api-cashflow-stock-code) | 现金流支持股票代码 | `GET` | `api/v2/market/data/finance/cashflow-stock-code` | - | `现金流支持股票代码.md` | | [`company_list`](#api-company-list) | 公司列表 | `GET` | `api/v1/market/data/company-list` | `stock_name`, `stock_code`, `page`, `page_size` | `公司列表.md` | -| [`daec_ohlcs`](#api-daec-ohlcs) | DAEC历史OHLC | `GET` | `api/v1/market/data/daec/history/ohlcs` | `symbol`, `since`, `until`, `interval`, `adjust`, `compat`, `span`, `limit`, `until_ts_ms` | `DAEC历史OHLC.md` | | [`earnings_reports_paginated`](#api-earnings-reports-paginated) | 业绩快报 | `GET` | `api/v1/market/data/finance/stock-performance-express` | `stock_code`, `year`, `report_type`, `page`, `page_size` | `业绩快报.md` | -| [`eastmoney_board_constituents`](#api-eastmoney-board-constituents) | 东方财富板块成份股 | `GET` | `api/v1/market/data/eastmoney-board-constituents` | `board_code` | `东方财富板块成份股.md` | -| [`eastmoney_all_board_daily_kline`](#api-eastmoney-all-board-daily-kline) | 东方财富全板块日线OHLC | `GET` | `api/v1/market/data/eastmoney-all-board-daily-ohlc` | `start_date`, `end_date`, `page`, `page_size` | `东方财富全板块日线OHLC.md` | -| [`eastmoney_board_daily_kline`](#api-eastmoney-board-daily-kline) | 东方财富板块日线OHLC | `GET` | `api/v1/market/data/eastmoney-board-daily-ohlc` | `board_code`, `start_date`, `end_date`, `page`, `page_size` | `东方财富板块日线OHLC.md` | -| [`eastmoney_board_latest_kline`](#api-eastmoney-board-latest-kline) | 东方财富板块最新OHLC | `GET` | `api/v1/market/data/eastmoney-board-latest-ohlc` | `board_code`, `page`, `page_size` | `东方财富板块最新OHLC.md` | -| [`eastmoney_concept_boards`](#api-eastmoney-concept-boards) | 东方财富概念板块 | `GET` | `api/v1/market/data/eastmoney-concept-boards` | - | `东方财富概念板块.md` | -| [`eastmoney_dapan_flow`](#api-eastmoney-dapan-flow) | 东方财富大盘资金流 | `GET` | `api/v1/market/data/eastmoney-dapan-flow` | `trade_date`, `start_date`, `end_date`, `page`, `page_size` | `东方财富大盘资金流.md` | +| [`eastmoney_board_constituents`](#api-eastmoney-board-constituents) | 东方财富板块成份股 | `GET` | `api/v2/market/data/eastmoney-board-constituents` | `board_code` | `东方财富板块成份股.md` | +| [`eastmoney_board_daily_kline`](#api-eastmoney-board-daily-kline) | 东方财富板块日线OHLC | `GET` | `api/v2/market/data/eastmoney-board-daily-ohlc` | `board_code`, `start_date`, `end_date`, `page`, `page_size` | `东方财富板块日线OHLC.md` | +| [`eastmoney_concept_boards`](#api-eastmoney-concept-boards) | 东方财富概念板块 | `GET` | `api/v2/market/data/eastmoney-concept-boards` | - | `东方财富概念板块.md` | +| [`eastmoney_dapan_flow`](#api-eastmoney-dapan-flow) | 东方财富大盘资金流 | `GET` | `api/v2/market/data/eastmoney-dapan-flow` | `trade_date`, `start_date`, `end_date`, `page`, `page_size` | `东方财富大盘资金流.md` | | [`eastmoney_market_valuation`](#api-eastmoney-market-valuation) | 东方财富市场估值 | `GET` | `api/v1/market/data/eastmoney-market-valuation` | `market_code`, `trade_date`, `start_date`, `end_date`, `page`, `page_size` | `东方财富市场估值.md` | -| [`eastmoney_rank`](#api-eastmoney-rank) | 东方财富股票排名 | `GET` | `api/v1/market/data/eastmoney-rank` | `rank_group`, `market`, `trade_date` | `东方财富股票排名.md` | -| [`eastmoney_sector_flow`](#api-eastmoney-sector-flow) | 东方财富板块资金流 | `GET` | `api/v1/market/data/eastmoney-sector-flow` | `sector_code`, `sector_type`, `trade_date`, `start_date`, `end_date`, `page`, `page_size` | `东方财富板块资金流.md` | +| [`eastmoney_rank`](#api-eastmoney-rank) | 东方财富股票排名 | `GET` | `api/v2/market/data/eastmoney-rank` | `rank_group`, `market`, `trade_date` | `东方财富股票排名.md` | +| [`eastmoney_sector_flow`](#api-eastmoney-sector-flow) | 东方财富板块资金流 | `GET` | `api/v2/market/data/eastmoney-sector-flow` | `sector_code`, `sector_type`, `trade_date`, `start_date`, `end_date`, `page`, `page_size` | `东方财富板块资金流.md` | | [`eastmoney_stock_flow`](#api-eastmoney-stock-flow) | 东方财富个股资金流 | `GET` | `api/v1/market/data/eastmoney-stock-flow` | `symbol`, `trade_date`, `start_date`, `end_date`, `page`, `page_size` | `东方财富个股资金流.md` | | [`eastmoney_stock_valuation`](#api-eastmoney-stock-valuation) | 东方财富个股估值 | `GET` | `api/v1/market/data/eastmoney-stock-valuation` | `symbol`, `trade_date`, `start_date`, `end_date`, `page`, `page_size` | `东方财富个股估值.md` | +| [`exchange_margin_summaries`](#api-exchange-margin-summaries) | 交易所融资融券汇总日度 | `GET` | `api/v1/market/data/exchange-margin-summaries` | `start_date`, `end_date`, `exchange`, `page`, `page_size` | `交易所融资融券汇总日度.md` | | [`goodwill_industry`](#api-goodwill-industry) | 商誉行业 | `GET` | `api/v1/market/data/goodwill/industry` | `date`, `page`, `page_size` | `商誉行业.md` | | [`goodwill_market_overview`](#api-goodwill-market-overview) | 商誉市场总览 | `GET` | `api/v1/market/data/goodwill/market-overview` | - | `商誉市场总览.md` | | [`goodwill_predict`](#api-goodwill-predict) | 商誉预测 | `GET` | `api/v1/market/data/goodwill/predict` | `date`, `page`, `page_size` | `商誉预测.md` | | [`goodwill_stock_detail`](#api-goodwill-stock-detail) | 商誉个股明细 | `GET` | `api/v1/market/data/goodwill/stock-detail` | `date`, `page`, `page_size` | `商誉个股明细.md` | | [`goodwill_stock_impairment`](#api-goodwill-stock-impairment) | 商誉减值 | `GET` | `api/v1/market/data/goodwill/stock-impairment` | `date`, `page`, `page_size` | `商誉减值.md` | -| [`hk_sh_stock_connect_members`](#api-hk-sh-stock-connect-members) | 沪港通成份 | `GET` | `api/v1/market/data/hk-sh-stock-connect-members` | - | `沪港通成份.md` | -| [`hk_sz_stock_connect_members`](#api-hk-sz-stock-connect-members) | 深港通成份 | `GET` | `api/v1/market/data/hk-sz-stock-connect-members` | - | `深港通成份.md` | | [`income`](#api-income) | A股利润表 | `GET` | `api/v1/market/data/finance/income` | `stock_code`, `year`, `report_type`, `page`, `page_size` | `A股利润表.md` | -| [`limit_down_pool`](#api-limit-down-pool) | 跌停池 | `GET` | `api/v1/market/data/limit-down-pool` | `trade_date` | `跌停池.md` | -| [`limit_event_timeline_3s`](#api-limit-event-timeline-3s) | 涨跌停事件时间线 | `GET` | `api/v1/market/data/limit-event-timeline-3s` | `symbol`, `trade_date` | `涨跌停事件时间线.md` | -| [`limit_up_break_pool`](#api-limit-up-break-pool) | 炸板池 | `GET` | `api/v1/market/data/limit-up-break-pool` | `trade_date` | `炸板池.md` | -| [`limit_up_pool`](#api-limit-up-pool) | 涨停池 | `GET` | `api/v1/market/data/limit-up-pool` | `trade_date` | `涨停池.md` | -| [`limit_up_pool_yesterday`](#api-limit-up-pool-yesterday) | 昨日涨停池 | `GET` | `api/v1/market/data/limit-up-pool-yesterday` | - | `昨日涨停池.md` | +| [`kline_pattern_annotations`](#api-kline-pattern-annotations) | K线形态标注 | `GET` | `api/v3/market/data/kline-pattern-annotations` | `date`, `trade_code`, `pattern`, `page`, `page_size` | `K线形态标注.md` | +| [`limit_event_timeline_3s`](#api-limit-event-timeline-3s) | 涨跌停事件时间线 | `GET` | `api/v2/market/data/limit-event-timeline-3s` | `symbol`, `trade_date` | `涨跌停事件时间线.md` | +| [`limit_list`](#api-limit-list) | 涨跌停池 | `GET` | `api/v1/market/data/limit-list` | `limit_type`, `trade_date` | `涨跌停池.md` | +| [`limit_up_briefs`](#api-limit-up-briefs) | 涨停简报 | `GET` | `api/v3/market/data/limit-up-reports/briefs` | `date` | `涨停简报.md` | +| [`limit_up_public_report`](#api-limit-up-public-report) | 涨停对外归因报告 | `GET` | `api/v3/market/data/limit-up-reports/public-report` | `date`, `security_code` | `涨停对外归因报告.md` | | [`margin_trading_details`](#api-margin-trading-details) | 融资融券明细 | `GET` | `api/v1/market/data/margin-trading-details` | `date`, `page`, `page_size` | `融资融券明细.md` | -| [`margin_trading_details_paginated`](#api-margin-trading-details-paginated) | 融资融券明细分页 | `GET` | `api/v1/market/data/margin-trading-details` | `date`, `page`, `page_size` | `融资融券明细分页.md` | | [`namechange`](#api-namechange) | 股票曾用名 | `GET` | `api/v1/market/data/namechange` | `trade_code`, `start_date`, `end_date` | `股票曾用名.md` | | [`northbound`](#api-northbound) | 北向资金交易 | `GET` | `api/v1/market/data/northbound` | `date` | `北向资金交易.md` | -| [`nth_trade_date`](#api-nth-trade-date) | 第N个交易日 | `GET` | `api/v1/market/data/time/get-nth-trade-date` | `n` | `第N个交易日.md` | | [`performance_forecasts_paginated`](#api-performance-forecasts-paginated) | 业绩预告 | `GET` | `api/v1/market/data/finance/stock-performance-forecast` | `stock_code`, `year`, `report_type`, `page`, `page_size` | `业绩预告.md` | -| [`price_change`](#api-price-change) | 价格变动 | `GET` | `api/v1/market/data/price/get-price-change` | `stock_code`, `base_date`, `n`, `direction` | `价格变动.md` | -| [`risk_warning_stock_quotes`](#api-risk-warning-stock-quotes) | 风险警示股行情 | `GET` | `api/v1/market/data/risk-warning-stocks/quotes` | `date` | `风险警示股行情.md` | -| [`risk_warning_stocks`](#api-risk-warning-stocks) | 风险警示股 | `GET` | `api/v1/market/data/risk-warning-stocks` | `date` | `风险警示股.md` | -| [`report_announcement_list`](#api-report-announcement-list) | 报告公告列表 | `GET` | `api/v1/market/data/report-announcements/list` | `date`, `sec_code`, `page`, `page_size` | `报告公告列表.md` | -| [`report_announcement_summary`](#api-report-announcement-summary) | 报告公告摘要 | `GET` | `api/v1/market/data/report-announcements/summary` | `announcement_id` | `报告公告摘要.md` | -| [`search`](#api-search) | 标的搜索 | `GET` | `api/v1/market/security/search` | `query`, `limit` | `标的搜索.md` | -| [`sh_hk_stock_connect_members`](#api-sh-hk-stock-connect-members) | 沪股通成份 | `GET` | `api/v1/market/data/sh-hk-stock-connect-members` | - | `沪股通成份.md` | +| [`pledge_summary`](#api-pledge-summary) | 股权质押汇总 | `GET` | `api/v1/market/data/pledge/pledge-summary` | `page`, `page_size` | `股权质押汇总.md` | +| [`price_change`](#api-price-change) | 价格变动 | `GET` | `api/v2/market/data/price/get-price-change` | `stock_code`, `base_date`, `n`, `direction` | `价格变动.md` | +| [`risk_warning_stock_quotes`](#api-risk-warning-stock-quotes) | 风险警示股行情 | `GET` | `api/v2/market/data/risk-warning-stocks/quotes` | `date` | `风险警示股行情.md` | +| [`risk_warning_stocks`](#api-risk-warning-stocks) | 风险警示股 | `GET` | `api/v1/market/data/risk-warning-stocks` | `date`, `page`, `page_size` | `风险警示股.md` | +| [`search`](#api-search) | 标的搜索 | `GET` | `api/v2/market/security/search/` | `query`, `limit` | `标的搜索.md` | | [`southbound`](#api-southbound) | 南向资金交易 | `GET` | `api/v1/market/data/southbound` | `date` | `南向资金交易.md` | -| [`stk_ah_comparison`](#api-stk-ah-comparison) | AH股对比 | `GET` | `api/v1/market/data/hk/stk-ah-comparison` | `hk_code`, `ts_code`, `trade_date`, `start_date`, `end_date`, `page`, `page_size` | `AH股对比.md` | -| [`stk_code_change`](#api-stk-code-change) | A股代码变更 | `GET` | `api/v1/market/data/stk-code-change` | `trade_code`, `start_date`, `end_date` | `A股代码变更.md` | +| [`stk_alert_broker`](#api-stk-alert-broker) | 交易所重点提示证券 | `GET` | `api/v2/market/data/stk-alert-broker` | `ts_code`, `start_date`, `end_date`, `page`, `page_size` | `交易所重点提示证券.md` | | [`stk_limit`](#api-stk-limit) | 涨跌停价 | `GET` | `api/v1/market/data/stk-limit` | `instrument_type`, `symbol`, `symbol_id`, `market_id`, `trade_date`, `start_date`, `end_date`, `page`, `page_size` | `涨跌停价.md` | | [`stk_manager_hold`](#api-stk-manager-hold) | 上市公司管理层持股 | `GET` | `api/v1/market/data/stk-manager-hold` | `trade_code`, `end_date` | `上市公司管理层持股.md` | | [`stk_manager_pay`](#api-stk-manager-pay) | 上市公司管理层薪酬 | `GET` | `api/v1/market/data/stk-manager-pay` | `trade_code`, `end_date` | `上市公司管理层薪酬.md` | | [`stk_managers`](#api-stk-managers) | 上市公司管理层 | `GET` | `api/v1/market/data/stk-managers` | `trade_code`, `candi_date`, `begin_date`, `end_date` | `上市公司管理层.md` | -| [`stk_premarket`](#api-stk-premarket) | 盘前数据 | `GET` | `api/v1/market/data/stk-premarket` | `ts_code`, `trade_date`, `start_date`, `end_date`, `page`, `page_size` | `盘前数据.md` | -| [`stk_status_change`](#api-stk-status-change) | A股状态变更 | `GET` | `api/v1/market/data/stk-status-change` | `trade_code`, `change_date`, `change_type` | `A股状态变更.md` | -| [`stock_adjust_factor`](#api-stock-adjust-factor) | 股票复权因子 | `GET` | `api/v1/market/data/stock-adjust-factor` | `symbol`, `trade_date`, `start_date`, `end_date`, `offset`, `limit` | `股票复权因子.md` | -| [`stock_candlesticks`](#api-stock-candlesticks) | 股票K线 | `POST` | `api/v1/market/data/stock-candlesticks` | `symbol`, `interval_unit`, `interval_value`, `adjust_kind`, `since_ts_millis`, `until_ts_millis`, `limit` | `股票K线.md` | -| [`stock_candlesticks_batch`](#api-stock-candlesticks-batch) | 批量股票K线 | `POST` | `api/v1/market/data/stock-candlesticks/batch` | `symbols`, `interval_unit`, `interval_value`, `adjust_kind`, `since_ts_millis`, `until_ts_millis`, `limit` | `批量股票K线.md` | -| [`stock_capital_flows_paginated`](#api-stock-capital-flows-paginated) | 股票资金流向 | `GET` | `api/v1/market/data/stock-capital-flows` | `date`, `page`, `page_size` | `股票资金流向.md` | +| [`stk_premarket`](#api-stk-premarket) | 盘前数据 | `GET` | `api/v2/market/data/stk-premarket` | `ts_code`, `trade_date`, `start_date`, `end_date`, `page`, `page_size` | `盘前数据.md` | +| [`stk_shock`](#api-stk-shock) | 个股异常波动 | `GET` | `api/v2/market/data/stk-shock` | `ts_code`, `trade_date`, `start_date`, `end_date`, `page`, `page_size` | `个股异常波动.md` | +| [`stk_surv`](#api-stk-surv) | 个股严重异常波动 | `GET` | `api/v2/market/data/stk-surv` | `ts_code`, `trade_date`, `start_date`, `end_date`, `page`, `page_size` | `个股严重异常波动.md` | +| [`stock_adjust_factor`](#api-stock-adjust-factor) | 股票复权因子 | `GET` | `api/v1/market/data/stock-adjust-factor` | `symbol`, `trade_date`, `start_date`, `end_date`, `page`, `page_size` | `股票复权因子.md` | +| [`stock_candlesticks`](#api-stock-candlesticks) | 股票K线 | `GET` | `api/v1/market/data/stock-candlesticks` | `symbol`, `interval_unit`, `interval_value`, `adjust_kind`, `since_ts_millis`, `until_ts_millis`, `limit` | `股票K线.md` | +| [`stock_capital_flows`](#api-stock-capital-flows) | 股票资金流向 | `GET` | `api/v1/market/data/stock-capital-flows` | `date`, `time`, `symbol`, `page`, `page_size` | `股票资金流向.md` | | [`stock_comment_desire_em`](#api-stock-comment-desire-em) | 千股千评意愿度 | `GET` | `api/v1/market/data/stock-comment/desire` | `symbol` | `千股千评意愿度.md` | | [`stock_comment_em`](#api-stock-comment-em) | 千股千评 | `GET` | `api/v1/market/data/stock-comment/index` | `page`, `page_size` | `千股千评.md` | | [`stock_comment_focus_em`](#api-stock-comment-focus-em) | 千股千评关注度 | `GET` | `api/v1/market/data/stock-comment/focus` | `symbol` | `千股千评关注度.md` | | [`stock_comment_org_participate_em`](#api-stock-comment-org-participate-em) | 机构参与度 | `GET` | `api/v1/market/data/stock-comment/org-participate` | `symbol` | `机构参与度.md` | | [`stock_comment_score_em`](#api-stock-comment-score-em) | 千股千评评分 | `GET` | `api/v1/market/data/stock-comment/score` | `symbol` | `千股千评评分.md` | -| [`stock_filter`](#api-stock-filter) | 股票筛选 | `GET` | `api/v1/market/data/stock-list/filter` | `symbol`, `board`, `listing_date_since`, `page`, `page_size` | `股票筛选.md` | +| [`stock_connect_members`](#api-stock-connect-members) | 互联互通成份 | `GET` | `api/v1/market/data/stock-connect-members` | `direction`, `channel`, `page`, `page_size` | `互联互通成份.md` | +| [`stock_daec_stocks`](#api-stock-daec-stocks) | A股行情列表 | `GET` | `api/v1/market/data/daec/stocks/{board}` | `board`, `page`, `page_size`, `filter`, `order_by` | `A股行情列表.md` | +| [`stock_description_all`](#api-stock-description-all) | 股票基础信息 | `GET` | `api/v1/market/data/stock-description-all` | - | `股票基础信息.md` | +| [`stock_dividends`](#api-stock-dividends) | 股票分红记录 | `GET` | `api/v1/market/data/stock-dividends` | `symbol`, `since_date`, `until_date`, `page`, `page_size` | `股票分红记录.md` | +| [`stock_filter`](#api-stock-filter) | 股票筛选 | `GET` | `api/v2/market/data/stock-list/filter` | `symbol`, `board`, `listing_date_since`, `page`, `page_size` | `股票筛选.md` | | [`stock_float_holders`](#api-stock-float-holders) | 十大流通股东 | `GET` | `api/v1/market/data/holder/stock-holder-ften` | `stock_code`, `is_last`, `page`, `page_size` | `十大流通股东.md` | -| [`stock_ggcg_em`](#api-stock-ggcg-em) | 东方财富股东增减持 | `GET` | `api/v1/market/data/holder/stock-ggcg-em` | `symbol`, `page`, `page_size` | `东方财富股东增减持.md` | -| [`stock_ggmx`](#api-stock-ggmx) | 董监高持股变动 | `GET` | `api/v1/market/data/holder/stock-ggmx` | `stock_code`, `change_direction`, `start_date`, `end_date`, `page`, `page_size` | `董监高持股变动.md` | -| [`stock_ggmx_buy_ranking`](#api-stock-ggmx-buy-ranking) | 董监高增持排名 | `GET` | `api/v1/market/data/holder/stock-ggmx-buy-ranking` | `time_range`, `page`, `page_size` | `董监高增持排名.md` | -| [`stock_ggmx_sell_ranking`](#api-stock-ggmx-sell-ranking) | 董监高减持排名 | `GET` | `api/v1/market/data/holder/stock-ggmx-sell-ranking` | `time_range`, `page`, `page_size` | `董监高减持排名.md` | +| [`stock_ggmx_buy_ranking`](#api-stock-ggmx-buy-ranking) | 董监高增持排名 | `GET` | `api/v3/market/data/holder/stock-ggmx-buy-ranking` | `time_range`, `page`, `page_size` | `董监高增持排名.md` | +| [`stock_ggmx_sell_ranking`](#api-stock-ggmx-sell-ranking) | 董监高减持排名 | `GET` | `api/v3/market/data/holder/stock-ggmx-sell-ranking` | `time_range`, `page`, `page_size` | `董监高减持排名.md` | +| [`stock_history_list`](#api-stock-history-list) | 股票历史列表 | `GET` | `api/v1/market/data/stock-history-list` | `trade_date`, `code`, `page`, `page_size` | `股票历史列表.md` | | [`stock_holders`](#api-stock-holders) | 十大股东 | `GET` | `api/v1/market/data/holder/stock-holder-ten` | `stock_code`, `is_last`, `page`, `page_size` | `十大股东.md` | | [`stock_holders_number`](#api-stock-holders-number) | 股东人数 | `GET` | `api/v1/market/data/holder/stock-holder-nums` | `stock_code`, `is_last`, `page`, `page_size` | `股东人数.md` | -| [`stock_institution_holdings`](#api-stock-institution-holdings) | 机构持股 | `GET` | `api/v1/market/data/share/stock-institution-holdings` | `year`, `report_type`, `inst_type`, `page`, `page_size` | `机构持股.md` | -| [`stock_institution_holdings_detail`](#api-stock-institution-holdings-detail) | 机构持股明细 | `GET` | `api/v1/market/data/share/stock-institution-holdings-detail` | `stock_code`, `year`, `report_type`, `inst_type`, `page`, `page_size` | `机构持股明细.md` | -| [`stock_institution_share_holdings`](#api-stock-institution-share-holdings) | 机构股本持股 | `GET` | `api/v1/market/data/institution/institution-share-holdings` | `institution_id`, `year`, `report_type`, `invest_type` | `机构股本持股.md` | -| [`stock_intraday_auction_volume`](#api-stock-intraday-auction-volume) | 集合竞价成交量 | `GET` | `api/v1/market/data/intraday-auction-volume` | `trade_date`, `page`, `page_size` | `集合竞价成交量.md` | -| [`stock_intraday_auction_volume_symbol`](#api-stock-intraday-auction-volume-symbol) | 单标的集合竞价成交量 | `GET` | `api/v1/market/data/intraday-auction-volume/symbol` | `symbol`, `trade_date`, `page`, `page_size` | `单标的集合竞价成交量.md` | +| [`stock_institution_holdings`](#api-stock-institution-holdings) | 机构持股 | `GET` | `api/v3/market/data/share/stock-institution-holdings` | `year`, `report_type`, `inst_type`, `page`, `page_size` | `机构持股.md` | +| [`stock_institution_holdings_detail`](#api-stock-institution-holdings-detail) | 机构持股明细 | `GET` | `api/v3/market/data/share/stock-institution-holdings-detail` | `stock_code`, `year`, `report_type`, `inst_type`, `page`, `page_size` | `机构持股明细.md` | +| [`stock_institution_share_holdings`](#api-stock-institution-share-holdings) | 机构股本持股 | `GET` | `api/v3/market/data/institution/institution-share-holdings` | `institution_id`, `year`, `report_type`, `invest_type` | `机构股本持股.md` | +| [`stock_intraday_auction_volume`](#api-stock-intraday-auction-volume) | 连续竞价成交量 | `GET` | `api/v2/market/data/intraday-auction-volume` | `trade_date`, `page`, `page_size` | `连续竞价成交量.md` | +| [`stock_intraday_prices`](#api-stock-intraday-prices) | 标的分时数据 | `GET` | `api/v4/market/data/daec/history/prices` | `symbol`, `range`, `days`, `ts_ms` | `标的分时数据.md` | | [`stock_ipos`](#api-stock-ipos) | 股票IPO | `GET` | `api/v1/market/data/stock-ipos` | `page`, `page_size` | `股票IPO.md` | -| [`stock_list`](#api-stock-list) | 股票列表 | `GET` | `api/v1/market/data/stock-list` | - | `股票列表.md` | +| [`stock_list`](#api-stock-list) | 股票列表 | `GET` | `api/v1/market/data/stock-list` | `page`, `page_size` | `股票列表.md` | | [`stock_market`](#api-stock-market) | 市场行情快照 | `GET` | `api/v1/market/data/daec/market/snapshot` | `scope` | `市场行情快照.md` | -| [`stock_market_distribution_intraday`](#api-stock-market-distribution-intraday) | 日内涨跌停分布历史 | `GET` | `api/v1/market/data/daec/market/distribution-history` | `scope` | `日内涨跌停分布历史.md` | -| [`stock_daec_stocks`](#api-stock-daec-stocks) | A股行情列表 | `GET` | `api/v1/market/data/daec/stocks/{board}` | `board`, `page`, `page_size`, `filter`, `order_by` | `A股行情列表.md` | -| [`stock_realtime_list`](#api-stock-realtime-list) | A股行情列表 | `GET` | `api/v1/market/data/stock-list/{board}` | `board`, `page`, `page_size` | `A股行情列表.md` | +| [`stock_market_distribution_intraday`](#api-stock-market-distribution-intraday) | 市场涨跌分布分时 | `GET` | `api/v2/market/data/market-distribution-intraday` | - | `市场涨跌分布分时.md` | +| [`stock_minutes`](#api-stock-minutes) | 股票历史分钟行情 | `GET` | `api/v3/market/data/stock_minutes` | `symbol`, `interval_value`, `adjust_kind`, `since_ts_millis`, `until_ts_millis`, `limit` | `股票历史分钟行情.md` | | [`stock_pledge_detail`](#api-stock-pledge-detail) | 股权质押明细 | `GET` | `api/v1/market/data/pledge/pledge-detail` | `stock_code`, `is_last`, `page`, `page_size` | `股权质押明细.md` | -| [`stock_pledge_summary`](#api-stock-pledge-summary) | 股权质押汇总 | `GET` | `api/v1/market/data/pledge/pledge-summary` | `page`, `page_size` | `股权质押汇总.md` | | [`stock_prev_close`](#api-stock-prev-close) | 标的昨收价 | `GET` | `api/v1/market/data/daec/history/prev-closes` | `symbol`, `since`, `until` | `标的昨收价.md` | -| [`stock_intraday_prices`](#api-stock-intraday-prices) | 标的分时数据 | `GET` | `api/v1/market/data/daec/history/prices` | `symbol`, `range`, `days`, `ts_ms`, `compat`, `since`, `since_ts_ms` | `标得分时数据.md` | -| [`stock_ohlcs`](#api-stock-ohlcs) | 标的K线数据 | `GET` | `api/v1/market/data/daec/history/ohlcs` | `symbol`, `since`, `until`, `interval`, `adjust`, `compat`, `span`, `limit`, `until_ts_ms` | `标的K线数据.md` | -| [`stock_rating_top5`](#api-stock-rating-top5) | 飞兔股票评级Top5 | `GET` | `api/v1/market/data/feitu/stock-rating-top5` | `date`, `variant`, `type` | `飞兔股票评级Top5.md` | -| [`stock_share`](#api-stock-share) | 股本 | `GET` | `api/v1/market/data/share/get-stock-share` | `stock_code`, `date` | `股本.md` | +| [`stock_realtime_day_kline`](#api-stock-realtime-day-kline) | 股票实时日K线 | `GET` | `api/v4/market/data/stock-realtime-day-kline` | `symbols` | `股票实时日K线.md` | +| [`stock_realtime_list`](#api-stock-realtime-list) | A股行情列表 | `GET` | `api/v1/market/data/stock-list/{board}` | `board`, `page`, `page_size` | `A股行情列表.md` | +| [`stock_realtime_minute_kline`](#api-stock-realtime-minute-kline) | 股票实时分钟K线 | `GET` | `api/v4/market/data/stock-realtime-minute-kline` | `symbols` | `股票实时分钟K线.md` | +| [`stock_share`](#api-stock-share) | 股本 | `GET` | `api/v2/market/data/share/get-stock-share` | `stock_code`, `date` | `股本.md` | | [`stock_share_chg`](#api-stock-share-chg) | 股东增减持 | `GET` | `api/v1/market/data/holder/stock-share-chg` | `stock_code`, `is_last`, `page`, `page_size` | `股东增减持.md` | -| [`stock_signal_latest_snapshot`](#api-stock-signal-latest-snapshot) | 信号最新快照 | `GET` | `api/v1/market/data/stock-signal-latest-snapshot` | `signal_type`, `page`, `page_size` | `信号最新快照.md` | -| [`stock_unlock`](#api-stock-unlock) | 限售解禁 | `GET` | `api/v1/market/data/unlock/stock-unlock` | `stock_code`, `page`, `page_size` | `限售解禁.md` | -| [`stock_unlock_by_date`](#api-stock-unlock-by-date) | 限售解禁按日期 | `GET` | `api/v1/market/data/unlock/stock-unlock-by-date` | `start_date`, `end_date`, `page`, `page_size` | `限售解禁按日期.md` | +| [`stock_unlock`](#api-stock-unlock) | 限售解禁 | `GET` | `api/v1/market/data/unlock/stock_unlock` | `stock_code`, `start_date`, `end_date`, `page`, `page_size` | `限售解禁.md` | +| [`supply_chain_company_supply_chain_companies`](#api-supply-chain-company-supply-chain-companies) | 供应链公司候选 | `GET` | `api/v3/market/data/supply-chain/company-supply-chain-companies` | `trade_code`, `direction`, `page`, `page_size` | `供应链公司候选.md` | +| [`supply_chain_subindustry_subsubindustries`](#api-supply-chain-subindustry-subsubindustries) | 供应链子行业层级展开 | `GET` | `api/v3/market/data/supply-chain/subindustry-subsubindustries` | `industry_name` | `供应链子行业层级展开.md` | +| [`supply_chain_subindustry_supply_chain`](#api-supply-chain-subindustry-supply-chain) | 供应链一跳关系 | `GET` | `api/v3/market/data/supply-chain/subindustry-supply-chain` | `industry_name`, `direction` | `供应链一跳关系.md` | +| [`supply_chain_subsubindustry_companies`](#api-supply-chain-subsubindustry-companies) | 供应链子子行业公司映射 | `GET` | `api/v3/market/data/supply-chain/subsubindustry-companies` | `subindustry_name` | `供应链子子行业公司映射.md` | +| [`supply_chain_subsubindustry_parent_subindustries`](#api-supply-chain-subsubindustry-parent-subindustries) | 供应链子子行业父行业反查 | `GET` | `api/v3/market/data/supply-chain/subsubindustry-parent-subindustries` | `subindustry_name` | `供应链子子行业父行业反查.md` | | [`suspension_list`](#api-suspension-list) | 停牌列表 | `GET` | `api/v1/market/data/suspension-list` | `trade_date`, `page`, `page_size` | `停牌列表.md` | -| [`sz_hk_stock_connect_members`](#api-sz-hk-stock-connect-members) | 深股通成份 | `GET` | `api/v1/market/data/sz-hk-stock-connect-members` | - | `深股通成份.md` | -| [`ths_all_board_kline`](#api-ths-all-board-kline) | 同花顺全板块K线 | `GET` | `api/v1/market/data/ths-all-board-kline` | `start_date`, `end_date`, `page`, `page_size` | `同花顺全板块K线.md` | -| [`ths_board_kline`](#api-ths-board-kline) | 同花顺板块K线 | `GET` | `api/v1/market/data/ths-board-kline` | `board_code`, `page`, `page_size` | `同花顺板块K线.md` | -| [`ths_board_list`](#api-ths-board-list) | 同花顺板块列表 | `GET` | `api/v1/market/data/ths-board-list` | - | `同花顺板块列表.md` | +| [`tdx_board_daily`](#api-tdx-board-daily) | 通达信板块日线 | `GET` | `api/v1/market/data/tdx-board-daily` | `start_date`, `end_date`, `ts_code`, `idx_name`, `idx_type`, `idx_type_code`, `market`, `page`, `page_size` | `通达信板块日线.md` | +| [`tdx_board_index`](#api-tdx-board-index) | 通达信板块指数最新快照 | `GET` | `api/v1/market/data/tdx-board-index` | `ts_code`, `idx_name`, `idx_type`, `idx_type_code`, `market`, `page`, `page_size` | `通达信板块指数最新快照.md` | +| [`tdx_board_members`](#api-tdx-board-members) | 通达信板块成分股最新快照 | `GET` | `api/v2/market/data/tdx-board-members` | `ts_code`, `idx_name`, `idx_type`, `idx_type_code`, `market`, `con_code`, `con_name`, `page`, `page_size` | `通达信板块成分股最新快照.md` | +| [`ths_board_kline`](#api-ths-board-kline) | 同花顺板块K线 | `GET` | `api/v2/market/data/ths-board-kline` | `board_code`, `page`, `page_size` | `同花顺板块K线.md` | +| [`ths_hot_list`](#api-ths-hot-list) | 同花顺热榜 | `GET` | `api/v2/market/data/ths-hot-list` | `list_type`, `trade_date`, `page`, `page_size` | `同花顺热榜.md` | | [`trading_calendar`](#api-trading-calendar) | 交易日历 | `GET` | `api/v1/market/data/time/trading-calendar` | `market`, `start_date`, `end_date` | `交易日历.md` | -| [`xueqiu_rank`](#api-xueqiu-rank) | 雪球股票排名 | `GET` | `api/v1/market/data/xueqiu-rank` | `rank_group`, `period`, `trade_date`, `page`, `page_size` | `雪球股票排名.md` | -| [`yzxdr_detail`](#api-yzxdr-detail) | 除权除息明细 | `GET` | `api/v1/market/data/yzxdr-detail` | `year`, `quarter`, `stock_code`, `page`, `page_size` | `除权除息明细.md` | -| [`pledge_summary`](#api-pledge-summary) | 股权质押汇总 | `GET` | `api/v1/market/data/pledge/pledge-summary` | `page`, `page_size` | `股权质押汇总.md` | -| [`stock_capital_flows`](#api-stock-capital-flows) | 股票资金流向 | `GET` | `api/v1/market/data/stock-capital-flows` | `date`, `page`, `page_size` | `股票资金流向.md` | +| [`xueqiu_rank`](#api-xueqiu-rank) | 雪球股票排名 | `GET` | `api/v2/market/data/xueqiu-rank` | `rank_group`, `period`, `trade_date`, `page`, `page_size` | `雪球股票排名.md` | +| [`yzxdr_detail`](#api-yzxdr-detail) | 一致行动人明细 | `GET` | `api/v1/market/data/yzxdr-detail` | `year`, `quarter`, `stock_code`, `page`, `page_size` | `一致行动人明细.md` | ### 港股数据 | SDK 方法 | 接口名称 | HTTP | Path | 参数 | 来源文档 | |---|---|---|---|---|---| -| [`company_hk`](#api-company-hk) | 港股公司信息 | `GET` | `api/v1/market/data/hk/company-hk` | `trade_code` | `港股公司信息.md` | -| [`eastmoney_hk_index_daily_kline`](#api-eastmoney-hk-index-daily-kline) | 东方财富港股指数日K | `GET` | `api/v1/market/data/eastmoney-hk-index-daily-kline` | `index_code`, `trade_date`, `start_date`, `end_date`, `page`, `page_size` | `东方财富港股指数日K.md` | -| [`hk_balance_bank`](#api-hk-balance-bank) | 港股资产负债表 | `GET` | `api/v1/market/data/hk/hk-balance-bank` | `trade_code`, `year`, `report_type`, `start_date`, `end_date`, `page`, `page_size` | `港股资产负债表.md` | -| [`hk_balance_gene`](#api-hk-balance-gene) | 港股资产负债表 | `GET` | `api/v1/market/data/hk/hk-balance-gene` | `trade_code`, `year`, `report_type`, `start_date`, `end_date`, `page`, `page_size` | `港股资产负债表.md` | -| [`hk_balance_insur`](#api-hk-balance-insur) | 港股资产负债表 | `GET` | `api/v1/market/data/hk/hk-balance-insur` | `trade_code`, `year`, `report_type`, `start_date`, `end_date`, `page`, `page_size` | `港股资产负债表.md` | -| [`hk_basinfo_get`](#api-hk-basinfo-get) | 港股个股信息 | `GET` | `api/v1/market/data/hk/hk-view` | `hk_code` | `港股个股信息.md` | -| [`hk_basinfo_post`](#api-hk-basinfo-post) | 港股个股信息 | `GET` | `api/v1/market/data/hk/hk-view` | `hk_code` | `港股个股信息.md` | -| [`hk_candlesticks`](#api-hk-candlesticks) | 港股K线 | `GET` | `api/v1/market/data/hk/hk-candlesticks` | `trade_code`, `interval_unit`, `until_date`, `since_date`, `interval_value`, `limit`, `adjust_kind` | `港股K线.md` | -| [`hk_cashflow`](#api-hk-cashflow) | 港股现金流量表 | `GET` | `api/v1/market/data/hk/hk-cashflow` | `stock_code`, `year`, `report_type`, `start_date`, `end_date`, `page`, `page_size` | `港股现金流量表.md` | -| [`hk_income_bank`](#api-hk-income-bank) | 港股利润表 | `GET` | `api/v1/market/data/hk/hk-income-bank` | `trade_code`, `year`, `report_type`, `start_date`, `end_date`, `page`, `page_size` | `港股利润表.md` | -| [`hk_income_gene`](#api-hk-income-gene) | 港股利润表 | `GET` | `api/v1/market/data/hk/hk-income-gene` | `trade_code`, `year`, `report_type`, `start_date`, `end_date`, `page`, `page_size` | `港股利润表.md` | -| [`hk_income_insur`](#api-hk-income-insur) | 港股利润表 | `GET` | `api/v1/market/data/hk/hk-income-insur` | `trade_code`, `year`, `report_type`, `start_date`, `end_date`, `page`, `page_size` | `港股利润表.md` | -| [`hk_valuatnanalyd`](#api-hk-valuatnanalyd) | 港股估值分析 | `GET` | `api/v1/market/data/hk/hk-valuatnanalyd` | `trade_code`, `page`, `page_size` | `港股估值分析.md` | -| [`hsi_daily_weight`](#api-hsi-daily-weight) | 恒生指数每日权重 | `GET` | `api/v1/market/data/hk/hsi-daily-weight` | `trade_date`, `start_date`, `end_date`, `index_slug`, `stock_code`, `page`, `page_size` | `恒生指数每日权重.md` | -| [`market_cap_hk`](#api-market-cap-hk) | 港股市值 | `GET` | `api/v1/market/data/hk/market-cap-hk` | `trade_code` | `港股市值.md` | +| [`hk_candlesticks`](#api-hk-candlesticks) | 港股K线 | `GET` | `api/v3/market/data/hk/hk-candlesticks` | `trade_code`, `interval_unit`, `until_date`, `since_date`, `interval_value`, `limit`, `adjust_kind` | `港股K线.md` | +| [`hk_stock_info_all`](#api-hk-stock-info-all) | 港股实时行情 | `GET` | `api/v4/market/data/hk-stock-info-all` | - | `港股实时行情.md` | ### 美股数据 | SDK 方法 | 接口名称 | HTTP | Path | 参数 | 来源文档 | |---|---|---|---|---|---| -| [`eastmoney_us_stock_daily_kline`](#api-eastmoney-us-stock-daily-kline) | 东方财富美股日OHLC | `GET` | `api/v1/market/data/eastmoney-us-stock-daily-ohlc` | `stock_code`, `start_date`, `end_date`, `page`, `page_size` | `东方财富美股日OHLC.md` | -| [`eastmoney_us_stock_latest_kline`](#api-eastmoney-us-stock-latest-kline) | 东方财富美股最新OHLC | `GET` | `api/v1/market/data/eastmoney-us-stock-latest-ohlc` | `stock_code`, `page`, `page_size` | `东方财富美股最新OHLC.md` | -| [`eastmoney_us_stock_list`](#api-eastmoney-us-stock-list) | 东方财富美股列表 | `GET` | `api/v1/market/data/eastmoney-us-stock-list` | `refresh`, `page`, `page_size` | `东方财富美股列表.md` | -| [`us_balance`](#api-us-balance) | 美股资产负债表 | `GET` | `api/v1/market/data/us/us-balance` | `stock_code`, `period`, `report_type`, `start_date`, `end_date`, `page`, `page_size` | `美股资产负债表.md` | -| [`us_basic`](#api-us-basic) | 美股基础信息 | `GET` | `api/v1/market/data/us/us-basic` | `stock_code`, `page`, `page_size` | `美股基础信息.md` | -| [`us_cashflow`](#api-us-cashflow) | 美股现金流 | `GET` | `api/v1/market/data/us/us-cashflow` | `stock_code`, `period`, `report_type`, `start_date`, `end_date`, `page`, `page_size` | `美股现金流.md` | -| [`us_income`](#api-us-income) | 美股利润表 | `GET` | `api/v1/market/data/us/us-income` | `stock_code`, `period`, `report_type`, `start_date`, `end_date`, `page`, `page_size` | `美股利润表.md` | | [`eastmoney_us_stock_daily_ohlc`](#api-eastmoney-us-stock-daily-ohlc) | 东方财富美股日OHLC | `GET` | `api/v1/market/data/eastmoney-us-stock-daily-ohlc` | `stock_code`, `start_date`, `end_date`, `page`, `page_size` | `东方财富美股日OHLC.md` | -| [`eastmoney_us_stock_latest_ohlc`](#api-eastmoney-us-stock-latest-ohlc) | 东方财富美股最新OHLC | `GET` | `api/v1/market/data/eastmoney-us-stock-latest-ohlc` | `stock_code`, `page`, `page_size` | `东方财富美股最新OHLC.md` | ### 指数专题 | SDK 方法 | 接口名称 | HTTP | Path | 参数 | 来源文档 | |---|---|---|---|---|---| -| [`global_index_daily_kline`](#api-global-index-daily-kline) | 全球指数日K线 | `GET` | `api/v1/market/data/global-index/daily-kline` | `secid`, `start_date`, `end_date` | `全球指数日K线.md` | -| [`index_candlesticks`](#api-index-candlesticks) | 指数K线 | `POST` | `api/v1/market/data/index-candlesticks` | `symbol`, `interval_unit`, `interval_value`, `adjust_kind`, `since_ts_millis`, `until_ts_millis`, `limit` | `指数K线.md` | -| [`index_candlesticks_batch`](#api-index-candlesticks-batch) | 批量指数K线 | `POST` | `api/v1/market/data/index-candlesticks/batch` | `symbols`, `interval_unit`, `interval_value`, `adjust_kind`, `since_ts_millis`, `until_ts_millis`, `limit` | `批量指数K线.md` | -| [`index_description_all`](#api-index-description-all) | 指数基础信息 | `GET` | `api/v1/market/data/index-description-all` | - | `指数基础信息.md` | +| [`global_index_daily_kline`](#api-global-index-daily-kline) | 全球指数日K线 | `GET` | `api/v2/market/data/global-index/daily-kline` | `secid`, `start_date`, `end_date`, `limit` | `全球指数日K线.md` | +| [`index_candlesticks`](#api-index-candlesticks) | 指数K线 | `GET` | `api/v1/market/data/index-candlesticks` | `symbol`, `interval_unit`, `interval_value`, `adjust_kind`, `since_ts_millis`, `until_ts_millis`, `limit` | `指数K线.md` | +| [`index_description_all`](#api-index-description-all) | 指数基础信息 | `GET` | `api/v1/market/data/index-description-all` | `page`, `page_size` | `指数基础信息.md` | | [`index_description_list`](#api-index-description-list) | 中证指数描述列表 | `GET` | `api/v1/market/data/index/index_description` | `page`, `page_size` | `中证指数描述列表.md` | +| [`index_minutes`](#api-index-minutes) | 指数历史分钟行情 | `GET` | `api/v3/market/data/index_minutes` | `symbol`, `interval_value`, `since_ts_millis`, `until_ts_millis`, `limit` | `指数历史分钟行情.md` | +| [`index_realtime_day_kline`](#api-index-realtime-day-kline) | 指数实时日K线 | `GET` | `api/v4/market/data/index-realtime-day-kline` | `symbols` | `指数实时日K线.md` | +| [`index_realtime_minute_kline`](#api-index-realtime-minute-kline) | 指数实时分钟K线 | `GET` | `api/v4/market/data/index-realtime-minute-kline` | `symbols` | `指数实时分钟K线.md` | | [`index_weight_list`](#api-index-weight-list) | 指数权重列表 | `GET` | `api/v1/market/data/index/index_weight` | `index_code`, `date`, `page`, `page_size` | `指数权重列表.md` | | [`index_weight_summary`](#api-index-weight-summary) | 指数权重汇总 | `GET` | `api/v1/market/data/index/index_weight_summary` | `index_code`, `page`, `page_size` | `指数权重汇总.md` | | [`sw_industry_constituent_history`](#api-sw-industry-constituent-history) | 申万行业成份股历史 | `GET` | `api/v1/market/data/sw-industry/constituent-history` | `industry_code` | `申万行业成份股历史.md` | @@ -208,41 +169,39 @@ df = market.baidu_financial_calendar( | SDK 方法 | 接口名称 | HTTP | Path | 参数 | 来源文档 | |---|---|---|---|---|---| -| [`etf_adjust_factor`](#api-etf-adjust-factor) | ETF复权因子 | `GET` | `api/v1/market/data/etf-adjust-factor` | `symbol`, `trade_date`, `start_date`, `end_date`, `offset`, `limit` | `ETF复权因子.md` | -| [`etf_candlesticks`](#api-etf-candlesticks) | ETFK线 | `POST` | `api/v1/market/data/etf-candlesticks` | `symbol`, `interval_unit`, `interval_value`, `adjust_kind`, `since_ts_millis`, `until_ts_millis`, `limit` | `ETFK线.md` | -| [`etf_candlesticks_batch`](#api-etf-candlesticks-batch) | 批量ETFK线 | `POST` | `api/v1/market/data/etf-candlesticks/batch` | `symbols`, `interval_unit`, `interval_value`, `adjust_kind`, `since_ts_millis`, `until_ts_millis`, `limit` | `批量ETFK线.md` | -| [`etf_components`](#api-etf-components) | ETF成份股 | `GET` | `api/v1/market/data/etf-component` | `symbol` | `ETF成份股.md` | -| [`etf_components_all`](#api-etf-components-all) | ETF成份列表 | `GET` | `api/v1/market/data/etf-components-all` | - | `ETF成份列表.md` | -| [`etf_description_all`](#api-etf-description-all) | ETF基础信息 | `GET` | `api/v1/market/data/etf-description-all` | - | `ETF基础信息.md` | -| [`etf_fund_export`](#api-etf-fund-export) | 指数ETF基金导出 | `GET` | `api/v1/market/data/etf/zhitou-etf` | `request_id`, `page`, `page_size` | `指数ETF基金导出.md` | -| [`etf_pcf_list`](#api-etf-pcf-list) | ETF-PCF清单列表 | `GET` | `api/v1/market/data/etf-pcf/etf-pcfs` | `date`, `page`, `page_size` | `ETF-PCF清单列表.md` | -| [`etf_pre`](#api-etf-pre) | ETF盘前数据 | `GET` | `api/v1/market/data/etf-pre-data` | `date` | `ETF盘前数据.md` | -| [`etf_pre_single`](#api-etf-pre-single) | 单只ETF盘前数据 | `GET` | `api/v1/market/data/etf-pre-single` | `symbol`, `date` | `单只ETF盘前数据.md` | +| [`etf_adjust_factor`](#api-etf-adjust-factor) | ETF复权因子 | `GET` | `api/v1/market/data/etf-adjust-factor` | `symbol`, `trade_date`, `start_date`, `end_date`, `page`, `page_size` | `ETF复权因子.md` | +| [`etf_candlesticks`](#api-etf-candlesticks) | ETFK线 | `GET` | `api/v1/market/data/etf-candlesticks` | `symbol`, `interval_unit`, `interval_value`, `adjust_kind`, `since_ts_millis`, `until_ts_millis`, `limit` | `ETFK线.md` | +| [`etf_components_all`](#api-etf-components-all) | ETF成份列表 | `GET` | `api/v2/market/data/etf-components-all` | `symbol` | `ETF成份列表.md` | +| [`etf_description_all`](#api-etf-description-all) | ETF基础信息 | `GET` | `api/v2/market/data/etf-description-all` | - | `ETF基础信息.md` | +| [`etf_minutes`](#api-etf-minutes) | ETF历史分钟行情 | `GET` | `api/v3/market/data/etf_minutes` | `symbol`, `interval_value`, `adjust_kind`, `since_ts_millis`, `until_ts_millis`, `limit` | `ETF历史分钟行情.md` | +| [`etf_pcf_list`](#api-etf-pcf-list) | ETF-PCF清单列表 | `GET` | `api/v2/market/data/etf-pcf/etf-pcfs` | `date`, `page`, `page_size` | `ETF-PCF清单列表.md` | +| [`etf_pre`](#api-etf-pre) | ETF盘前数据 | `GET` | `api/v2/market/data/etf-pre-data` | `date` | `ETF盘前数据.md` | +| [`etf_pre_single`](#api-etf-pre-single) | 单只ETF盘前数据 | `GET` | `api/v2/market/data/etf-pre-single` | `symbol`, `date` | `单只ETF盘前数据.md` | +| [`etf_realtime_day_kline`](#api-etf-realtime-day-kline) | ETF实时日K线 | `GET` | `api/v4/market/data/etf-realtime-day-kline` | `symbols` | `ETF实时日K线.md` | +| [`etf_realtime_minute_kline`](#api-etf-realtime-minute-kline) | ETF实时分钟K线 | `GET` | `api/v4/market/data/etf-realtime-minute-kline` | `symbols` | `ETF实时分钟K线.md` | ### 公募基金 | SDK 方法 | 接口名称 | HTTP | Path | 参数 | 来源文档 | |---|---|---|---|---|---| +| [`fund_asset_allocation`](#api-fund-asset-allocation) | 基金资产配置 | `GET` | `api/v1/market/data/fund/fund-asset-allocation` | `fund_code`, `report_date`, `publish_date`, `start_date`, `end_date`, `page`, `page_size` | `基金资产配置.md` | | [`fund_basicinfo`](#api-fund-basicinfo) | 基金基础信息 | `GET` | `api/v1/market/data/fund/fund-basicinfo` | `institution_code`, `page`, `page_size` | `基金基础信息.md` | | [`fund_cal_return`](#api-fund-cal-return) | 基金收益 | `GET` | `api/v1/market/data/fund/fund-cal-return` | `institution_code`, `cal-type` | `基金收益.md` | -| [`fund_nav`](#api-fund-nav) | 基金净值 | `GET` | `api/v1/market/data/fund/fund-nav` | `institution_code`, `page`, `page_size` | `基金净值.md` | -| [`fund_overview`](#api-fund-overview) | 基金总览 | `GET` | `api/v1/market/data/fund/fund-overview` | `page`, `page_size` | `基金总览.md` | -| [`fund_support_symbols`](#api-fund-support-symbols) | 基金支持标的 | `GET` | `api/v1/market/data/fund/fund-support-symbols` | `page`, `page_size` | `基金支持标的.md` | -| [`fund_share`](#api-fund-share) | 基金份额 | `GET` | `api/v1/market/data/fund/fund-share` | `fund_code`, `stati_perd`, `start_date`, `end_date`, `page`, `page_size` | `基金份额.md` | -| [`fund_company`](#api-fund-company) | 基金公司 | `GET` | `api/v1/market/data/fund/fund-company` | `fund_company`, `page`, `page_size` | `基金公司.md` | -| [`fund_net_value_performance`](#api-fund-net-value-performance) | 基金净值收益表现 | `GET` | `api/v1/market/data/fund/fund-net-value-performance` | `fund_code`, `stat_date`, `start_date`, `end_date`, `page`, `page_size` | `基金净值收益表现.md` | -| [`fund_net_value`](#api-fund-net-value) | 基金净值明细 | `GET` | `api/v1/market/data/fund/fund-net-value` | `fund_code`, `nav_date`, `start_date`, `end_date`, `page`, `page_size` | `基金净值明细.md` | | [`fund_classification`](#api-fund-classification) | 基金分类 | `GET` | `api/v1/market/data/fund/fund-classification` | `fund_code`, `classify_std` | `基金分类.md` | -| [`fund_list`](#api-fund-list) | 基金列表 | `GET` | `api/v1/market/data/fund/fund-list` | `fund_code`, `fund_type`, `page`, `page_size` | `基金列表.md` | -| [`fund_portfolio`](#api-fund-portfolio) | 基金持仓明细 | `GET` | `api/v1/market/data/fund/fund-portfolio` | `fund_code`, `report_date`, `publish_date`, `start_date`, `end_date`, `page`, `page_size` | `基金持仓明细.md` | +| [`fund_company`](#api-fund-company) | 基金公司 | `GET` | `api/v1/market/data/fund/fund-company` | `fund_company`, `page`, `page_size` | `基金公司.md` | +| [`fund_fee`](#api-fund-fee) | 基金费率 | `GET` | `api/v1/market/data/fund/fund-fee` | `fund_code`, `charge_type`, `client_type`, `page`, `page_size` | `基金费率.md` | | [`fund_holder_structure`](#api-fund-holder-structure) | 基金持有人结构 | `GET` | `api/v1/market/data/fund/fund-holder-structure` | `fund_code`, `report_type`, `start_date`, `end_date` | `基金持有人结构.md` | -| [`fund_new_found`](#api-fund-new-found) | 基金新发 | `GET` | `api/v1/market/data/fund/fund-new-found` | `start_date`, `end_date`, `fund_type`, `page`, `page_size` | `基金新发.md` | +| [`fund_index_fund`](#api-fund-index-fund) | 指数跟踪基金 | `GET` | `api/v2/market/data/fund/index-fund` | `index_code`, `scope` | `指数跟踪基金.md` | +| [`fund_list`](#api-fund-list) | 基金列表 | `GET` | `api/v1/market/data/fund/fund-list` | `fund_code`, `fund_type`, `page`, `page_size` | `基金列表.md` | | [`fund_manager`](#api-fund-manager) | 基金经理任职关系 | `GET` | `api/v1/market/data/fund/fund-manager` | `fund_code`, `fund_manager`, `is_inoffice`, `page`, `page_size` | `基金经理任职关系.md` | -| [`fund_daily`](#api-fund-daily) | 基金行情日线 | `GET` | `api/v1/market/data/fund/fund-daily` | `fund_code`, `trade_date`, `start_date`, `end_date`, `page`, `page_size` | `基金行情日线.md` | -| [`fund_fee`](#api-fund-fee) | 基金费率 | `GET` | `api/v1/market/data/fund/fund-fee` | `fund_code`, `charge_type`, `client_type`, `page`, `page_size` | `基金费率.md` | -| [`fund_asset_allocation`](#api-fund-asset-allocation) | 基金资产配置 | `GET` | `api/v1/market/data/fund/fund-asset-allocation` | `fund_code`, `report_date`, `publish_date`, `start_date`, `end_date`, `page`, `page_size` | `基金资产配置.md` | +| [`fund_net_value`](#api-fund-net-value) | 基金净值明细 | `GET` | `api/v1/market/data/fund/fund-net-value` | `fund_code`, `nav_date`, `start_date`, `end_date`, `page`, `page_size` | `基金净值明细.md` | +| [`fund_net_value_performance`](#api-fund-net-value-performance) | 基金净值收益表现 | `GET` | `api/v1/market/data/fund/fund-net-value-performance` | `fund_code`, `stat_date`, `start_date`, `end_date`, `page`, `page_size` | `基金净值收益表现.md` | +| [`fund_new_found`](#api-fund-new-found) | 基金新发 | `GET` | `api/v1/market/data/fund/fund-new-found` | `start_date`, `end_date`, `fund_type`, `page`, `page_size` | `基金新发.md` | +| [`fund_overview`](#api-fund-overview) | 基金总览 | `GET` | `api/v1/market/data/fund/fund-overview` | `page`, `page_size` | `基金总览.md` | +| [`fund_portfolio`](#api-fund-portfolio) | 基金持仓明细 | `GET` | `api/v1/market/data/fund/fund-portfolio` | `fund_code`, `report_date`, `publish_date`, `start_date`, `end_date`, `page`, `page_size` | `基金持仓明细.md` | | [`fund_risk_level`](#api-fund-risk-level) | 基金风险等级 | `GET` | `api/v1/market/data/fund/fund-risk-level` | `fund_code`, `history` | `基金风险等级.md` | -| [`fund_index_fund`](#api-fund-index-fund) | 指数跟踪基金 | `GET` | `api/v1/market/data/fund/index-fund` | `index_code`, `scope` | `指数跟踪基金.md` | +| [`fund_share`](#api-fund-share) | 基金份额 | `GET` | `api/v1/market/data/fund/fund-share` | `fund_code`, `stati_perd`, `start_date`, `end_date`, `page`, `page_size` | `基金份额.md` | +| [`fund_support_symbols`](#api-fund-support-symbols) | 基金支持标的 | `GET` | `api/v1/market/data/fund/fund-support-symbols` | `page`, `page_size` | `基金支持标的.md` | ### 期货数据 @@ -251,80 +210,70 @@ df = market.baidu_financial_calendar( | [`china_futures_base_data`](#api-china-futures-base-data) | 中国期货基础数据 | `GET` | `api/v1/market/data/futures/futures-base-data` | `trade_date`, `symbol` | `中国期货基础数据.md` | | [`china_futures_lists`](#api-china-futures-lists) | 中国期货列表 | `GET` | `api/v1/market/data/futures/futures-lists` | `trade_date` | `中国期货列表.md` | | [`eastmoney_futures_position`](#api-eastmoney-futures-position) | 东方财富期货持仓 | `GET` | `api/v1/market/data/eastmoney-futures-position` | `exchange`, `variety_code`, `contract_code`, `trade_date`, `start_date`, `end_date`, `member_name_abbr`, `page`, `page_size` | `东方财富期货持仓.md` | -| [`eastmoney_futures_strange`](#api-eastmoney-futures-strange) | 东方财富期货龙虎榜 | `GET` | `api/v1/market/data/eastmoney-futures-strange` | `exchange`, `variety`, `contract`, `trade_date` | `东方财富期货龙虎榜.md` | -| [`futures_contract_kline`](#api-futures-contract-kline) | 期货合约K线 | `GET` | `api/v1/market/data/futures/kline` | `symbol`, `interval`, `start`, `end`, `limit` | `期货合约K线.md` | -| [`futures_eod_price`](#api-futures-eod-price) | 期货日终行情 | `GET` | `api/v1/market/data/futures/eod-price` | `exchange`, `symbol`, `trade_date`, `start_date`, `end_date`, `page`, `page_size` | `期货日终行情.md` | -| [`futures_kline`](#api-futures-kline) | 期货合约K线 | `GET` | `api/v1/market/data/futures/kline` | `symbol`, `interval`, `start`, `end`, `limit` | `期货合约K线.md` | -| [`futures_kline_intraday`](#api-futures-kline-intraday) | 期货日内K线 | `GET` | `api/v1/market/data/futures/kline/intraday` | `symbol`, `interval`, `start`, `end`, `limit` | `期货日内K线.md` | -| [`futures_kline_latest`](#api-futures-kline-latest) | 期货最新K线 | `GET` | `api/v1/market/data/futures/kline/latest` | `symbol`, `interval` | `期货最新K线.md` | +| [`ft_limit`](#api-ft-limit) | 期货合约涨跌停价 | `GET` | `api/v1/market/data/futures/ft-limit` | `ts_code`, `trade_date`, `start_date`, `end_date`, `cont`, `exchange`, `page`, `page_size` | `期货合约涨跌停价.md` | +| [`fut_settle`](#api-fut-settle) | 期货每日结算参数 | `GET` | `api/v1/market/data/futures/fut-settle` | `ts_code`, `trade_date`, `start_date`, `end_date`, `exchange`, `page`, `page_size` | `期货每日结算参数.md` | +| [`fut_weekly_detail`](#api-fut-weekly-detail) | 期货主要品种交易周报 | `GET` | `api/v1/market/data/futures/fut-weekly-detail` | `week`, `prd`, `start_week`, `end_week`, `exchange`, `page`, `page_size` | `期货主要品种交易周报.md` | +| [`fut_wsr`](#api-fut-wsr) | 期货仓单日报 | `GET` | `api/v1/market/data/futures/fut-wsr` | `trade_date`, `start_date`, `end_date`, `symbol`, `exchange`, `page`, `page_size` | `期货仓单日报.md` | +| [`futures_contract_kline`](#api-futures-contract-kline) | 期货行情 | `GET` | `api/v1/market/data/futures/kline` | `symbol`, `interval`, `start`, `end`, `limit` | `期货行情.md` | +| [`futures_minutes`](#api-futures-minutes) | 期货历史分钟行情 | `GET` | `api/v3/market/data/futures_minutes` | `symbol`, `interval`, `start`, `end`, `limit` | `期货历史分钟行情.md` | +| [`futures_minutes_realtime`](#api-futures-minutes-realtime) | 期货实时分钟K线 | `GET` | `api/v4/market/data/futures_minutes/realtime` | `symbols` | `期货实时分钟K线.md` | +| [`futures_nanhua_index_kline`](#api-futures-nanhua-index-kline) | 南华期货指数日K线 | `GET` | `api/v1/market/data/futures/nanhua-index-kline` | `code`, `trade_date`, `start_date`, `end_date`, `page`, `page_size` | `南华期货指数日K线.md` | | [`major_contract`](#api-major-contract) | 重大合同 | `GET` | `api/v1/market/data/corporate/contract` | `start_date`, `end_date` | `重大合同.md` | | [`major_contract_by_symbol`](#api-major-contract-by-symbol) | 重大合同按标的 | `GET` | `api/v1/market/data/corporate/contract/by-symbol` | `symbol`, `page`, `page_size` | `重大合同按标的.md` | | [`major_contract_summary`](#api-major-contract-summary) | 重大合同汇总 | `GET` | `api/v1/market/data/corporate/contract/summary` | `page`, `page_size` | `重大合同汇总.md` | -| [`member_build_process`](#api-member-build-process) | 会员建仓过程 | `GET` | `api/v1/market/data/member-build-process` | `exchange`, `member_name`, `instrument_id`, `start_date`, `end_date`, `contract_multiplier`, `page`, `page_size` | `会员建仓过程.md` | -| [`member_position_ranking`](#api-member-position-ranking) | 会员持仓排名 | `GET` | `api/v1/market/data/member-position-ranking` | `exchange`, `instrument_id`, `trade_date`, `direction`, `page`, `page_size` | `会员持仓排名.md` | ### 债券专题 | SDK 方法 | 接口名称 | HTTP | Path | 参数 | 来源文档 | |---|---|---|---|---|---| -| [`cb_base_data`](#api-cb-base-data) | 可转债基础数据 | `GET` | `api/v1/market/data/cb/cb-base-data` | `symbol_code` | `可转债基础数据.md` | -| [`cb_lists`](#api-cb-lists) | 可转债列表 | `GET` | `api/v1/market/data/cb/cb-lists` | - | `可转债列表.md` | -| [`convertible_bond_candlesticks`](#api-convertible-bond-candlesticks) | 可转债K线 | `POST` | `api/v1/market/data/convertible-bond-candlesticks` | `symbol`, `interval_unit`, `interval_value`, `adjust_kind`, `since_ts_millis`, `until_ts_millis`, `limit` | `可转债K线.md` | -| [`convertible_bond_candlesticks_batch`](#api-convertible-bond-candlesticks-batch) | 批量可转债K线 | `POST` | `api/v1/market/data/convertible-bond-candlesticks/batch` | `symbols`, `interval_unit`, `interval_value`, `adjust_kind`, `since_ts_millis`, `until_ts_millis`, `limit` | `批量可转债K线.md` | +| [`convertible_bond_candlesticks`](#api-convertible-bond-candlesticks) | 可转债K线 | `GET` | `api/v1/market/data/convertible-bond-candlesticks` | `symbol`, `interval_unit`, `interval_value`, `adjust_kind`, `since_ts_millis`, `until_ts_millis`, `limit` | `可转债K线.md` | +| [`szse_convertible_bond_declaration_snapshots`](#api-szse-convertible-bond-declaration-snapshots) | 深交所可转债申报快照 | `GET` | `api/v1/market/data/convertible-bond/szse/declaration-snapshots` | `security_code`, `trade_date`, `start_date`, `end_date`, `page`, `page_size` | `深交所可转债申报快照.md` | +| [`szse_convertible_bond_directed_trades`](#api-szse-convertible-bond-directed-trades) | 深交所可转债定向成交 | `GET` | `api/v1/market/data/convertible-bond/szse/directed-trades` | `security_code`, `trade_date`, `start_date`, `end_date`, `page`, `page_size` | `深交所可转债定向成交.md` | +| [`szse_convertible_bond_matching_trades`](#api-szse-convertible-bond-matching-trades) | 深交所可转债匹配成交 | `GET` | `api/v1/market/data/convertible-bond/szse/matching-trades` | `security_code`, `trade_date`, `start_date`, `end_date`, `page`, `page_size` | `深交所可转债匹配成交.md` | +| [`szse_convertible_bond_negotiated_trades`](#api-szse-convertible-bond-negotiated-trades) | 深交所可转债协议成交 | `GET` | `api/v1/market/data/convertible-bond/szse/negotiated-trades` | `security_code`, `trade_date`, `start_date`, `end_date`, `page`, `page_size` | `深交所可转债协议成交.md` | ### 宏观经济 | SDK 方法 | 接口名称 | HTTP | Path | 参数 | 来源文档 | |---|---|---|---|---|---| | [`baidu_financial_calendar`](#api-baidu-financial-calendar) | 百度财经日历 | `GET` | `api/v1/market/data/finance/financial-calendar/baidu` | `start_date`, `end_date`, `category`, `page`, `page_size` | `百度财经日历.md` | -| [`consumer_credit_monthly`](#api-consumer-credit-monthly) | 社融信贷 | `GET` | `api/v1/market/data/economic/china-credit-loans` | - | `社融信贷.md` | +| [`chinabond_yield_daily`](#api-chinabond-yield-daily) | 中债收益率曲线日度 | `GET` | `api/v1/market/data/chinabond-yield-daily` | `start_date`, `end_date`, `curve_name`, `page`, `page_size` | `中债收益率曲线日度.md` | +| [`consumer_credit_monthly`](#api-consumer-credit-monthly) | 社融信贷 | `GET` | `api/v1/market/data/economic/china-credit-loans` | `page`, `page_size` | `社融信贷.md` | | [`consumer_customs_trade_monthly`](#api-consumer-customs-trade-monthly) | 进出口 | `GET` | `api/v1/market/data/economic/china-customs-trade` | - | `进出口.md` | | [`consumer_fiscal_revenue_monthly`](#api-consumer-fiscal-revenue-monthly) | 财政收入 | `GET` | `api/v1/market/data/economic/china-fiscal-revenue` | - | `财政收入.md` | | [`consumer_fixed_asset_monthly`](#api-consumer-fixed-asset-monthly) | 固定资产投资 | `GET` | `api/v1/market/data/economic/china-fixed-asset-investment` | - | `固定资产投资.md` | | [`consumer_gdp_quarterly`](#api-consumer-gdp-quarterly) | GDP | `GET` | `api/v1/market/data/economic/china-gdp` | - | `GDP.md` | | [`consumer_industrial_added_value_monthly`](#api-consumer-industrial-added-value-monthly) | 工业增加值 | `GET` | `api/v1/market/data/economic/china-industrial-added-value` | - | `工业增加值.md` | -| [`consumer_money_supply_monthly`](#api-consumer-money-supply-monthly) | 货币供应 | `GET` | `api/v1/market/data/economic/china-money-supply` | - | `货币供应.md` | -| [`consumer_pmi_monthly`](#api-consumer-pmi-monthly) | PMI | `GET` | `api/v1/market/data/economic/china-pmi` | - | `PMI.md` | -| [`consumer_ppi_monthly`](#api-consumer-ppi-monthly) | PPI | `GET` | `api/v1/market/data/economic/china-ppi` | - | `PPI.md` | -| [`consumer_price_index_monthly`](#api-consumer-price-index-monthly) | CPI | `GET` | `api/v1/market/data/economic/china-cpi` | - | `CPI.md` | +| [`consumer_money_supply_monthly`](#api-consumer-money-supply-monthly) | 货币供应 | `GET` | `api/v1/market/data/economic/china-money-supply` | `page`, `page_size` | `货币供应.md` | +| [`consumer_pmi_monthly`](#api-consumer-pmi-monthly) | PMI | `GET` | `api/v1/market/data/economic/china-pmi` | `page`, `page_size` | `PMI.md` | +| [`consumer_ppi_monthly`](#api-consumer-ppi-monthly) | PPI | `GET` | `api/v1/market/data/economic/china-ppi` | `page`, `page_size` | `PPI.md` | +| [`consumer_price_index_monthly`](#api-consumer-price-index-monthly) | CPI | `GET` | `api/v1/market/data/economic/china-cpi` | `page`, `page_size` | `CPI.md` | | [`consumer_retail_sales_monthly`](#api-consumer-retail-sales-monthly) | 社零 | `GET` | `api/v1/market/data/economic/china-retail-sales` | - | `社零.md` | +| [`hibor_daily`](#api-hibor-daily) | HIBOR日度利率 | `GET` | `api/v1/market/data/hibor-daily` | `start_date`, `end_date`, `page`, `page_size` | `HIBOR日度利率.md` | +| [`libor_daily`](#api-libor-daily) | 国际基准利率日度 | `GET` | `api/v1/market/data/libor-daily` | `start_date`, `end_date`, `currency`, `tenor`, `page`, `page_size` | `国际基准利率日度.md` | | [`lpr_monthly`](#api-lpr-monthly) | LPR | `GET` | `api/v1/market/data/economic/china-lpr` | - | `LPR.md` | | [`reserve_ratio_monthly`](#api-reserve-ratio-monthly) | 存款准备金率 | `GET` | `api/v1/market/data/economic/china-reserve-ratio` | - | `存款准备金率.md` | +| [`shibor_daily`](#api-shibor-daily) | SHIBOR日度利率 | `GET` | `api/v1/market/data/shibor-daily` | `start_date`, `end_date`, `page`, `page_size` | `SHIBOR日度利率.md` | +| [`shibor_quote_daily`](#api-shibor-quote-daily) | SHIBOR报价日度 | `GET` | `api/v1/market/data/shibor-quote-daily` | `start_date`, `end_date`, `bank`, `page`, `page_size` | `SHIBOR报价日度.md` | | [`tax_revenue_monthly`](#api-tax-revenue-monthly) | 税收 | `GET` | `api/v1/market/data/economic/china-tax-revenue` | - | `税收.md` | | [`us_economic`](#api-us-economic) | 美国经济指标 | `GET` | `api/v1/market/data/economic/us-economic` | `type` | `美国经济指标.md` | | [`wallstreetcn_financial_calendar`](#api-wallstreetcn-financial-calendar) | 华尔街见闻财经日历 | `GET` | `api/v1/market/data/finance/financial-calendar/wallstreetcn` | `start_date`, `end_date`, `page`, `page_size` | `华尔街见闻财经日历.md` | +| [`wz_index_daily`](#api-wz-index-daily) | 温州民间融资综合利率指数日度 | `GET` | `api/v1/market/data/wz-index-daily` | `start_date`, `end_date`, `page`, `page_size` | `温州民间融资综合利率指数日度.md` | ### 大模型语料 | SDK 方法 | 接口名称 | HTTP | Path | 参数 | 来源文档 | |---|---|---|---|---|---| -| [`semantic_search_news`](#api-semantic-search-news) | 新闻语义搜索 | `GET` | `api/v1/market/data/semantic-search-news` | `query`, `limit`, `year`, `start_time`, `end_time` | `新闻语义搜索.md` | +| [`semantic_search_news`](#api-semantic-search-news) | 新闻语义搜索 | `GET` | `api/v3/market/data/semantic-search-news` | `query`, `limit`, `year`, `start_time`, `end_time` | `新闻语义搜索.md` | | [`shareholders_meeting`](#api-shareholders-meeting) | 股东大会 | `GET` | `api/v1/market/data/corporate/meeting` | `page`, `page_size` | `股东大会.md` | -| [`stock_announcements`](#api-stock-announcements) | 公告列表 | `GET` | `api/v1/market/data/announcements/stock-announcements` | `stock_code`, `start_date`, `end_date`, `type`, `page`, `page_size` | `公告列表.md` | -| [`stock_reports`](#api-stock-reports) | 研报列表 | `GET` | `api/v1/market/data/report/stock-reports` | `stock_code`, `start_date`, `end_date`, `type`, `page`, `page_size` | `研报列表.md` | -| [`type_reports`](#api-type-reports) | 研报分类 | `GET` | `api/v1/market/data/report/type-reports` | `rept_type`, `start_date`, `end_date`, `page`, `page_size` | `研报分类.md` | +| [`stock_announcements`](#api-stock-announcements) | 公告列表 | `GET` | `api/v3/market/data/announcements/stock-announcements` | `stock_code`, `start_date`, `end_date`, `type`, `page`, `page_size` | `公告列表.md` | +| [`stock_reports`](#api-stock-reports) | 研报列表 | `GET` | `api/v3/market/data/report/stock-reports` | `stock_code`, `start_date`, `end_date`, `type`, `page`, `page_size` | `研报列表.md` | ### 现货数据 | SDK 方法 | 接口名称 | HTTP | Path | 参数 | 来源文档 | |---|---|---|---|---|---| | [`bullion_price`](#api-bullion-price) | 贵金属价格 | `GET` | `api/v1/market/data/bullion/price` | `symbol`, `start_date`, `end_date`, `page`, `page_size` | `贵金属价格.md` | -| [`bullion_support_symbol`](#api-bullion-support-symbol) | 贵金属支持标的 | `GET` | `api/v1/market/data/bullion/support-symbol` | - | `贵金属支持标的.md` | - -### 外汇数据 - -| SDK 方法 | 接口名称 | HTTP | Path | 参数 | 来源文档 | -|---|---|---|---|---|---| -| [`consumer_forex_gold_monthly`](#api-consumer-forex-gold-monthly) | 外汇黄金 | `GET` | `api/v1/market/data/economic/china-forex-gold` | - | `外汇黄金.md` | - -### 未发布 - -| SDK 方法 | 接口名称 | HTTP | Path | 参数 | 来源文档 | -|---|---|---|---|---|---| -| [`stock_dividends_paginated`](#api-stock-dividends-paginated) | 股票分红记录分页 | `GET` | `api/v1/market/data/dividends` | `page`, `page_size` | `股票分红记录分页.md` | -| [`stock_intraday`](#api-stock-intraday) | 股票日内分时 | `GET` | `api/v1/market/security/{symbol}/intraday` | `symbol` | `股票日内分时.md` | -| [`stock_ipos_paginated`](#api-stock-ipos-paginated) | 股票IPO分页 | `GET` | `api/v1/market/data/stock-ipos` | `page`, `page_size` | `股票IPO分页.md` | -| [`stock_related`](#api-stock-related) | 相关股票 | `GET` | `api/v1/market/security/{symbol}/related` | `symbol`, `limit` | `相关股票.md` | ## 接口详情 @@ -335,7 +284,7 @@ df = market.baidu_financial_calendar( - 接口名称:龙虎榜明细 - HTTP:`GET` - Path:`api/v1/market/data/abnormal-trading-details` -- 参数:`date` +- 参数:`date`, `page`, `page_size` - 来源文档:`龙虎榜明细.md` - 原始接口:`abnormal_trading_details` @@ -364,7 +313,7 @@ Returns: - 接口名称:龙虎榜总览 - HTTP:`GET` - Path:`api/v1/market/data/abnormal-trading-overview` -- 参数:`date` +- 参数:`date`, `page`, `page_size` - 来源文档:`龙虎榜总览.md` - 原始接口:`abnormal_trading_overview` @@ -388,11 +337,50 @@ Returns: payloads when multi-page fetching is used with ``raw=True``. ``` +

ashare_interactions

+ +- 接口名称:e互动 +- HTTP:`GET` +- Path:`api/v3/market/data/ashare-interactions` +- 参数:`start_date`, `end_date`, `trade_code`, `company_name`, `industry_code`, `industry_name`, `data_source`, `page`, `page_size` +- 来源文档:`e互动.md` +- 原始接口:`ashare_interactions` + +```text +e互动. +``` + +

ashare_news_sentiment_factors

+ +- 接口名称:A股新闻情绪因子 +- HTTP:`GET` +- Path:`api/v3/market/data/ashare-news-sentiment-factors` +- 参数:`trade_code`, `start_date`, `end_date`, `page`, `page_size` +- 来源文档:`A股新闻情绪因子.md` +- 原始接口:`ashare_news_sentiment_factors` + +```text +A股新闻情绪因子. +``` + +

ashare_rating_factor_snapshot

+ +- 接口名称:A股相关性 Top-K +- HTTP:`GET` +- Path:`api/v3/market/data/ashare-rating-factor-snapshot` +- 参数:`trade_code`, `date`, `top_k` +- 来源文档:`A股相关性Top-K.md` +- 原始接口:`ashare_rating_factor_snapshot` + +```text +A股相关性 Top-K. +``` +

auction_results

- 接口名称:集合竞价结果 - HTTP:`GET` -- Path:`api/v1/market/data/auction-results` +- Path:`api/v2/market/data/auction-results` - 参数:`ts_code`, `trade_date`, `start_date`, `end_date`, `page`, `page_size` - 来源文档:`集合竞价结果.md` - 原始接口:`auction_results` @@ -466,7 +454,7 @@ Returns: - 接口名称:大宗交易 - HTTP:`GET` - Path:`api/v1/market/data/block-trades` -- 参数:`date` +- 参数:`date`, `page`, `page_size` - 来源文档:`大宗交易.md` - 原始接口:`block_trades` @@ -509,15 +497,15 @@ Documented endpoint: ``get_bse_mapping``. Args: o_code: 旧代码(如 `838163.BJ`) (type: string; required: N). n_code: 新代码(如 `920163.BJ`) (type: string; required: N). + page: Page number, starting from 1. + page_size: Rows per page, up to the endpoint-specific maximum. + limit: Maximum number of rows to return. The SDK may fetch multiple pages to satisfy this limit. + all_pages: Fetch and combine pages until the server reports the last page. + max_pages: Optional safety cap for ``all_pages``. raw: Return the decoded JSON payload without tabular extraction. fields: Optional field list or comma-separated field string applied after extraction. as_dataframe: Return a pandas ``DataFrame`` by default; set to ``False`` for Python rows. **kwargs: Extra request parameters forwarded unchanged. Useful when the service adds parameters before the SDK is regenerated. - -Returns: - A pandas ``DataFrame`` by default, Python rows when - ``as_dataframe=False``, raw JSON when ``raw=True``, or raw page - payloads when multi-page fetching is used with ``raw=True``. ```

cashflow

@@ -556,48 +544,11 @@ Returns: payloads when multi-page fetching is used with ``raw=True``. ``` -

daec_ohlcs

- -- 接口名称:DAEC历史OHLC -- HTTP:`GET` -- Path:`api/v1/market/data/daec/history/ohlcs` -- 参数:`symbol`, `since`, `until`, `interval`, `adjust`, `compat`, `span`, `limit`, `until_ts_ms` -- 来源文档:`DAEC历史OHLC.md` -- 原始接口:`daec_ohlcs` - -```text -DAEC历史OHLC. - -Endpoint: ``api/v1/market/data/daec/history/ohlcs``. -Method: ``GET``. -Documented endpoint: ``daec_ohlcs``. - -Args: - symbol: 标的代码 (type: string; required: Y). - since: 起始时间 (type: string; required: N). - until: 截止时间 (type: string; required: N). - interval: K 线周期 (type: string; required: N). - adjust: 复权类型 (type: string; required: N). - compat: 兼容模式 (type: string; required: N). - span: 时间跨度 (type: string; required: N). - limit: 返回条数 (type: int; required: N). - until_ts_ms: 截止时间戳(毫秒) (type: int; required: N). - raw: Return the decoded JSON payload without tabular extraction. - fields: Optional field list or comma-separated field string applied after extraction. - as_dataframe: Return a pandas ``DataFrame`` by default; set to ``False`` for Python rows. - **kwargs: Extra request parameters forwarded unchanged. Useful when the service adds parameters before the SDK is regenerated. - -Returns: - A pandas ``DataFrame`` by default, Python rows when - ``as_dataframe=False``, raw JSON when ``raw=True``, or raw page - payloads when multi-page fetching is used with ``raw=True``. -``` -

cashflow_stock_code

- 接口名称:现金流支持股票代码 - HTTP:`GET` -- Path:`api/v1/market/data/finance/cashflow-stock-code` +- Path:`api/v2/market/data/finance/cashflow-stock-code` - 参数:- - 来源文档:`现金流支持股票代码.md` - 原始接口:`get_cashflow_stock_code` @@ -696,7 +647,7 @@ Returns: - 接口名称:东方财富板块成份股 - HTTP:`GET` -- Path:`api/v1/market/data/eastmoney-board-constituents` +- Path:`api/v2/market/data/eastmoney-board-constituents` - 参数:`board_code` - 来源文档:`东方财富板块成份股.md` - 原始接口:`eastmoney_board_constituents` @@ -725,7 +676,7 @@ Returns: - 接口名称:东方财富板块日线OHLC - HTTP:`GET` -- Path:`api/v1/market/data/eastmoney-board-daily-ohlc` +- Path:`api/v2/market/data/eastmoney-board-daily-ohlc` - 参数:`board_code`, `start_date`, `end_date`, `page`, `page_size` - 来源文档:`东方财富板块日线OHLC.md` - 原始接口:`eastmoney_board_daily_kline` @@ -757,80 +708,11 @@ Returns: payloads when multi-page fetching is used with ``raw=True``. ``` -

eastmoney_all_board_daily_kline

- -- 接口名称:东方财富全板块日线OHLC -- HTTP:`GET` -- Path:`api/v1/market/data/eastmoney-all-board-daily-ohlc` -- 参数:`start_date`, `end_date`, `page`, `page_size` -- 来源文档:`东方财富全板块日线OHLC.md` -- 原始接口:`eastmoney_all_board_daily_kline` - -```text -东方财富全板块日线OHLC. - -Endpoint: ``api/v1/market/data/eastmoney-all-board-daily-ohlc``. -Method: ``GET``. -Documented endpoint: ``eastmoney_all_board_daily_kline``. - -Args: - start_date: 起始日期(含),YYYY-MM-DD 或 YYYYMMDD (type: string; required: N). - end_date: 截止日期(含),YYYY-MM-DD 或 YYYYMMDD (type: string; required: N). - page: Page number, starting from 1. If omitted, the server default is used unless ``limit`` or ``all_pages`` is set. - page_size: Rows per page. The SDK validates this against the endpoint-specific maximum. - limit: Maximum number of rows to return. The SDK may fetch multiple pages to satisfy this limit. - all_pages: Fetch and combine pages until the server reports the last page. - max_pages: Optional safety cap for ``all_pages``. - raw: Return the decoded JSON payload without tabular extraction. - fields: Optional field list or comma-separated field string applied after extraction. - as_dataframe: Return a pandas ``DataFrame`` by default; set to ``False`` for Python rows. - **kwargs: Extra request parameters forwarded unchanged. Useful when the service adds parameters before the SDK is regenerated. - -Returns: - A pandas ``DataFrame`` by default, Python rows when - ``as_dataframe=False``, raw JSON when ``raw=True``, or raw page - payloads when multi-page fetching is used with ``raw=True``. -``` - -

eastmoney_board_latest_kline

- -- 接口名称:东方财富板块最新OHLC -- HTTP:`GET` -- Path:`api/v1/market/data/eastmoney-board-latest-ohlc` -- 参数:`board_code`, `page`, `page_size` -- 来源文档:`东方财富板块最新OHLC.md` -- 原始接口:`eastmoney_board_latest_kline` - -```text -东方财富板块最新OHLC. - -Endpoint: ``api/v1/market/data/eastmoney-board-latest-ohlc``. -Method: ``GET``. -Documented endpoint: ``eastmoney_board_latest_kline``. - -Args: - board_code: 板块代码,如 BK1024;不传则返回全部板块最新K线 (type: string; required: N). - page: Page number, starting from 1. If omitted, the server default is used unless ``limit`` or ``all_pages`` is set. - page_size: Rows per page. The SDK validates this against the endpoint-specific maximum. - limit: Maximum number of rows to return. The SDK may fetch multiple pages to satisfy this limit. - all_pages: Fetch and combine pages until the server reports the last page. - max_pages: Optional safety cap for ``all_pages``. - raw: Return the decoded JSON payload without tabular extraction. - fields: Optional field list or comma-separated field string applied after extraction. - as_dataframe: Return a pandas ``DataFrame`` by default; set to ``False`` for Python rows. - **kwargs: Extra request parameters forwarded unchanged. Useful when the service adds parameters before the SDK is regenerated. - -Returns: - A pandas ``DataFrame`` by default, Python rows when - ``as_dataframe=False``, raw JSON when ``raw=True``, or raw page - payloads when multi-page fetching is used with ``raw=True``. -``` -

eastmoney_concept_boards

- 接口名称:东方财富概念板块 - HTTP:`GET` -- Path:`api/v1/market/data/eastmoney-concept-boards` +- Path:`api/v2/market/data/eastmoney-concept-boards` - 参数:- - 来源文档:`东方财富概念板块.md` - 原始接口:`eastmoney_concept_boards` @@ -858,7 +740,7 @@ Returns: - 接口名称:东方财富大盘资金流 - HTTP:`GET` -- Path:`api/v1/market/data/eastmoney-dapan-flow` +- Path:`api/v2/market/data/eastmoney-dapan-flow` - 参数:`trade_date`, `start_date`, `end_date`, `page`, `page_size` - 来源文档:`东方财富大盘资金流.md` - 原始接口:`get_eastmoney_dapan_flow` @@ -931,7 +813,7 @@ Returns: - 接口名称:东方财富股票排名 - HTTP:`GET` -- Path:`api/v1/market/data/eastmoney-rank` +- Path:`api/v2/market/data/eastmoney-rank` - 参数:`rank_group`, `market`, `trade_date` - 来源文档:`东方财富股票排名.md` - 原始接口:`eastmoney_rank` @@ -962,7 +844,7 @@ Returns: - 接口名称:东方财富板块资金流 - HTTP:`GET` -- Path:`api/v1/market/data/eastmoney-sector-flow` +- Path:`api/v2/market/data/eastmoney-sector-flow` - 参数:`sector_code`, `sector_type`, `trade_date`, `start_date`, `end_date`, `page`, `page_size` - 来源文档:`东方财富板块资金流.md` - 原始接口:`get_eastmoney_sector_flow` @@ -1070,6 +952,19 @@ Returns: payloads when multi-page fetching is used with ``raw=True``. ``` +

exchange_margin_summaries

+ +- 接口名称:交易所融资融券汇总日度 +- HTTP:`GET` +- Path:`api/v1/market/data/exchange-margin-summaries` +- 参数:`start_date`, `end_date`, `exchange`, `page`, `page_size` +- 来源文档:`交易所融资融券汇总日度.md` +- 原始接口:`exchange_margin_summaries` + +```text +交易所融资融券汇总日度. +``` +

goodwill_industry

- 接口名称:商誉行业 @@ -1234,62 +1129,6 @@ Returns: payloads when multi-page fetching is used with ``raw=True``. ``` -

hk_sh_stock_connect_members

- -- 接口名称:沪港通成份 -- HTTP:`GET` -- Path:`api/v1/market/data/hk-sh-stock-connect-members` -- 参数:- -- 来源文档:`沪港通成份.md` -- 原始接口:`hk_sh_stock_connect_members` - -```text -沪港通成份. - -Endpoint: ``api/v1/market/data/hk-sh-stock-connect-members``. -Method: ``GET``. -Documented endpoint: ``hk_sh_stock_connect_members``. - -Args: - raw: Return the decoded JSON payload without tabular extraction. - fields: Optional field list or comma-separated field string applied after extraction. - as_dataframe: Return a pandas ``DataFrame`` by default; set to ``False`` for Python rows. - **kwargs: Extra request parameters forwarded unchanged. Useful when the service adds parameters before the SDK is regenerated. - -Returns: - A pandas ``DataFrame`` by default, Python rows when - ``as_dataframe=False``, raw JSON when ``raw=True``, or raw page - payloads when multi-page fetching is used with ``raw=True``. -``` - -

hk_sz_stock_connect_members

- -- 接口名称:深港通成份 -- HTTP:`GET` -- Path:`api/v1/market/data/hk-sz-stock-connect-members` -- 参数:- -- 来源文档:`深港通成份.md` -- 原始接口:`hk_sz_stock_connect_members` - -```text -深港通成份. - -Endpoint: ``api/v1/market/data/hk-sz-stock-connect-members``. -Method: ``GET``. -Documented endpoint: ``hk_sz_stock_connect_members``. - -Args: - raw: Return the decoded JSON payload without tabular extraction. - fields: Optional field list or comma-separated field string applied after extraction. - as_dataframe: Return a pandas ``DataFrame`` by default; set to ``False`` for Python rows. - **kwargs: Extra request parameters forwarded unchanged. Useful when the service adds parameters before the SDK is regenerated. - -Returns: - A pandas ``DataFrame`` by default, Python rows when - ``as_dataframe=False``, raw JSON when ``raw=True``, or raw page - payloads when multi-page fetching is used with ``raw=True``. -``` -

income

- 接口名称:A股利润表 @@ -1326,40 +1165,24 @@ Returns: payloads when multi-page fetching is used with ``raw=True``. ``` -

limit_down_pool

+

kline_pattern_annotations

-- 接口名称:跌停池 +- 接口名称:K线形态标注 - HTTP:`GET` -- Path:`api/v1/market/data/limit-down-pool` -- 参数:`trade_date` -- 来源文档:`跌停池.md` -- 原始接口:`limit_down_pool` +- Path:`api/v3/market/data/kline-pattern-annotations` +- 参数:`date`, `trade_code`, `pattern`, `page`, `page_size` +- 来源文档:`K线形态标注.md` +- 原始接口:`kline_pattern_annotations` ```text -跌停池. - -Endpoint: ``api/v1/market/data/limit-down-pool``. -Method: ``GET``. -Documented endpoint: ``limit_down_pool``. - -Args: - trade_date: 交易日期,格式 YYYYMMDD;不传或传当日时查询实时数据 (type: string; required: N). - raw: Return the decoded JSON payload without tabular extraction. - fields: Optional field list or comma-separated field string applied after extraction. - as_dataframe: Return a pandas ``DataFrame`` by default; set to ``False`` for Python rows. - **kwargs: Extra request parameters forwarded unchanged. Useful when the service adds parameters before the SDK is regenerated. - -Returns: - A pandas ``DataFrame`` by default, Python rows when - ``as_dataframe=False``, raw JSON when ``raw=True``, or raw page - payloads when multi-page fetching is used with ``raw=True``. +K线形态标注. ```

limit_event_timeline_3s

- 接口名称:涨跌停事件时间线 - HTTP:`GET` -- Path:`api/v1/market/data/limit-event-timeline-3s` +- Path:`api/v2/market/data/limit-event-timeline-3s` - 参数:`symbol`, `trade_date` - 来源文档:`涨跌停事件时间线.md` - 原始接口:`limit_event_timeline_3s` @@ -1385,90 +1208,43 @@ Returns: payloads when multi-page fetching is used with ``raw=True``. ``` -

limit_up_break_pool

+

limit_list

-- 接口名称:炸板池 +- 接口名称:涨跌停池 - HTTP:`GET` -- Path:`api/v1/market/data/limit-up-break-pool` -- 参数:`trade_date` -- 来源文档:`炸板池.md` -- 原始接口:`limit_up_break_pool` +- Path:`api/v1/market/data/limit-list` +- 参数:`limit_type`, `trade_date` +- 来源文档:`涨跌停池.md` +- 原始接口:`limit_list` ```text -炸板池. - -Endpoint: ``api/v1/market/data/limit-up-break-pool``. -Method: ``GET``. -Documented endpoint: ``limit_up_break_pool``. - -Args: - trade_date: 交易日期,格式 YYYYMMDD;不传或传当日时查询实时数据 (type: string; required: N). - raw: Return the decoded JSON payload without tabular extraction. - fields: Optional field list or comma-separated field string applied after extraction. - as_dataframe: Return a pandas ``DataFrame`` by default; set to ``False`` for Python rows. - **kwargs: Extra request parameters forwarded unchanged. Useful when the service adds parameters before the SDK is regenerated. - -Returns: - A pandas ``DataFrame`` by default, Python rows when - ``as_dataframe=False``, raw JSON when ``raw=True``, or raw page - payloads when multi-page fetching is used with ``raw=True``. +涨跌停池. ``` -

limit_up_pool

+

limit_up_briefs

-- 接口名称:涨停池 +- 接口名称:涨停简报 - HTTP:`GET` -- Path:`api/v1/market/data/limit-up-pool` -- 参数:`trade_date` -- 来源文档:`涨停池.md` -- 原始接口:`limit_up_pool` +- Path:`api/v3/market/data/limit-up-reports/briefs` +- 参数:`date` +- 来源文档:`涨停简报.md` +- 原始接口:`limit_up_briefs` ```text -涨停池. - -Endpoint: ``api/v1/market/data/limit-up-pool``. -Method: ``GET``. -Documented endpoint: ``limit_up_pool``. - -Args: - trade_date: 交易日期,格式 YYYYMMDD;不传或传当日时查询实时数据 (type: string; required: N). - raw: Return the decoded JSON payload without tabular extraction. - fields: Optional field list or comma-separated field string applied after extraction. - as_dataframe: Return a pandas ``DataFrame`` by default; set to ``False`` for Python rows. - **kwargs: Extra request parameters forwarded unchanged. Useful when the service adds parameters before the SDK is regenerated. - -Returns: - A pandas ``DataFrame`` by default, Python rows when - ``as_dataframe=False``, raw JSON when ``raw=True``, or raw page - payloads when multi-page fetching is used with ``raw=True``. +涨停简报. ``` -

limit_up_pool_yesterday

+

limit_up_public_report

-- 接口名称:昨日涨停池 +- 接口名称:涨停对外归因报告 - HTTP:`GET` -- Path:`api/v1/market/data/limit-up-pool-yesterday` -- 参数:- -- 来源文档:`昨日涨停池.md` -- 原始接口:`limit_up_pool_yesterday` +- Path:`api/v3/market/data/limit-up-reports/public-report` +- 参数:`date`, `security_code` +- 来源文档:`涨停对外归因报告.md` +- 原始接口:`limit_up_public_report` ```text -昨日涨停池. - -Endpoint: ``api/v1/market/data/limit-up-pool-yesterday``. -Method: ``GET``. -Documented endpoint: ``limit_up_pool_yesterday``. - -Args: - raw: Return the decoded JSON payload without tabular extraction. - fields: Optional field list or comma-separated field string applied after extraction. - as_dataframe: Return a pandas ``DataFrame`` by default; set to ``False`` for Python rows. - **kwargs: Extra request parameters forwarded unchanged. Useful when the service adds parameters before the SDK is regenerated. - -Returns: - A pandas ``DataFrame`` by default, Python rows when - ``as_dataframe=False``, raw JSON when ``raw=True``, or raw page - payloads when multi-page fetching is used with ``raw=True``. +涨停对外归因报告. ```

margin_trading_details

@@ -1505,72 +1281,9 @@ Returns: payloads when multi-page fetching is used with ``raw=True``. ``` -

margin_trading_details_paginated

+

namechange

-- 接口名称:融资融券明细分页 -- HTTP:`GET` -- Path:`api/v1/market/data/margin-trading-details` -- 参数:`date`, `page`, `page_size` -- 来源文档:`融资融券明细分页.md` -- 原始接口:`margin_trading_details_paginated` - -```text -融资融券明细分页. - -Endpoint: ``api/v1/market/data/margin-trading-details``. -Method: ``GET``. -Documented endpoint: ``margin_trading_details_paginated``. - -Args: - date: 查询日期 YYYYMMDD;不传则使用当前内存快照 (type: string; required: N). - page: Page number, starting from 1. If omitted, the server default is used unless ``limit`` or ``all_pages`` is set. - page_size: Rows per page. The SDK validates this against the endpoint-specific maximum. - limit: Maximum number of rows to return. The SDK may fetch multiple pages to satisfy this limit. - all_pages: Fetch and combine pages until the server reports the last page. - max_pages: Optional safety cap for ``all_pages``. - raw: Return the decoded JSON payload without tabular extraction. - fields: Optional field list or comma-separated field string applied after extraction. - as_dataframe: Return a pandas ``DataFrame`` by default; set to ``False`` for Python rows. - **kwargs: Extra request parameters forwarded unchanged. Useful when the service adds parameters before the SDK is regenerated. - -Returns: - A pandas ``DataFrame`` by default, Python rows when - ``as_dataframe=False``, raw JSON when ``raw=True``, or raw page - payloads when multi-page fetching is used with ``raw=True``. -``` - -

northbound

- -- 接口名称:北向资金交易 -- HTTP:`GET` -- Path:`api/v1/market/data/northbound` -- 参数:`date` -- 来源文档:`北向资金交易.md` -- 原始接口:`northbound` - -```text -北向资金交易. - -Endpoint: ``api/v1/market/data/northbound``. -Method: ``GET``. -Documented endpoint: ``northbound``. - -Args: - date: 交易日,格式 YYYYMMDD (type: string; required: Y). - raw: Return the decoded JSON payload without tabular extraction. - fields: Optional field list or comma-separated field string applied after extraction. - as_dataframe: Return a pandas ``DataFrame`` by default; set to ``False`` for Python rows. - **kwargs: Extra request parameters forwarded unchanged. Useful when the service adds parameters before the SDK is regenerated. - -Returns: - A pandas ``DataFrame`` by default, Python rows when - ``as_dataframe=False``, raw JSON when ``raw=True``, or raw page - payloads when multi-page fetching is used with ``raw=True``. -``` - -

namechange

- -- 接口名称:股票曾用名 +- 接口名称:股票曾用名 - HTTP:`GET` - Path:`api/v1/market/data/namechange` - 参数:`trade_code`, `start_date`, `end_date` @@ -1599,24 +1312,24 @@ Returns: payloads when multi-page fetching is used with ``raw=True``. ``` -

nth_trade_date

+

northbound

-- 接口名称:第N个交易日 +- 接口名称:北向资金交易 - HTTP:`GET` -- Path:`api/v1/market/data/time/get-nth-trade-date` -- 参数:`n` -- 来源文档:`第N个交易日.md` -- 原始接口:`get_nth_trade_date` +- Path:`api/v1/market/data/northbound` +- 参数:`date` +- 来源文档:`北向资金交易.md` +- 原始接口:`northbound` ```text -第N个交易日. +北向资金交易. -Endpoint: ``api/v1/market/data/time/get-nth-trade-date``. +Endpoint: ``api/v1/market/data/northbound``. Method: ``GET``. -Documented endpoint: ``get_nth_trade_date``. +Documented endpoint: ``northbound``. Args: - n: 需要获取的前 N 个交易日,N >= 1 (type: uint32; required: Y). + date: 交易日,格式 YYYYMMDD (type: string; required: Y). raw: Return the decoded JSON payload without tabular extraction. fields: Optional field list or comma-separated field string applied after extraction. as_dataframe: Return a pandas ``DataFrame`` by default; set to ``False`` for Python rows. @@ -1664,26 +1377,28 @@ Returns: payloads when multi-page fetching is used with ``raw=True``. ``` -

trading_calendar

+

pledge_summary

-- 接口名称:交易日历 +- 接口名称:股权质押汇总 - HTTP:`GET` -- Path:`api/v1/market/data/time/trading-calendar` -- 参数:`market`, `start_date`, `end_date` -- 来源文档:`交易日历.md` -- 原始接口:`trading_calendar` +- Path:`api/v1/market/data/pledge/pledge-summary` +- 参数:`page`, `page_size` +- 来源文档:`股权质押汇总.md` +- 原始接口:`stock_pledge_summary` ```text -交易日历. +股权质押汇总. -Endpoint: ``api/v1/market/data/time/trading-calendar``. +Endpoint: ``api/v1/market/data/pledge/pledge-summary``. Method: ``GET``. -Documented endpoint: ``trading_calendar``. +Documented endpoint: ``stock_pledge_summary``. Args: - market: 市场标识 (type: string; required: N). - start_date: 起始日期 (type: string; required: N). - end_date: 截止日期 (type: string; required: N). + page: Page number, starting from 1. If omitted, the server default is used unless ``limit`` or ``all_pages`` is set. + page_size: Rows per page. The SDK validates this against the endpoint-specific maximum. + limit: Maximum number of rows to return. The SDK may fetch multiple pages to satisfy this limit. + all_pages: Fetch and combine pages until the server reports the last page. + max_pages: Optional safety cap for ``all_pages``. raw: Return the decoded JSON payload without tabular extraction. fields: Optional field list or comma-separated field string applied after extraction. as_dataframe: Return a pandas ``DataFrame`` by default; set to ``False`` for Python rows. @@ -1699,7 +1414,7 @@ Returns: - 接口名称:价格变动 - HTTP:`GET` -- Path:`api/v1/market/data/price/get-price-change` +- Path:`api/v2/market/data/price/get-price-change` - 参数:`stock_code`, `base_date`, `n`, `direction` - 来源文档:`价格变动.md` - 原始接口:`get_price_change` @@ -1731,7 +1446,7 @@ Returns: - 接口名称:风险警示股行情 - HTTP:`GET` -- Path:`api/v1/market/data/risk-warning-stocks/quotes` +- Path:`api/v2/market/data/risk-warning-stocks/quotes` - 参数:`date` - 来源文档:`风险警示股行情.md` - 原始接口:`risk_warning_stock_quotes` @@ -1761,7 +1476,7 @@ Returns: - 接口名称:风险警示股 - HTTP:`GET` - Path:`api/v1/market/data/risk-warning-stocks` -- 参数:`date` +- 参数:`date`, `page`, `page_size` - 来源文档:`风险警示股.md` - 原始接口:`risk_warning_stocks` @@ -1785,75 +1500,11 @@ Returns: payloads when multi-page fetching is used with ``raw=True``. ``` -

report_announcement_list

- -- 接口名称:报告公告列表 -- HTTP:`GET` -- Path:`api/v1/market/data/report-announcements/list` -- 参数:`date`, `sec_code`, `page`, `page_size` -- 来源文档:`报告公告列表.md` -- 原始接口:`report_announcement_list` - -```text -报告公告列表. - -Endpoint: ``api/v1/market/data/report-announcements/list``. -Method: ``GET``. -Documented endpoint: ``report_announcement_list``. - -Args: - date: 公告日期 (type: string; required: N). - sec_code: 证券代码 (type: string; required: N). - page: Page number, starting from 1. If omitted, the server default is used unless ``limit`` or ``all_pages`` is set. - page_size: Rows per page. The SDK validates this against the endpoint-specific maximum. - limit: Maximum number of rows to return. The SDK may fetch multiple pages to satisfy this limit. - all_pages: Fetch and combine pages until the server reports the last page. - max_pages: Optional safety cap for ``all_pages``. - raw: Return the decoded JSON payload without tabular extraction. - fields: Optional field list or comma-separated field string applied after extraction. - as_dataframe: Return a pandas ``DataFrame`` by default; set to ``False`` for Python rows. - **kwargs: Extra request parameters forwarded unchanged. Useful when the service adds parameters before the SDK is regenerated. - -Returns: - A pandas ``DataFrame`` by default, Python rows when - ``as_dataframe=False``, raw JSON when ``raw=True``, or raw page - payloads when multi-page fetching is used with ``raw=True``. -``` - -

report_announcement_summary

- -- 接口名称:报告公告摘要 -- HTTP:`GET` -- Path:`api/v1/market/data/report-announcements/summary` -- 参数:`announcement_id` -- 来源文档:`报告公告摘要.md` -- 原始接口:`report_announcement_summary` - -```text -报告公告摘要. - -Endpoint: ``api/v1/market/data/report-announcements/summary``. -Method: ``GET``. -Documented endpoint: ``report_announcement_summary``. - -Args: - announcement_id: 公告 ID (type: string; required: Y). - raw: Return the decoded JSON payload without tabular extraction. - fields: Optional field list or comma-separated field string applied after extraction. - as_dataframe: Return a pandas ``DataFrame`` by default; set to ``False`` for Python rows. - **kwargs: Extra request parameters forwarded unchanged. Useful when the service adds parameters before the SDK is regenerated. - -Returns: - A pandas ``DataFrame`` by default, Python rows when - ``as_dataframe=False``, raw JSON when ``raw=True``, or raw page - payloads when multi-page fetching is used with ``raw=True``. -``` - - 接口名称:标的搜索 - HTTP:`GET` -- Path:`api/v1/market/security/search` +- Path:`api/v2/market/security/search/` - 参数:`query`, `limit` - 来源文档:`标的搜索.md` - 原始接口:`search` @@ -1879,34 +1530,6 @@ Returns: payloads when multi-page fetching is used with ``raw=True``. ``` -

sh_hk_stock_connect_members

- -- 接口名称:沪股通成份 -- HTTP:`GET` -- Path:`api/v1/market/data/sh-hk-stock-connect-members` -- 参数:- -- 来源文档:`沪股通成份.md` -- 原始接口:`sh_hk_stock_connect_members` - -```text -沪股通成份. - -Endpoint: ``api/v1/market/data/sh-hk-stock-connect-members``. -Method: ``GET``. -Documented endpoint: ``sh_hk_stock_connect_members``. - -Args: - raw: Return the decoded JSON payload without tabular extraction. - fields: Optional field list or comma-separated field string applied after extraction. - as_dataframe: Return a pandas ``DataFrame`` by default; set to ``False`` for Python rows. - **kwargs: Extra request parameters forwarded unchanged. Useful when the service adds parameters before the SDK is regenerated. - -Returns: - A pandas ``DataFrame`` by default, Python rows when - ``as_dataframe=False``, raw JSON when ``raw=True``, or raw page - payloads when multi-page fetching is used with ``raw=True``. -``` -

southbound

- 接口名称:南向资金交易 @@ -1936,73 +1559,17 @@ Returns: payloads when multi-page fetching is used with ``raw=True``. ``` -

stk_ah_comparison

- -- 接口名称:AH股对比 -- HTTP:`GET` -- Path:`api/v1/market/data/hk/stk-ah-comparison` -- 参数:`hk_code`, `ts_code`, `trade_date`, `start_date`, `end_date`, `page`, `page_size` -- 来源文档:`AH股对比.md` -- 原始接口:`get_stk_ah_comparison` - -```text -AH股对比. - -Endpoint: ``api/v1/market/data/hk/stk-ah-comparison``. -Method: ``GET``. -Documented endpoint: ``get_stk_ah_comparison``. - -Args: - hk_code: 港股股票代码,支持 `700` 或 `00700.HK` (type: string; required: N). - ts_code: A 股股票代码,格式 `xxxxxx.SH/SZ/BJ` (type: string; required: N). - trade_date: 交易日期 YYYYMMDD (type: int32; required: N). - start_date: 起始日期 YYYYMMDD (type: int32; required: N). - end_date: 结束日期 YYYYMMDD (type: int32; required: N). - page: Page number, starting from 1. If omitted, the server default is used unless ``limit`` or ``all_pages`` is set. - page_size: Rows per page. The SDK validates this against the endpoint-specific maximum. - limit: Maximum number of rows to return. The SDK may fetch multiple pages to satisfy this limit. - all_pages: Fetch and combine pages until the server reports the last page. - max_pages: Optional safety cap for ``all_pages``. - raw: Return the decoded JSON payload without tabular extraction. - fields: Optional field list or comma-separated field string applied after extraction. - as_dataframe: Return a pandas ``DataFrame`` by default; set to ``False`` for Python rows. - **kwargs: Extra request parameters forwarded unchanged. Useful when the service adds parameters before the SDK is regenerated. - -Returns: - A pandas ``DataFrame`` by default, Python rows when - ``as_dataframe=False``, raw JSON when ``raw=True``, or raw page - payloads when multi-page fetching is used with ``raw=True``. -``` - -

stk_code_change

+

stk_alert_broker

-- 接口名称:A股代码变更 +- 接口名称:交易所重点提示证券 - HTTP:`GET` -- Path:`api/v1/market/data/stk-code-change` -- 参数:`trade_code`, `start_date`, `end_date` -- 来源文档:`A股代码变更.md` -- 原始接口:`get_stk_code_change` +- Path:`api/v2/market/data/stk-alert-broker` +- 参数:`ts_code`, `start_date`, `end_date`, `page`, `page_size` +- 来源文档:`交易所重点提示证券.md` +- 原始接口:`stk_alert_broker` ```text -A股代码变更. - -Endpoint: ``api/v1/market/data/stk-code-change``. -Method: ``GET``. -Documented endpoint: ``get_stk_code_change``. - -Args: - trade_code: 股票代码(带 .SZ/.SH 后缀),支持逗号分隔多个 (type: string; required: Y). - start_date: 过滤区间起始日期,``YYYYMMDD`` 格式 (type: string; required: N). - end_date: 过滤区间结束日期,``YYYYMMDD`` 格式;与 ``start_date`` 同时提供时须 ``start_date`` ≤ ``end_date`` (type: string; required: N). - raw: Return the decoded JSON payload without tabular extraction. - fields: Optional field list or comma-separated field string applied after extraction. - as_dataframe: Return a pandas ``DataFrame`` by default; set to ``False`` for Python rows. - **kwargs: Extra request parameters forwarded unchanged. Useful when the service adds parameters before the SDK is regenerated. - -Returns: - A pandas ``DataFrame`` by default, Python rows when - ``as_dataframe=False``, raw JSON when ``raw=True``, or raw page - payloads when multi-page fetching is used with ``raw=True``. +交易所重点提示证券. ```

stk_limit

@@ -2141,7 +1708,7 @@ Returns: - 接口名称:盘前数据 - HTTP:`GET` -- Path:`api/v1/market/data/stk-premarket` +- Path:`api/v2/market/data/stk-premarket` - 参数:`ts_code`, `trade_date`, `start_date`, `end_date`, `page`, `page_size` - 来源文档:`盘前数据.md` - 原始接口:`stk_premarket` @@ -2174,35 +1741,30 @@ Returns: payloads when multi-page fetching is used with ``raw=True``. ``` -

stk_status_change

+

stk_shock

-- 接口名称:A股状态变更 +- 接口名称:个股异常波动 - HTTP:`GET` -- Path:`api/v1/market/data/stk-status-change` -- 参数:`trade_code`, `change_date`, `change_type` -- 来源文档:`A股状态变更.md` -- 原始接口:`get_stk_status_change` +- Path:`api/v2/market/data/stk-shock` +- 参数:`ts_code`, `trade_date`, `start_date`, `end_date`, `page`, `page_size` +- 来源文档:`个股异常波动.md` +- 原始接口:`stk_shock` ```text -A股状态变更. +个股异常波动. +``` -Endpoint: ``api/v1/market/data/stk-status-change``. -Method: ``GET``. -Documented endpoint: ``get_stk_status_change``. +

stk_surv

-Args: - trade_code: 股票代码(带 .SZ/.SH 后缀),支持逗号分隔多个;不填表示不按代码过滤 (type: string; required: N). - change_date: 变更日期,精确过滤,``YYYYMMDD`` 格式 (type: string; required: N). - change_type: 变更类型,精确过滤,常见值如 ``上市``、``退市``、``暂停上市`` (type: string; required: N). - raw: Return the decoded JSON payload without tabular extraction. - fields: Optional field list or comma-separated field string applied after extraction. - as_dataframe: Return a pandas ``DataFrame`` by default; set to ``False`` for Python rows. - **kwargs: Extra request parameters forwarded unchanged. Useful when the service adds parameters before the SDK is regenerated. +- 接口名称:个股严重异常波动 +- HTTP:`GET` +- Path:`api/v2/market/data/stk-surv` +- 参数:`ts_code`, `trade_date`, `start_date`, `end_date`, `page`, `page_size` +- 来源文档:`个股严重异常波动.md` +- 原始接口:`stk_surv` -Returns: - A pandas ``DataFrame`` by default, Python rows when - ``as_dataframe=False``, raw JSON when ``raw=True``, or raw page - payloads when multi-page fetching is used with ``raw=True``. +```text +个股严重异常波动. ```

stock_adjust_factor

@@ -2210,7 +1772,7 @@ Returns: - 接口名称:股票复权因子 - HTTP:`GET` - Path:`api/v1/market/data/stock-adjust-factor` -- 参数:`symbol`, `trade_date`, `start_date`, `end_date`, `offset`, `limit` +- 参数:`symbol`, `trade_date`, `start_date`, `end_date`, `page`, `page_size` - 来源文档:`股票复权因子.md` - 原始接口:`stock_adjust_factor` @@ -2226,8 +1788,8 @@ Args: trade_date: 交易日期 YYYYMMDD;空则默认当天,非交易日回退前一交易日 (type: string; required: N). start_date: 区间起始日期 YYYYMMDD;区间扫描必填且需配 symbol (type: string; required: N). end_date: 区间结束日期 YYYYMMDD;区间扫描必填且需配 symbol (type: string; required: N). - offset: 返回结果起始偏移 (type: int; required: N). - limit: 返回结果最大条数 (type: int; required: N). + page: 页码,从 1 开始。 + page_size: 每页条数,最大 2000。 raw: Return the decoded JSON payload without tabular extraction. fields: Optional field list or comma-separated field string applied after extraction. as_dataframe: Return a pandas ``DataFrame`` by default; set to ``False`` for Python rows. @@ -2242,7 +1804,7 @@ Returns:

stock_candlesticks

- 接口名称:股票K线 -- HTTP:`POST` +- HTTP:`GET` - Path:`api/v1/market/data/stock-candlesticks` - 参数:`symbol`, `interval_unit`, `interval_value`, `adjust_kind`, `since_ts_millis`, `until_ts_millis`, `limit` - 来源文档:`股票K线.md` @@ -2252,7 +1814,7 @@ Returns: 股票K线. Endpoint: ``api/v1/market/data/stock-candlesticks``. -Method: ``POST``. +Method: ``GET``. Documented endpoint: ``stock_candlesticks``. Args: @@ -2274,47 +1836,12 @@ Returns: payloads when multi-page fetching is used with ``raw=True``. ``` -

stock_candlesticks_batch

- -- 接口名称:批量股票K线 -- HTTP:`POST` -- Path:`api/v1/market/data/stock-candlesticks/batch` -- 参数:`symbols`, `interval_unit`, `interval_value`, `adjust_kind`, `since_ts_millis`, `until_ts_millis`, `limit` -- 来源文档:`批量股票K线.md` -- 原始接口:`stock_candlesticks_batch` - -```text -批量股票K线. - -Endpoint: ``api/v1/market/data/stock-candlesticks/batch``. -Method: ``POST``. -Documented endpoint: ``stock_candlesticks_batch``. - -Args: - symbols: 标的代码列表,允许股票、ETF、可转债和指数混合,例如 ["600519.SH","510300.SH","113027.SH","000300.SH"] (type: string[]; required: Y). - interval_unit: 周期单位:Minute/Day/Week/Month/Year (type: enum; required: Y). - interval_value: 间隔数值,默认 1;例如 Minute+5 表示 5 分钟 K 线 (type: int; required: N). - adjust_kind: 复权类型:None(默认)/Forward(前复权)/Backward(后复权) (type: enum; required: N). - since_ts_millis: 开始时间戳;分钟 K 线与 until 的跨度不超过 3 天 (type: int(ms); required: N). - until_ts_millis: 结束时间戳,单位毫秒 (type: int(ms); required: Y). - limit: 每个标的的返回条数上限;未传 since 和 limit 时默认 50 (type: int; required: N). - raw: Return the decoded JSON payload without tabular extraction. - fields: Optional field list or comma-separated field string applied after extraction. - as_dataframe: Return a pandas ``DataFrame`` by default; set to ``False`` for Python rows. - **kwargs: Extra request parameters forwarded unchanged. Useful when the service adds parameters before the SDK is regenerated. - -Returns: - A pandas ``DataFrame`` by default, Python rows when - ``as_dataframe=False``, raw JSON when ``raw=True``, or raw page - payloads when multi-page fetching is used with ``raw=True``. -``` - -

stock_capital_flows_paginated

+

stock_capital_flows

- 接口名称:股票资金流向 - HTTP:`GET` - Path:`api/v1/market/data/stock-capital-flows` -- 参数:`date`, `page`, `page_size` +- 参数:`date`, `time`, `symbol`, `page`, `page_size` - 来源文档:`股票资金流向.md` - 原始接口:`stock_capital_flows_paginated` @@ -2327,6 +1854,8 @@ Documented endpoint: ``stock_capital_flows_paginated``. Args: date: 查询日期 YYYYMMDD;传入时查询该日 15:30 快照 (type: string; required: N). + time: 15 分钟切片,格式 HHMM;必须与 date 同时使用 (type: string; required: N). + symbol: 精确股票代码,例如 600000.SH、000001.SZ、830001.BJ (type: string; required: N). page: Page number, starting from 1. If omitted, the server default is used unless ``limit`` or ``all_pages`` is set. page_size: Rows per page. The SDK validates this against the endpoint-specific maximum. limit: Maximum number of rows to return. The SDK may fetch multiple pages to satisfy this limit. @@ -2377,7 +1906,7 @@ Returns: - 接口名称:千股千评 - HTTP:`GET` - Path:`api/v1/market/data/stock-comment/index` -- 参数:`index_code`, `page`, `page_size` +- 参数:`page`, `page_size` - 来源文档:`千股千评.md` - 原始接口:`stock_comment_em` @@ -2389,7 +1918,6 @@ Method: ``GET``. Documented endpoint: ``stock_comment_em``. Args: - index_code: 指数代码,如 `000300` (type: string; required: Y). page: Page number, starting from 1. If omitted, the server default is used unless ``limit`` or ``all_pages`` is set. page_size: Rows per page. The SDK validates this against the endpoint-specific maximum. limit: Maximum number of rows to return. The SDK may fetch multiple pages to satisfy this limit. @@ -2493,65 +2021,44 @@ Returns: payloads when multi-page fetching is used with ``raw=True``. ``` -

stock_filter

+

stock_connect_members

-- 接口名称:股票筛选 +- 接口名称:互联互通成份 - HTTP:`GET` -- Path:`api/v1/market/data/stock-list/filter` -- 参数:`board`, `listing_date_since`, `page`, `page_size` -- 来源文档:`股票筛选.md` -- 原始接口:`get_stock_filter` +- Path:`api/v1/market/data/stock-connect-members` +- 参数:`direction`, `channel`, `page`, `page_size` +- 来源文档:`互联互通成份.md` +- 原始接口:`stock_connect_members` ```text -股票筛选. +互联互通成份. +``` -Endpoint: ``api/v1/market/data/stock-list/filter``. -Method: ``GET``. -Documented endpoint: ``get_stock_filter``. +

stock_daec_stocks

-Args: - board: 板块/交易所筛选:`star` / `chi_next` / `bjse` / `xshg` / `xshe` / `main` (type: string; required: N). - listing_date_since: 上市日期起点 YYYYMMDD,筛选此后上市的股票 (type: string; required: N). - page: Page number, starting from 1. If omitted, the server default is used unless ``limit`` or ``all_pages`` is set. - page_size: Rows per page. The SDK validates this against the endpoint-specific maximum. - limit: Maximum number of rows to return. The SDK may fetch multiple pages to satisfy this limit. - all_pages: Fetch and combine pages until the server reports the last page. - max_pages: Optional safety cap for ``all_pages``. - raw: Return the decoded JSON payload without tabular extraction. - fields: Optional field list or comma-separated field string applied after extraction. - as_dataframe: Return a pandas ``DataFrame`` by default; set to ``False`` for Python rows. - **kwargs: Extra request parameters forwarded unchanged. Useful when the service adds parameters before the SDK is regenerated. - -Returns: - A pandas ``DataFrame`` by default, Python rows when - ``as_dataframe=False``, raw JSON when ``raw=True``, or raw page - payloads when multi-page fetching is used with ``raw=True``. -``` - -

stock_float_holders

- -- 接口名称:十大流通股东 +- 接口名称:A股行情列表 - HTTP:`GET` -- Path:`api/v1/market/data/holder/stock-holder-ften` -- 参数:`stock_code`, `is_last`, `page`, `page_size` -- 来源文档:`十大流通股东.md` -- 原始接口:`get_stock_holder_float_top10` +- Path:`api/v1/market/data/daec/stocks/{board}` +- 参数:`board`, `page`, `page_size`, `filter`, `order_by` +- 来源文档:`A股行情列表.md` +- 原始接口:`stock_daec_stocks` ```text -十大流通股东. +A股行情列表(DAEC 全字段族). -Endpoint: ``api/v1/market/data/holder/stock-holder-ften``. +Endpoint: ``api/v1/market/data/daec/stocks/{board}``. Method: ``GET``. -Documented endpoint: ``get_stock_holder_float_top10``. +Documented endpoint: ``stock_daec_stocks``. Args: - stock_code: 标的代码,指定时返回该标的全部历史数据 (type: string; required: N). - is_last: 是否取所有标的最新一期,true 时按 page/page_size 分页 (type: bool; required: N). + board: 板块路径参数,如 all / xshg / xshe / bjse (type: string; required: Y). page: Page number, starting from 1. If omitted, the server default is used unless ``limit`` or ``all_pages`` is set. page_size: Rows per page. The SDK validates this against the endpoint-specific maximum. limit: Maximum number of rows to return. The SDK may fetch multiple pages to satisfy this limit. all_pages: Fetch and combine pages until the server reports the last page. max_pages: Optional safety cap for ``all_pages``. + filter: 筛选表达式,如 ``close > 10`` 或 ``name.contains("银行")`` (type: string; required: N). + order_by: 排序表达式,如 ``change_rate desc`` (type: string; required: N). raw: Return the decoded JSON payload without tabular extraction. fields: Optional field list or comma-separated field string applied after extraction. as_dataframe: Return a pandas ``DataFrame`` by default; set to ``False`` for Python rows. @@ -2563,24 +2070,52 @@ Returns: payloads when multi-page fetching is used with ``raw=True``. ``` -

stock_ggcg_em

+

stock_description_all

-- 接口名称:东方财富股东增减持 +- 接口名称:股票基础信息 - HTTP:`GET` -- Path:`api/v1/market/data/holder/stock-ggcg-em` -- 参数:`symbol`, `page`, `page_size` -- 来源文档:`东方财富股东增减持.md` -- 原始接口:`stock_ggcg_em_handler` +- Path:`api/v1/market/data/stock-description-all` +- 参数:- +- 来源文档:`股票基础信息.md` +- 原始接口:`stock_description_all` + +```text +股票基础信息. +``` + +

stock_dividends

+ +- 接口名称:股票分红记录 +- HTTP:`GET` +- Path:`api/v1/market/data/stock-dividends` +- 参数:`symbol`, `since_date`, `until_date`, `page`, `page_size` +- 来源文档:`股票分红记录.md` +- 原始接口:`stock_dividends` + +```text +股票分红记录. +``` + +

stock_filter

+ +- 接口名称:股票筛选 +- HTTP:`GET` +- Path:`api/v2/market/data/stock-list/filter` +- 参数:`symbol`, `board`, `listing_date_since`, `page`, `page_size` +- 来源文档:`股票筛选.md` +- 原始接口:`get_stock_filter` ```text -东方财富股东增减持. +股票筛选. -Endpoint: ``api/v1/market/data/holder/stock-ggcg-em``. +Endpoint: ``api/v1/market/data/stock-list/filter``. Method: ``GET``. -Documented endpoint: ``stock_ggcg_em_handler``. +Documented endpoint: ``get_stock_filter``. Args: - symbol: 数据类型:全部 / 股东增持 / 股东减持,默认全部 (type: string; required: N). + symbol: 单标的代码(如 `600519`、`600519.SH`、`600519.XSHG`);传入后忽略 board 与 listing_date_since (type: string; required: N). + board: 板块/交易所筛选:`star` / `chi_next` / `bjse` / `xshg` / `xshe` / `main` (type: string; required: N). + listing_date_since: 上市日期起点 YYYYMMDD,筛选此后上市的股票 (type: string; required: N). page: Page number, starting from 1. If omitted, the server default is used unless ``limit`` or ``all_pages`` is set. page_size: Rows per page. The SDK validates this against the endpoint-specific maximum. limit: Maximum number of rows to return. The SDK may fetch multiple pages to satisfy this limit. @@ -2597,27 +2132,25 @@ Returns: payloads when multi-page fetching is used with ``raw=True``. ``` -

stock_ggmx

+

stock_float_holders

-- 接口名称:董监高持股变动 +- 接口名称:十大流通股东 - HTTP:`GET` -- Path:`api/v1/market/data/holder/stock-ggmx` -- 参数:`stock_code`, `change_direction`, `start_date`, `end_date`, `page`, `page_size` -- 来源文档:`董监高持股变动.md` -- 原始接口:`stock_ggmx_handler` +- Path:`api/v1/market/data/holder/stock-holder-ften` +- 参数:`stock_code`, `is_last`, `page`, `page_size` +- 来源文档:`十大流通股东.md` +- 原始接口:`get_stock_holder_float_top10` ```text -董监高持股变动. +十大流通股东. -Endpoint: ``api/v1/market/data/holder/stock-ggmx``. +Endpoint: ``api/v1/market/data/holder/stock-holder-ften``. Method: ``GET``. -Documented endpoint: ``stock_ggmx_handler``. +Documented endpoint: ``get_stock_holder_float_top10``. Args: - stock_code: 股票代码(如 600001),别名 stockCode (type: string; required: N). - change_direction: 变动方向:增持 / 减持,别名 changeDirection (type: string; required: N). - start_date: 变动日期起始 YYYY-MM-DD,别名 startDate (type: string; required: N). - end_date: 变动日期截止 YYYY-MM-DD,别名 endDate (type: string; required: N). + stock_code: 标的代码,指定时返回该标的全部历史数据 (type: string; required: N). + is_last: 是否取所有标的最新一期,true 时按 page/page_size 分页 (type: bool; required: N). page: Page number, starting from 1. If omitted, the server default is used unless ``limit`` or ``all_pages`` is set. page_size: Rows per page. The SDK validates this against the endpoint-specific maximum. limit: Maximum number of rows to return. The SDK may fetch multiple pages to satisfy this limit. @@ -2638,7 +2171,7 @@ Returns: - 接口名称:董监高增持排名 - HTTP:`GET` -- Path:`api/v1/market/data/holder/stock-ggmx-buy-ranking` +- Path:`api/v3/market/data/holder/stock-ggmx-buy-ranking` - 参数:`time_range`, `page`, `page_size` - 来源文档:`董监高增持排名.md` - 原始接口:`stock_ggmx_buy_ranking_handler` @@ -2646,7 +2179,7 @@ Returns: ```text 董监高增持排名. -Endpoint: ``api/v1/market/data/holder/stock-ggmx-buy-ranking``. +Endpoint: ``api/v3/market/data/holder/stock-ggmx-buy-ranking``. Method: ``GET``. Documented endpoint: ``stock_ggmx_buy_ranking_handler``. @@ -2672,7 +2205,7 @@ Returns: - 接口名称:董监高减持排名 - HTTP:`GET` -- Path:`api/v1/market/data/holder/stock-ggmx-sell-ranking` +- Path:`api/v3/market/data/holder/stock-ggmx-sell-ranking` - 参数:`time_range`, `page`, `page_size` - 来源文档:`董监高减持排名.md` - 原始接口:`stock_ggmx_sell_ranking_handler` @@ -2680,7 +2213,7 @@ Returns: ```text 董监高减持排名. -Endpoint: ``api/v1/market/data/holder/stock-ggmx-sell-ranking``. +Endpoint: ``api/v3/market/data/holder/stock-ggmx-sell-ranking``. Method: ``GET``. Documented endpoint: ``stock_ggmx_sell_ranking_handler``. @@ -2702,6 +2235,19 @@ Returns: payloads when multi-page fetching is used with ``raw=True``. ``` +

stock_history_list

+ +- 接口名称:股票历史列表 +- HTTP:`GET` +- Path:`api/v1/market/data/stock-history-list` +- 参数:`trade_date`, `code`, `page`, `page_size` +- 来源文档:`股票历史列表.md` +- 原始接口:`stock_history_list` + +```text +股票历史列表. +``` +

stock_holders

- 接口名称:十大股东 @@ -2776,7 +2322,7 @@ Returns: - 接口名称:机构持股 - HTTP:`GET` -- Path:`api/v1/market/data/share/stock-institution-holdings` +- Path:`api/v3/market/data/share/stock-institution-holdings` - 参数:`year`, `report_type`, `inst_type`, `page`, `page_size` - 来源文档:`机构持股.md` - 原始接口:`get_stock_institution_holdings` @@ -2812,7 +2358,7 @@ Returns: - 接口名称:机构持股明细 - HTTP:`GET` -- Path:`api/v1/market/data/share/stock-institution-holdings-detail` +- Path:`api/v3/market/data/share/stock-institution-holdings-detail` - 参数:`stock_code`, `year`, `report_type`, `inst_type`, `page`, `page_size` - 来源文档:`机构持股明细.md` - 原始接口:`get_stock_institution_holdings_detail` @@ -2849,7 +2395,7 @@ Returns: - 接口名称:机构股本持股 - HTTP:`GET` -- Path:`api/v1/market/data/institution/institution-share-holdings` +- Path:`api/v3/market/data/institution/institution-share-holdings` - 参数:`institution_id`, `year`, `report_type`, `invest_type` - 来源文档:`机构股本持股.md` - 原始接口:`get_stock_institution_share_holdings` @@ -2879,11 +2425,11 @@ Returns:

stock_intraday_auction_volume

-- 接口名称:集合竞价成交量 +- 接口名称:连续竞价成交量 - HTTP:`GET` -- Path:`api/v1/market/data/intraday-auction-volume` +- Path:`api/v2/market/data/intraday-auction-volume` - 参数:`trade_date`, `page`, `page_size` -- 来源文档:`集合竞价成交量.md` +- 来源文档:`连续竞价成交量.md` - 原始接口:`stock_intraday_auction_volume` ```text @@ -2911,30 +2457,27 @@ Returns: payloads when multi-page fetching is used with ``raw=True``. ``` -

stock_intraday_auction_volume_symbol

+

stock_intraday_prices

-- 接口名称:单标的集合竞价成交量 +- 接口名称:标的分时数据 - HTTP:`GET` -- Path:`api/v1/market/data/intraday-auction-volume/symbol` -- 参数:`symbol`, `trade_date`, `page`, `page_size` -- 来源文档:`单标的集合竞价成交量.md` -- 原始接口:`stock_intraday_auction_volume_symbol` +- Path:`api/v4/market/data/daec/history/prices` +- 参数:`symbol`, `range`, `days`, `ts_ms` +- 来源文档:`标的分时数据.md` +- 原始接口:`daec_history_prices` ```text -单标的集合竞价成交量. +标的分时数据. -Endpoint: ``api/v1/market/data/intraday-auction-volume/symbol``. +Endpoint: ``api/v4/market/data/daec/history/prices``. Method: ``GET``. -Documented endpoint: ``stock_intraday_auction_volume_symbol``. +Documented endpoint: ``daec_history_prices``. Args: - symbol: 标的代码,格式 code.suffix(XSHG/SH、XSHE/SZ、BJSE/BJ) (type: string; required: Y). - trade_date: 交易日期 YYYYMMDD;不传返回当日实时数据 (type: string; required: N). - page: Page number, starting from 1. If omitted, the server default is used unless ``limit`` or ``all_pages`` is set. - page_size: Rows per page. The SDK validates this against the endpoint-specific maximum. - limit: Maximum number of rows to return. The SDK may fetch multiple pages to satisfy this limit. - all_pages: Fetch and combine pages until the server reports the last page. - max_pages: Optional safety cap for ``all_pages``. + symbol: 标的代码,如 600000.XSHG (type: string; required: Y). + range: 预置时间区间:Today / FiveDays (type: string; required: N). + days: 近 N 个交易日至今 (type: uint32; required: N). + ts_ms: 起始毫秒时间戳 (type: int64; required: N). raw: Return the decoded JSON payload without tabular extraction. fields: Optional field list or comma-separated field string applied after extraction. as_dataframe: Return a pandas ``DataFrame`` by default; set to ``False`` for Python rows. @@ -2942,8 +2485,7 @@ Args: Returns: A pandas ``DataFrame`` by default, Python rows when - ``as_dataframe=False``, raw JSON when ``raw=True``, or raw page - payloads when multi-page fetching is used with ``raw=True``. + ``as_dataframe=False``, or raw JSON when ``raw=True``. ```

stock_ipos

@@ -2984,7 +2526,7 @@ Returns: - 接口名称:股票列表 - HTTP:`GET` - Path:`api/v1/market/data/stock-list` -- 参数:- +- 参数:`page`, `page_size` - 来源文档:`股票列表.md` - 原始接口:`get_stock_list` @@ -2996,15 +2538,12 @@ Method: ``GET``. Documented endpoint: ``get_stock_list``. Args: + page: Page number, starting from 1. + page_size: Rows per page, up to the endpoint-specific maximum. raw: Return the decoded JSON payload without tabular extraction. fields: Optional field list or comma-separated field string applied after extraction. as_dataframe: Return a pandas ``DataFrame`` by default; set to ``False`` for Python rows. **kwargs: Extra request parameters forwarded unchanged. Useful when the service adds parameters before the SDK is regenerated. - -Returns: - A pandas ``DataFrame`` by default, Python rows when - ``as_dataframe=False``, raw JSON when ``raw=True``, or raw page - payloads when multi-page fetching is used with ``raw=True``. ```

stock_market

@@ -3038,101 +2577,41 @@ Returns:

stock_market_distribution_intraday

-- 接口名称:日内涨跌停分布历史 +- 接口名称:市场涨跌分布分时 - HTTP:`GET` -- Path:`api/v1/market/data/daec/market/distribution-history` -- 参数:`scope` -- 来源文档:`日内涨跌停分布历史.md` +- Path:`api/v2/market/data/market-distribution-intraday` +- 参数:- +- 来源文档:`市场涨跌分布分时.md` - 原始接口:`stock_market_distribution_intraday` ```text 市场涨跌分布分时. -Endpoint: ``api/v1/market/data/daec/market/distribution-history``. +Endpoint: ``api/v2/market/data/market-distribution-intraday``. Method: ``GET``. Documented endpoint: ``stock_market_distribution_intraday``. Args: - scope: 市场范围:ChinaStock(默认) / Xshg / Xshe / Bjse (type: string; required: N). - raw: Return the decoded JSON payload without tabular extraction. - fields: Optional field list or comma-separated field string applied after extraction. - as_dataframe: Return a pandas ``DataFrame`` by default; set to ``False`` for Python rows. - **kwargs: Extra request parameters forwarded unchanged. Useful when the service adds parameters before the SDK is regenerated. - -Returns: - A pandas ``DataFrame`` by default, Python rows when - ``as_dataframe=False``, raw JSON when ``raw=True``, or raw page - payloads when multi-page fetching is used with ``raw=True``. -``` - -

stock_daec_stocks

- -- 接口名称:A股行情列表 -- HTTP:`GET` -- Path:`api/v1/market/data/daec/stocks/{board}` -- 参数:`board`, `page`, `page_size`, `filter`, `order_by` -- 来源文档:`A股行情列表.md` -- 原始接口:`stock_daec_stocks` - -```text -A股行情列表(DAEC 全字段族). - -Endpoint: ``api/v1/market/data/daec/stocks/{board}``. -Method: ``GET``. -Documented endpoint: ``stock_daec_stocks``. - -Args: - board: 板块路径参数,如 all / xshg / xshe / bjse (type: string; required: Y). - page: Page number, starting from 1. If omitted, the server default is used unless ``limit`` or ``all_pages`` is set. - page_size: Rows per page. The SDK validates this against the endpoint-specific maximum. - limit: Maximum number of rows to return. The SDK may fetch multiple pages to satisfy this limit. - all_pages: Fetch and combine pages until the server reports the last page. - max_pages: Optional safety cap for ``all_pages``. - filter: 筛选表达式,如 ``close > 10`` 或 ``name.contains("银行")`` (type: string; required: N). - order_by: 排序表达式,如 ``change_rate desc`` (type: string; required: N). raw: Return the decoded JSON payload without tabular extraction. fields: Optional field list or comma-separated field string applied after extraction. as_dataframe: Return a pandas ``DataFrame`` by default; set to ``False`` for Python rows. - **kwargs: Extra request parameters forwarded unchanged. Useful when the service adds parameters before the SDK is regenerated. + **kwargs: Extra request parameters forwarded unchanged. Returns: - A pandas ``DataFrame`` by default, Python rows when - ``as_dataframe=False``, raw JSON when ``raw=True``, or raw page - payloads when multi-page fetching is used with ``raw=True``. + A pandas ``DataFrame`` by default, Python rows when ``as_dataframe=False``, or raw JSON when ``raw=True``. ``` -

stock_realtime_list

+

stock_minutes

-- 接口名称:A股行情列表 +- 接口名称:股票历史分钟行情 - HTTP:`GET` -- Path:`api/v1/market/data/stock-list/{board}` -- 参数:`board`, `page`, `page_size` -- 来源文档:`A股行情列表.md` -- 原始接口:`stock_realtime_list` +- Path:`api/v3/market/data/stock_minutes` +- 参数:`symbol`, `interval_value`, `adjust_kind`, `since_ts_millis`, `until_ts_millis`, `limit` +- 来源文档:`股票历史分钟行情.md` +- 原始接口:`stock_minutes` ```text -A股行情列表(stock-list 实时行情族). - -Endpoint: ``api/v1/market/data/stock-list/{board}``. -Method: ``GET``. -Documented endpoint: ``stock_realtime_list``. - -Args: - board: 板块路径参数,如 chi-next / star / new (type: string; required: Y). - page: Page number, starting from 1. If omitted, the server default is used unless ``limit`` or ``all_pages`` is set. - page_size: Rows per page. The SDK validates this against the endpoint-specific maximum. - limit: Maximum number of rows to return. The SDK may fetch multiple pages to satisfy this limit. - all_pages: Fetch and combine pages until the server reports the last page. - max_pages: Optional safety cap for ``all_pages``. - raw: Return the decoded JSON payload without tabular extraction. - fields: Optional field list or comma-separated field string applied after extraction. - as_dataframe: Return a pandas ``DataFrame`` by default; set to ``False`` for Python rows. - **kwargs: Extra request parameters forwarded unchanged. Useful when the service adds parameters before the SDK is regenerated. - -Returns: - A pandas ``DataFrame`` by default, Python rows when - ``as_dataframe=False``, raw JSON when ``raw=True``, or raw page - payloads when multi-page fetching is used with ``raw=True``. +股票历史分钟行情. ```

stock_pledge_detail

@@ -3170,39 +2649,6 @@ Returns: payloads when multi-page fetching is used with ``raw=True``. ``` -

stock_pledge_summary

- -- 接口名称:股权质押汇总 -- HTTP:`GET` -- Path:`api/v1/market/data/pledge/pledge-summary` -- 参数:`page`, `page_size` -- 来源文档:`股权质押汇总.md` -- 原始接口:`stock_pledge_summary` - -```text -股权质押汇总. - -Endpoint: ``api/v1/market/data/pledge/pledge-summary``. -Method: ``GET``. -Documented endpoint: ``stock_pledge_summary``. - -Args: - page: Page number, starting from 1. If omitted, the server default is used unless ``limit`` or ``all_pages`` is set. - page_size: Rows per page. The SDK validates this against the endpoint-specific maximum. - limit: Maximum number of rows to return. The SDK may fetch multiple pages to satisfy this limit. - all_pages: Fetch and combine pages until the server reports the last page. - max_pages: Optional safety cap for ``all_pages``. - raw: Return the decoded JSON payload without tabular extraction. - fields: Optional field list or comma-separated field string applied after extraction. - as_dataframe: Return a pandas ``DataFrame`` by default; set to ``False`` for Python rows. - **kwargs: Extra request parameters forwarded unchanged. Useful when the service adds parameters before the SDK is regenerated. - -Returns: - A pandas ``DataFrame`` by default, Python rows when - ``as_dataframe=False``, raw JSON when ``raw=True``, or raw page - payloads when multi-page fetching is used with ``raw=True``. -``` -

stock_prev_close

- 接口名称:标的昨收价 @@ -3234,70 +2680,42 @@ Returns: payloads when multi-page fetching is used with ``raw=True``. ``` -

stock_intraday_prices

+

stock_realtime_day_kline

-- 接口名称:标的分时数据 +- 接口名称:股票实时日K线 - HTTP:`GET` -- Path:`api/v1/market/data/daec/history/prices` -- 参数:`symbol`, `range`, `days`, `ts_ms`, `compat`, `since`, `since_ts_ms` -- 来源文档:`标得分时数据.md` -- 原始接口:`stock_intraday_prices` +- Path:`api/v4/market/data/stock-realtime-day-kline` +- 参数:`symbols` +- 来源文档:`股票实时日K线.md` +- 原始接口:`stock_realtime_day_kline` ```text -标的分时数据. - -Endpoint: ``api/v1/market/data/daec/history/prices``. -Method: ``GET``. -Documented endpoint: ``stock_intraday_prices``. - -Args: - symbol: 标的代码,如 600000.XSHG (type: string; required: Y). - range: 预置时间区间:Today / FiveDays (type: string; required: N). - days: 近 N 个交易日至今 (type: uint32; required: N). - ts_ms: 起始毫秒时间戳 (type: int64; required: N). - compat: 兼容模式。传 v2 时启用旧 v2 响应结构 (type: string; required: N). - since: v2 兼容模式参数。可选 TODAY / FIVE_DAYS_AGO / TRADE_DAYS_AGO(n) (type: string; required: N). - since_ts_ms: v2 兼容模式参数。按起始毫秒时间戳取数,优先级高于 since (type: int64; required: N). - raw: Return the decoded JSON payload without tabular extraction. - fields: Optional field list or comma-separated field string applied after extraction. - as_dataframe: Return a pandas ``DataFrame`` by default; set to ``False`` for Python rows. - **kwargs: Extra request parameters forwarded unchanged. Useful when the service adds parameters before the SDK is regenerated. - -Returns: - A pandas ``DataFrame`` by default, Python rows when - ``as_dataframe=False``, raw JSON when ``raw=True``, or raw page - payloads when multi-page fetching is used with ``raw=True``. - -Raises: - ValueError: If original-mode and ``compat='v2'`` time controls are mixed. +股票实时日K线. ``` -

stock_ohlcs

+

stock_realtime_list

-- 接口名称:标的K线数据 +- 接口名称:A股行情列表 - HTTP:`GET` -- Path:`api/v1/market/data/daec/history/ohlcs` -- 参数:`symbol`, `since`, `until`, `interval`, `adjust`, `compat`, `span`, `limit`, `until_ts_ms` -- 来源文档:`标的K线数据.md` -- 原始接口:`stock_ohlcs` +- Path:`api/v1/market/data/stock-list/{board}` +- 参数:`board`, `page`, `page_size` +- 来源文档:`A股行情列表.md` +- 原始接口:`stock_realtime_list` ```text -标的K线数据. +A股行情列表(stock-list 实时行情族). -Endpoint: ``api/v1/market/data/daec/history/ohlcs``. +Endpoint: ``api/v1/market/data/stock-list/{board}``. Method: ``GET``. -Documented endpoint: ``stock_ohlcs``. +Documented endpoint: ``stock_realtime_list``. Args: - symbol: 标的代码,如 600000.XSHG (type: string; required: Y). - since: 起始日期,格式 YYYYMMDD;v2 兼容模式不传时会根据 limit 估算回溯窗口 (type: string; required: 原始模式 Y / v2 兼容模式 N). - until: 结束日期,格式 YYYYMMDD;v2 兼容模式不传时默认当天 (type: string; required: 原始模式 Y / v2 兼容模式 N). - interval: 原始模式参数。周期:Minute / Day / Week / Month,默认 Day (type: string; required: N). - adjust: 复权方式:None / Forward / Backward;v2 兼容模式默认 Forward (type: string; required: N). - compat: 兼容模式。传 v2 时启用旧 v2 响应结构 (type: string; required: N). - span: v2 兼容模式参数。周期:DAY1 / WEEK1 / MONTH1;不支持 YEAR1 (type: string; required: N). - limit: v2 兼容模式参数。返回最近 N 根 K 线 (type: int; required: N). - until_ts_ms: v2 兼容模式参数。旧 v2 风格结束毫秒时间戳,会按北京时间转换为 until 日期 (type: int64; required: N). + board: 板块路径参数,如 chi-next / star / new (type: string; required: Y). + page: Page number, starting from 1. If omitted, the server default is used unless ``limit`` or ``all_pages`` is set. + page_size: Rows per page. The SDK validates this against the endpoint-specific maximum. + limit: Maximum number of rows to return. The SDK may fetch multiple pages to satisfy this limit. + all_pages: Fetch and combine pages until the server reports the last page. + max_pages: Optional safety cap for ``all_pages``. raw: Return the decoded JSON payload without tabular extraction. fields: Optional field list or comma-separated field string applied after extraction. as_dataframe: Return a pandas ``DataFrame`` by default; set to ``False`` for Python rows. @@ -3307,47 +2725,26 @@ Returns: A pandas ``DataFrame`` by default, Python rows when ``as_dataframe=False``, raw JSON when ``raw=True``, or raw page payloads when multi-page fetching is used with ``raw=True``. - -Raises: - ValueError: If original-mode and ``compat='v2'`` controls are mixed. ``` -

stock_rating_top5

+

stock_realtime_minute_kline

-- 接口名称:飞兔股票评级Top5 +- 接口名称:股票实时分钟K线 - HTTP:`GET` -- Path:`api/v1/market/data/feitu/stock-rating-top5` -- 参数:`date`, `variant`, `type` -- 来源文档:`飞兔股票评级Top5.md` -- 原始接口:`stock_rating_top5` +- Path:`api/v4/market/data/stock-realtime-minute-kline` +- 参数:`symbols` +- 来源文档:`股票实时分钟K线.md` +- 原始接口:`stock_realtime_minute_kline` ```text -飞兔股票评级Top5. - -Endpoint: ``api/v1/market/data/feitu/stock-rating-top5``. -Method: ``GET``. -Documented endpoint: ``stock_rating_top5``. - -Args: - date: 日期 YYYYMMDD (type: string; required: Y). - variant: 档位,如 300001(30w01)、300000(30w),默认 300001 (type: string; required: N). - type: 市场:all / xshg / xshe / bjse,默认 all (type: StockRatingMarketFilter; required: N). - raw: Return the decoded JSON payload without tabular extraction. - fields: Optional field list or comma-separated field string applied after extraction. - as_dataframe: Return a pandas ``DataFrame`` by default; set to ``False`` for Python rows. - **kwargs: Extra request parameters forwarded unchanged. Useful when the service adds parameters before the SDK is regenerated. - -Returns: - A pandas ``DataFrame`` by default, Python rows when - ``as_dataframe=False``, raw JSON when ``raw=True``, or raw page - payloads when multi-page fetching is used with ``raw=True``. +股票实时分钟K线. ```

stock_share

- 接口名称:股本 - HTTP:`GET` -- Path:`api/v1/market/data/share/get-stock-share` +- Path:`api/v2/market/data/share/get-stock-share` - 参数:`stock_code`, `date` - 来源文档:`股本.md` - 原始接口:`get_stock_share` @@ -3408,24 +2805,26 @@ Returns: payloads when multi-page fetching is used with ``raw=True``. ``` -

stock_signal_latest_snapshot

+

stock_unlock

-- 接口名称:信号最新快照 +- 接口名称:限售解禁 - HTTP:`GET` -- Path:`api/v1/market/data/stock-signal-latest-snapshot` -- 参数:`signal_type`, `page`, `page_size` -- 来源文档:`信号最新快照.md` -- 原始接口:`stock_signal_latest_snapshot` - +- Path:`api/v1/market/data/unlock/stock_unlock` +- 参数:`stock_code`, `start_date`, `end_date`, `page`, `page_size` +- 来源文档:`限售解禁.md` +- 原始接口:`stock_unlock_handler` + ```text -信号最新快照. +限售解禁. -Endpoint: ``api/v1/market/data/stock-signal-latest-snapshot``. +Endpoint: ``api/v1/market/data/unlock/stock-unlock``. Method: ``GET``. -Documented endpoint: ``stock_signal_latest_snapshot``. +Documented endpoint: ``stock_unlock_handler``. Args: - signal_type: 信号类型过滤,不传返回全部。可选值:`new_high_month`、`new_high_60d`、`new_high_120d`、`new_high_250d`、`new_low_month`、`new_low_60d`、`new_low_120d`、`new_low_250d`、`consecutive_up`、`consecutive_down`、`consecutive_vol_up`、`consecutive_vol_down`、`break_up_ma5`、`break_up_ma10`、`break_up_ma20`、`break_down_ma5`、`break_down_ma10`、`break_down_ma20`、`vol_price_rise`、`vol_price_fall` (type: string; required: N). + stock_code: 证券代码 (type: string; required: Y). + start_date: 解禁日期起始值 (type: string; required: N). + end_date: 解禁日期结束值 (type: string; required: N). page: Page number, starting from 1. If omitted, the server default is used unless ``limit`` or ``all_pages`` is set. page_size: Rows per page. The SDK validates this against the endpoint-specific maximum. limit: Maximum number of rows to return. The SDK may fetch multiple pages to satisfy this limit. @@ -3442,73 +2841,69 @@ Returns: payloads when multi-page fetching is used with ``raw=True``. ``` -

stock_unlock

+

supply_chain_company_supply_chain_companies

-- 接口名称:限售解禁 +- 接口名称:供应链公司候选 - HTTP:`GET` -- Path:`api/v1/market/data/unlock/stock-unlock` -- 参数:`stock_code`, `page`, `page_size` -- 来源文档:`限售解禁.md` -- 原始接口:`stock_unlock_handler` +- Path:`api/v3/market/data/supply-chain/company-supply-chain-companies` +- 参数:`trade_code`, `direction`, `page`, `page_size` +- 来源文档:`供应链公司候选.md` +- 原始接口:`supply_chain_company_supply_chain_companies` ```text -限售解禁. +供应链公司候选. +``` -Endpoint: ``api/v1/market/data/unlock/stock-unlock``. -Method: ``GET``. -Documented endpoint: ``stock_unlock_handler``. +

supply_chain_subindustry_subsubindustries

-Args: - stock_code: 证券代码 (type: string; required: Y). - page: Page number, starting from 1. If omitted, the server default is used unless ``limit`` or ``all_pages`` is set. - page_size: Rows per page. The SDK validates this against the endpoint-specific maximum. - limit: Maximum number of rows to return. The SDK may fetch multiple pages to satisfy this limit. - all_pages: Fetch and combine pages until the server reports the last page. - max_pages: Optional safety cap for ``all_pages``. - raw: Return the decoded JSON payload without tabular extraction. - fields: Optional field list or comma-separated field string applied after extraction. - as_dataframe: Return a pandas ``DataFrame`` by default; set to ``False`` for Python rows. - **kwargs: Extra request parameters forwarded unchanged. Useful when the service adds parameters before the SDK is regenerated. +- 接口名称:供应链子行业层级展开 +- HTTP:`GET` +- Path:`api/v3/market/data/supply-chain/subindustry-subsubindustries` +- 参数:`industry_name` +- 来源文档:`供应链子行业层级展开.md` +- 原始接口:`supply_chain_subindustry_subsubindustries` -Returns: - A pandas ``DataFrame`` by default, Python rows when - ``as_dataframe=False``, raw JSON when ``raw=True``, or raw page - payloads when multi-page fetching is used with ``raw=True``. +```text +供应链子行业层级展开. ``` -

stock_unlock_by_date

+

supply_chain_subindustry_supply_chain

-- 接口名称:限售解禁按日期 +- 接口名称:供应链一跳关系 - HTTP:`GET` -- Path:`api/v1/market/data/unlock/stock-unlock-by-date` -- 参数:`start_date`, `end_date`, `page`, `page_size` -- 来源文档:`限售解禁按日期.md` -- 原始接口:`stock_unlock_by_date_handler` +- Path:`api/v3/market/data/supply-chain/subindustry-supply-chain` +- 参数:`industry_name`, `direction` +- 来源文档:`供应链一跳关系.md` +- 原始接口:`supply_chain_subindustry_supply_chain` ```text -限售解禁按日期. +供应链一跳关系. +``` -Endpoint: ``api/v1/market/data/unlock/stock-unlock-by-date``. -Method: ``GET``. -Documented endpoint: ``stock_unlock_by_date_handler``. +

supply_chain_subsubindustry_companies

-Args: - start_date: 起始日期(YYYY-MM-DD) (type: string; required: Y). - end_date: 结束日期(YYYY-MM-DD) (type: string; required: Y). - page: Page number, starting from 1. If omitted, the server default is used unless ``limit`` or ``all_pages`` is set. - page_size: Rows per page. The SDK validates this against the endpoint-specific maximum. - limit: Maximum number of rows to return. The SDK may fetch multiple pages to satisfy this limit. - all_pages: Fetch and combine pages until the server reports the last page. - max_pages: Optional safety cap for ``all_pages``. - raw: Return the decoded JSON payload without tabular extraction. - fields: Optional field list or comma-separated field string applied after extraction. - as_dataframe: Return a pandas ``DataFrame`` by default; set to ``False`` for Python rows. - **kwargs: Extra request parameters forwarded unchanged. Useful when the service adds parameters before the SDK is regenerated. +- 接口名称:供应链子子行业公司映射 +- HTTP:`GET` +- Path:`api/v3/market/data/supply-chain/subsubindustry-companies` +- 参数:`subindustry_name` +- 来源文档:`供应链子子行业公司映射.md` +- 原始接口:`supply_chain_subsubindustry_companies` -Returns: - A pandas ``DataFrame`` by default, Python rows when - ``as_dataframe=False``, raw JSON when ``raw=True``, or raw page - payloads when multi-page fetching is used with ``raw=True``. +```text +供应链子子行业公司映射. +``` + +

supply_chain_subsubindustry_parent_subindustries

+ +- 接口名称:供应链子子行业父行业反查 +- HTTP:`GET` +- Path:`api/v3/market/data/supply-chain/subsubindustry-parent-subindustries` +- 参数:`subindustry_name` +- 来源文档:`供应链子子行业父行业反查.md` +- 原始接口:`supply_chain_subsubindustry_parent_subindustries` + +```text +供应链子子行业父行业反查. ```

suspension_list

@@ -3545,74 +2940,50 @@ Returns: payloads when multi-page fetching is used with ``raw=True``. ``` -

sz_hk_stock_connect_members

+

tdx_board_daily

-- 接口名称:深股通成份 +- 接口名称:通达信板块日线 - HTTP:`GET` -- Path:`api/v1/market/data/sz-hk-stock-connect-members` -- 参数:- -- 来源文档:`深股通成份.md` -- 原始接口:`sz_hk_stock_connect_members` +- Path:`api/v1/market/data/tdx-board-daily` +- 参数:`start_date`, `end_date`, `ts_code`, `idx_name`, `idx_type`, `idx_type_code`, `market`, `page`, `page_size` +- 来源文档:`通达信板块日线.md` +- 原始接口:`tdx_board_daily` ```text -深股通成份. - -Endpoint: ``api/v1/market/data/sz-hk-stock-connect-members``. -Method: ``GET``. -Documented endpoint: ``sz_hk_stock_connect_members``. - -Args: - raw: Return the decoded JSON payload without tabular extraction. - fields: Optional field list or comma-separated field string applied after extraction. - as_dataframe: Return a pandas ``DataFrame`` by default; set to ``False`` for Python rows. - **kwargs: Extra request parameters forwarded unchanged. Useful when the service adds parameters before the SDK is regenerated. - -Returns: - A pandas ``DataFrame`` by default, Python rows when - ``as_dataframe=False``, raw JSON when ``raw=True``, or raw page - payloads when multi-page fetching is used with ``raw=True``. +通达信板块日线. ``` -

ths_all_board_kline

+

tdx_board_index

-- 接口名称:同花顺全板块K线 +- 接口名称:通达信板块指数最新快照 - HTTP:`GET` -- Path:`api/v1/market/data/ths-all-board-kline` -- 参数:`start_date`, `end_date`, `page`, `page_size` -- 来源文档:`同花顺全板块K线.md` -- 原始接口:`ths_all_board_kline` +- Path:`api/v1/market/data/tdx-board-index` +- 参数:`ts_code`, `idx_name`, `idx_type`, `idx_type_code`, `market`, `page`, `page_size` +- 来源文档:`通达信板块指数最新快照.md` +- 原始接口:`tdx_board_index` ```text -同花顺全板块K线. +通达信板块指数最新快照. +``` -Endpoint: ``api/v1/market/data/ths-all-board-kline``. -Method: ``GET``. -Documented endpoint: ``ths_all_board_kline``. +

tdx_board_members

-Args: - start_date: 起始日期(含),YYYY-MM-DD 或 YYYYMMDD (type: string; required: N). - end_date: 截止日期(含),YYYY-MM-DD 或 YYYYMMDD (type: string; required: N). - page: Page number, starting from 1. If omitted, the server default is used unless ``limit`` or ``all_pages`` is set. - page_size: Rows per page. The SDK validates this against the endpoint-specific maximum. - limit: Maximum number of rows to return. The SDK may fetch multiple pages to satisfy this limit. - all_pages: Fetch and combine pages until the server reports the last page. - max_pages: Optional safety cap for ``all_pages``. - raw: Return the decoded JSON payload without tabular extraction. - fields: Optional field list or comma-separated field string applied after extraction. - as_dataframe: Return a pandas ``DataFrame`` by default; set to ``False`` for Python rows. - **kwargs: Extra request parameters forwarded unchanged. Useful when the service adds parameters before the SDK is regenerated. +- 接口名称:通达信板块成分股最新快照 +- HTTP:`GET` +- Path:`api/v2/market/data/tdx-board-members` +- 参数:`ts_code`, `idx_name`, `idx_type`, `idx_type_code`, `market`, `con_code`, `con_name`, `page`, `page_size` +- 来源文档:`通达信板块成分股最新快照.md` +- 原始接口:`tdx_board_members` -Returns: - A pandas ``DataFrame`` by default, Python rows when - ``as_dataframe=False``, raw JSON when ``raw=True``, or raw page - payloads when multi-page fetching is used with ``raw=True``. +```text +通达信板块成分股最新快照. ```

ths_board_kline

- 接口名称:同花顺板块K线 - HTTP:`GET` -- Path:`api/v1/market/data/ths-board-kline` +- Path:`api/v2/market/data/ths-board-kline` - 参数:`board_code`, `page`, `page_size` - 来源文档:`同花顺板块K线.md` - 原始接口:`ths_board_kline` @@ -3642,23 +3013,39 @@ Returns: payloads when multi-page fetching is used with ``raw=True``. ``` -

ths_board_list

+

ths_hot_list

-- 接口名称:同花顺板块列表 +- 接口名称:同花顺热榜 - HTTP:`GET` -- Path:`api/v1/market/data/ths-board-list` -- 参数:- -- 来源文档:`同花顺板块列表.md` -- 原始接口:`ths_board_list` +- Path:`api/v2/market/data/ths-hot-list` +- 参数:`list_type`, `trade_date`, `page`, `page_size` +- 来源文档:`同花顺热榜.md` +- 原始接口:`ths_hot_list` + +```text +同花顺热榜. +``` + +

trading_calendar

+ +- 接口名称:交易日历 +- HTTP:`GET` +- Path:`api/v1/market/data/time/trading-calendar` +- 参数:`market`, `start_date`, `end_date` +- 来源文档:`交易日历.md` +- 原始接口:`trading_calendar` ```text -同花顺板块列表. +交易日历. -Endpoint: ``api/v1/market/data/ths-board-list``. +Endpoint: ``api/v1/market/data/time/trading-calendar``. Method: ``GET``. -Documented endpoint: ``ths_board_list``. +Documented endpoint: ``trading_calendar``. Args: + market: 市场标识 (type: string; required: N). + start_date: 起始日期 (type: string; required: N). + end_date: 截止日期 (type: string; required: N). raw: Return the decoded JSON payload without tabular extraction. fields: Optional field list or comma-separated field string applied after extraction. as_dataframe: Return a pandas ``DataFrame`` by default; set to ``False`` for Python rows. @@ -3674,7 +3061,7 @@ Returns: - 接口名称:雪球股票排名 - HTTP:`GET` -- Path:`api/v1/market/data/xueqiu-rank` +- Path:`api/v2/market/data/xueqiu-rank` - 参数:`rank_group`, `period`, `trade_date`, `page`, `page_size` - 来源文档:`雪球股票排名.md` - 原始接口:`xueqiu_rank` @@ -3708,15 +3095,15 @@ Returns:

yzxdr_detail

-- 接口名称:除权除息明细 +- 接口名称:一致行动人明细 - HTTP:`GET` - Path:`api/v1/market/data/yzxdr-detail` - 参数:`year`, `quarter`, `stock_code`, `page`, `page_size` -- 来源文档:`除权除息明细.md` +- 来源文档:`一致行动人明细.md` - 原始接口:`get_yzxdr_detail` ```text -除权除息明细. +一致行动人明细. Endpoint: ``api/v1/market/data/yzxdr-detail``. Method: ``GET``. @@ -3742,28 +3129,32 @@ Returns: payloads when multi-page fetching is used with ``raw=True``. ``` -

pledge_summary

+### 港股数据 -- 接口名称:股权质押汇总 +

hk_candlesticks

+ +- 接口名称:港股K线 - HTTP:`GET` -- Path:`api/v1/market/data/pledge/pledge-summary` -- 参数:`page`, `page_size` -- 来源文档:`股权质押汇总.md` -- 原始接口:`stock_pledge_summary` +- Path:`api/v3/market/data/hk/hk-candlesticks` +- 参数:`trade_code`, `interval_unit`, `until_date`, `since_date`, `interval_value`, `limit`, `adjust_kind` +- 来源文档:`港股K线.md` +- 原始接口:`get_hk_candlesticks` ```text -股权质押汇总. +港股K线. -Endpoint: ``api/v1/market/data/pledge/pledge-summary``. +Endpoint: ``api/v1/market/data/hk/hk-candlesticks``. Method: ``GET``. -Documented endpoint: ``stock_pledge_summary``. +Documented endpoint: ``get_hk_candlesticks``. Args: - page: Page number, starting from 1. If omitted, the server default is used unless ``limit`` or ``all_pages`` is set. - page_size: Rows per page. The SDK validates this against the endpoint-specific maximum. - limit: Maximum number of rows to return. The SDK may fetch multiple pages to satisfy this limit. - all_pages: Fetch and combine pages until the server reports the last page. - max_pages: Optional safety cap for ``all_pages``. + trade_code: 港股代码,如 `00700.HK` 或 `700` (type: string; required: Y). + interval_unit: 间隔单位:day / month / quarter / year (type: string; required: Y). + until_date: 结束日期(YYYY-MM-DD) (type: date; required: Y). + since_date: 开始日期(YYYY-MM-DD) (type: date; required: N). + interval_value: 间隔数值(当前仅支持 1) (type: int; required: N). + limit: 数量限制(保留最近 N 根) (type: int; required: N). + adjust_kind: 复权类型:forward(默认/前复权) / none(不复权) (type: string; required: N). raw: Return the decoded JSON payload without tabular extraction. fields: Optional field list or comma-separated field string applied after extraction. as_dataframe: Return a pandas ``DataFrame`` by default; set to ``False`` for Python rows. @@ -3775,24 +3166,41 @@ Returns: payloads when multi-page fetching is used with ``raw=True``. ``` -

stock_capital_flows

+

hk_stock_info_all

-- 接口名称:股票资金流向 +- 接口名称:港股实时行情 - HTTP:`GET` -- Path:`api/v1/market/data/stock-capital-flows` -- 参数:`date`, `page`, `page_size` -- 来源文档:`股票资金流向.md` -- 原始接口:`stock_capital_flows_paginated` +- Path:`api/v4/market/data/hk-stock-info-all` +- 参数:- +- 来源文档:`港股实时行情.md` +- 原始接口:`hk_stock_info_all` ```text -股票资金流向. +港股实时行情. +``` -Endpoint: ``api/v1/market/data/stock-capital-flows``. +### 美股数据 + +

eastmoney_us_stock_daily_ohlc

+ +- 接口名称:东方财富美股日OHLC +- HTTP:`GET` +- Path:`api/v1/market/data/eastmoney-us-stock-daily-ohlc` +- 参数:`stock_code`, `start_date`, `end_date`, `page`, `page_size` +- 来源文档:`东方财富美股日OHLC.md` +- 原始接口:`eastmoney_us_stock_daily_kline` + +```text +东方财富美股日OHLC. + +Endpoint: ``api/v1/market/data/eastmoney-us-stock-daily-ohlc``. Method: ``GET``. -Documented endpoint: ``stock_capital_flows_paginated``. +Documented endpoint: ``eastmoney_us_stock_daily_kline``. Args: - date: 查询日期 YYYYMMDD;传入时查询该日 15:30 快照 (type: string; required: N). + stock_code: 股票代码,如 AAPL (type: string; required: Y). + start_date: 起始日期(含),YYYY-MM-DD 或 YYYYMMDD;不传从最早开始 (type: string; required: N). + end_date: 截止日期(含),YYYY-MM-DD 或 YYYYMMDD;不传到最晚 (type: string; required: N). page: Page number, starting from 1. If omitted, the server default is used unless ``limit`` or ``all_pages`` is set. page_size: Rows per page. The SDK validates this against the endpoint-specific maximum. limit: Maximum number of rows to return. The SDK may fetch multiple pages to satisfy this limit. @@ -3809,26 +3217,29 @@ Returns: payloads when multi-page fetching is used with ``raw=True``. ``` -### 港股数据 +### 指数专题 -

company_hk

+

global_index_daily_kline

-- 接口名称:港股公司信息 +- 接口名称:全球指数日K线 - HTTP:`GET` -- Path:`api/v1/market/data/hk/company-hk` -- 参数:`trade_code` -- 来源文档:`港股公司信息.md` -- 原始接口:`get_company_hk` +- Path:`api/v2/market/data/global-index/daily-kline` +- 参数:`secid`, `start_date`, `end_date`, `limit` +- 来源文档:`全球指数日K线.md` +- 原始接口:`global_index_daily_kline` ```text -港股公司信息. +全球指数日K线. -Endpoint: ``api/v1/market/data/hk/company-hk``. +Endpoint: ``api/v1/market/data/global-index/daily-kline``. Method: ``GET``. -Documented endpoint: ``get_company_hk``. +Documented endpoint: ``global_index_daily_kline``. Args: - trade_code: 港股交易代码 (type: string; required: Y). + secid: 东方财富全球指数编码,如 100.NDX、100.DJIA、100.SPX、100.HSI、100.N225 (type: string; required: Y). + start_date: 开始日期 YYYY-MM-DD(含) (type: string; required: N). + end_date: 结束日期 YYYY-MM-DD(含) (type: string; required: N). + limit: 返回根数上限,最大 5000 (type: int; required: N). raw: Return the decoded JSON payload without tabular extraction. fields: Optional field list or comma-separated field string applied after extraction. as_dataframe: Return a pandas ``DataFrame`` by default; set to ``False`` for Python rows. @@ -3840,32 +3251,30 @@ Returns: payloads when multi-page fetching is used with ``raw=True``. ``` -

eastmoney_hk_index_daily_kline

+

index_candlesticks

-- 接口名称:东方财富港股指数日K +- 接口名称:指数K线 - HTTP:`GET` -- Path:`api/v1/market/data/eastmoney-hk-index-daily-kline` -- 参数:`index_code`, `trade_date`, `start_date`, `end_date`, `page`, `page_size` -- 来源文档:`东方财富港股指数日K.md` -- 原始接口:`get_eastmoney_hk_index_daily_kline` +- Path:`api/v1/market/data/index-candlesticks` +- 参数:`symbol`, `interval_unit`, `interval_value`, `adjust_kind`, `since_ts_millis`, `until_ts_millis`, `limit` +- 来源文档:`指数K线.md` +- 原始接口:`index_candlesticks` ```text -东方财富港股指数日K. +指数K线. -Endpoint: ``api/v1/market/data/eastmoney-hk-index-daily-kline``. +Endpoint: ``api/v1/market/data/index-candlesticks``. Method: ``GET``. -Documented endpoint: ``get_eastmoney_hk_index_daily_kline``. +Documented endpoint: ``index_candlesticks``. Args: - index_code: 指数代码,如 HSI / HSCEI / HSTECH;不传返回全部指数 (type: string; required: N). - trade_date: 交易日 YYYY-MM-DD;与 start_date/end_date 互斥 (type: string; required: N). - start_date: 区间起始日 YYYY-MM-DD;需与 end_date 同时提供 (type: string; required: N). - end_date: 区间结束日 YYYY-MM-DD;需与 start_date 同时提供 (type: string; required: N). - page: Page number, starting from 1. If omitted, the server default is used unless ``limit`` or ``all_pages`` is set. - page_size: Rows per page. The SDK validates this against the endpoint-specific maximum. - limit: Maximum number of rows to return. The SDK may fetch multiple pages to satisfy this limit. - all_pages: Fetch and combine pages until the server reports the last page. - max_pages: Optional safety cap for ``all_pages``. + symbol: 指数代码,如 000300.XSHG、399001.XSHE;也接受 .SH、.SZ 短后缀 (type: string; required: Y). + interval_unit: 周期单位:Minute/Day/Week/Month/Year (type: enum; required: Y). + interval_value: 间隔数值,默认 1;例如 Minute+5 表示 5 分钟 K 线 (type: int; required: N). + adjust_kind: 复权:None(默认,不复权)/Forward(前复权)/Backward(后复权) (type: enum; required: N). + since_ts_millis: 开始时间戳,单位毫秒;分钟 K 线与 until 的跨度 ≤3 天 (type: int(ms); required: N). + until_ts_millis: 结束时间戳,单位毫秒 (type: int(ms); required: Y). + limit: 返回条数上限;未传 since 和 limit 时默认最多返回 50 根 K 线 (type: int; required: N). raw: Return the decoded JSON payload without tabular extraction. fields: Optional field list or comma-separated field string applied after extraction. as_dataframe: Return a pandas ``DataFrame`` by default; set to ``False`` for Python rows. @@ -3877,33 +3286,23 @@ Returns: payloads when multi-page fetching is used with ``raw=True``. ``` -

hk_balance_bank

+

index_description_all

-- 接口名称:港股资产负债表 +- 接口名称:指数基础信息 - HTTP:`GET` -- Path:`api/v1/market/data/hk/hk-balance-bank` -- 参数:`trade_code`, `year`, `report_type`, `start_date`, `end_date`, `page`, `page_size` -- 来源文档:`港股资产负债表.md` -- 原始接口:`hk_balance_bank` +- Path:`api/v1/market/data/index-description-all` +- 参数:`page`, `page_size` +- 来源文档:`指数基础信息.md` +- 原始接口:`index_description_all` ```text -港股资产负债表. +指数基础信息. -Endpoint: ``api/v1/market/data/hk/hk-balance-bank``. +Endpoint: ``api/v1/market/data/index-description-all``. Method: ``GET``. -Documented endpoint: ``hk_balance_bank``. +Documented endpoint: ``index_description_all``. Args: - trade_code: 港股代码(支持 `700` / `00700.HK`) (type: string; required: N). - year: 报告期年份(如 2024),按 `end_date` 日历年过滤,需配 `report_type` (type: int32; required: N). - report_type: 报告类型:annual(年报)/ semi(半年报),需配 `year` (type: string; required: N). - start_date: 起始截止日期 YYYYMMDD,筛选 `end_date >= 此值` (type: int32; required: N). - end_date: 结束截止日期 YYYYMMDD,筛选 `end_date <= 此值` (type: int32; required: N). - page: Page number, starting from 1. If omitted, the server default is used unless ``limit`` or ``all_pages`` is set. - page_size: Rows per page. The SDK validates this against the endpoint-specific maximum. - limit: Maximum number of rows to return. The SDK may fetch multiple pages to satisfy this limit. - all_pages: Fetch and combine pages until the server reports the last page. - max_pages: Optional safety cap for ``all_pages``. raw: Return the decoded JSON payload without tabular extraction. fields: Optional field list or comma-separated field string applied after extraction. as_dataframe: Return a pandas ``DataFrame`` by default; set to ``False`` for Python rows. @@ -3915,28 +3314,23 @@ Returns: payloads when multi-page fetching is used with ``raw=True``. ``` -

hk_balance_gene

+

index_description_list

-- 接口名称:港股资产负债表 +- 接口名称:中证指数描述列表 - HTTP:`GET` -- Path:`api/v1/market/data/hk/hk-balance-gene` -- 参数:`trade_code`, `year`, `report_type`, `start_date`, `end_date`, `page`, `page_size` -- 来源文档:`港股资产负债表.md` -- 原始接口:`hk_balance_gene` +- Path:`api/v1/market/data/index/index_description` +- 参数:`page`, `page_size` +- 来源文档:`中证指数描述列表.md` +- 原始接口:`index_description_list_handler` ```text -港股资产负债表. +中证指数描述列表. -Endpoint: ``api/v1/market/data/hk/hk-balance-gene``. +Endpoint: ``api/v1/market/data/index/index_description``. Method: ``GET``. -Documented endpoint: ``hk_balance_gene``. +Documented endpoint: ``index_description_list_handler``. Args: - trade_code: 港股代码(支持 `700` / `00700.HK`) (type: string; required: N). - year: 报告期年份(如 2024),按 `end_date` 日历年过滤,需配 `report_type` (type: int32; required: N). - report_type: 报告类型:annual(年报)/ semi(半年报),需配 `year` (type: string; required: N). - start_date: 起始截止日期 YYYYMMDD,筛选 `end_date >= 此值` (type: int32; required: N). - end_date: 结束截止日期 YYYYMMDD,筛选 `end_date <= 此值` (type: int32; required: N). page: Page number, starting from 1. If omitted, the server default is used unless ``limit`` or ``all_pages`` is set. page_size: Rows per page. The SDK validates this against the endpoint-specific maximum. limit: Maximum number of rows to return. The SDK may fetch multiple pages to satisfy this limit. @@ -3953,91 +3347,69 @@ Returns: payloads when multi-page fetching is used with ``raw=True``. ``` -

hk_balance_insur

+

index_minutes

-- 接口名称:港股资产负债表 +- 接口名称:指数历史分钟行情 - HTTP:`GET` -- Path:`api/v1/market/data/hk/hk-balance-insur` -- 参数:`trade_code`, `year`, `report_type`, `start_date`, `end_date`, `page`, `page_size` -- 来源文档:`港股资产负债表.md` -- 原始接口:`hk_balance_insur` +- Path:`api/v3/market/data/index_minutes` +- 参数:`symbol`, `interval_value`, `since_ts_millis`, `until_ts_millis`, `limit` +- 来源文档:`指数历史分钟行情.md` +- 原始接口:`index_minutes` ```text -港股资产负债表. +指数历史分钟行情. +``` -Endpoint: ``api/v1/market/data/hk/hk-balance-insur``. -Method: ``GET``. -Documented endpoint: ``hk_balance_insur``. +

index_realtime_day_kline

-Args: - trade_code: 港股代码(支持 `700` / `00700.HK`) (type: string; required: N). - year: 报告期年份(如 2024),按 `end_date` 日历年过滤,需配 `report_type` (type: int32; required: N). - report_type: 报告类型:annual(年报)/ semi(半年报),需配 `year` (type: string; required: N). - start_date: 起始截止日期 YYYYMMDD,筛选 `end_date >= 此值` (type: int32; required: N). - end_date: 结束截止日期 YYYYMMDD,筛选 `end_date <= 此值` (type: int32; required: N). - page: Page number, starting from 1. If omitted, the server default is used unless ``limit`` or ``all_pages`` is set. - page_size: Rows per page. The SDK validates this against the endpoint-specific maximum. - limit: Maximum number of rows to return. The SDK may fetch multiple pages to satisfy this limit. - all_pages: Fetch and combine pages until the server reports the last page. - max_pages: Optional safety cap for ``all_pages``. - raw: Return the decoded JSON payload without tabular extraction. - fields: Optional field list or comma-separated field string applied after extraction. - as_dataframe: Return a pandas ``DataFrame`` by default; set to ``False`` for Python rows. - **kwargs: Extra request parameters forwarded unchanged. Useful when the service adds parameters before the SDK is regenerated. +- 接口名称:指数实时日K线 +- HTTP:`GET` +- Path:`api/v4/market/data/index-realtime-day-kline` +- 参数:`symbols` +- 来源文档:`指数实时日K线.md` +- 原始接口:`index_realtime_day_kline` -Returns: - A pandas ``DataFrame`` by default, Python rows when - ``as_dataframe=False``, raw JSON when ``raw=True``, or raw page - payloads when multi-page fetching is used with ``raw=True``. +```text +指数实时日K线. ``` -

hk_basinfo_get

+

index_realtime_minute_kline

-- 接口名称:港股个股信息 +- 接口名称:指数实时分钟K线 - HTTP:`GET` -- Path:`api/v1/market/data/hk/hk-view` -- 参数:`hk_code` -- 来源文档:`港股个股信息.md` -- 原始接口:`get_hk_basinfo_get` +- Path:`api/v4/market/data/index-realtime-minute-kline` +- 参数:`symbols` +- 来源文档:`指数实时分钟K线.md` +- 原始接口:`index_realtime_minute_kline` ```text -港股个股信息. +指数实时分钟K线. +``` -Endpoint: ``api/v1/market/data/hk/hk-view``. -Method: ``GET``. -Documented endpoint: ``get_hk_basinfo_get``. +

index_weight_list

-Args: - hk_code: 港股代码,如 `00700.HK` (type: string; required: Y). - raw: Return the decoded JSON payload without tabular extraction. - fields: Optional field list or comma-separated field string applied after extraction. - as_dataframe: Return a pandas ``DataFrame`` by default; set to ``False`` for Python rows. - **kwargs: Extra request parameters forwarded unchanged. Useful when the service adds parameters before the SDK is regenerated. - -Returns: - A pandas ``DataFrame`` by default, Python rows when - ``as_dataframe=False``, raw JSON when ``raw=True``, or raw page - payloads when multi-page fetching is used with ``raw=True``. -``` - -

hk_basinfo_post

- -- 接口名称:港股个股信息 +- 接口名称:指数权重列表 - HTTP:`GET` -- Path:`api/v1/market/data/hk/hk-view` -- 参数:`hk_code` -- 来源文档:`港股个股信息.md` -- 原始接口:`get_hk_basinfo_post` +- Path:`api/v1/market/data/index/index_weight` +- 参数:`index_code`, `date`, `page`, `page_size` +- 来源文档:`指数权重列表.md` +- 原始接口:`index_weight_list_handler` ```text -港股个股信息. +指数权重列表. -Endpoint: ``api/v1/market/data/hk/hk-view``. +Endpoint: ``api/v1/market/data/index/index_weight``. Method: ``GET``. -Documented endpoint: ``get_hk_basinfo_post``. +Documented endpoint: ``index_weight_list_handler``. Args: - hk_code: 港股代码,如 `00700.HK` (type: string; required: Y). + index_code: 指数代码,如 000300(沪深300),为空会被拒 (type: string; required: Y). + date: 权重采集日期 YYYYMMDD(如 20260529),不传取最新期 (type: string; required: N). + page: Page number, starting from 1. If omitted, the server default is used unless ``limit`` or ``all_pages`` is set. + page_size: Rows per page. The SDK validates this against the endpoint-specific maximum. + limit: Maximum number of rows to return. The SDK may fetch multiple pages to satisfy this limit. + all_pages: Fetch and combine pages until the server reports the last page. + max_pages: Optional safety cap for ``all_pages``. raw: Return the decoded JSON payload without tabular extraction. fields: Optional field list or comma-separated field string applied after extraction. as_dataframe: Return a pandas ``DataFrame`` by default; set to ``False`` for Python rows. @@ -4049,30 +3421,29 @@ Returns: payloads when multi-page fetching is used with ``raw=True``. ``` -

hk_candlesticks

+

index_weight_summary

-- 接口名称:港股K线 +- 接口名称:指数权重汇总 - HTTP:`GET` -- Path:`api/v1/market/data/hk/hk-candlesticks` -- 参数:`trade_code`, `interval_unit`, `until_date`, `since_date`, `interval_value`, `limit`, `adjust_kind` -- 来源文档:`港股K线.md` -- 原始接口:`get_hk_candlesticks` +- Path:`api/v1/market/data/index/index_weight_summary` +- 参数:`index_code`, `page`, `page_size` +- 来源文档:`指数权重汇总.md` +- 原始接口:`index_weight_summary_handler` ```text -港股K线. +指数权重汇总. -Endpoint: ``api/v1/market/data/hk/hk-candlesticks``. +Endpoint: ``api/v1/market/data/index/index_weight_summary``. Method: ``GET``. -Documented endpoint: ``get_hk_candlesticks``. +Documented endpoint: ``index_weight_summary_handler``. Args: - trade_code: 港股代码,如 `00700.HK` 或 `700` (type: string; required: Y). - interval_unit: 间隔单位:day / month / quarter / year (type: string; required: Y). - until_date: 结束日期(YYYY-MM-DD) (type: date; required: Y). - since_date: 开始日期(YYYY-MM-DD) (type: date; required: N). - interval_value: 间隔数值(当前仅支持 1) (type: int; required: N). - limit: 数量限制(保留最近 N 根) (type: int; required: N). - adjust_kind: 复权类型:forward(默认/前复权) / none(不复权) (type: string; required: N). + index_code: 指数代码,如 `000300` (type: string; required: Y). + page: Page number, starting from 1. If omitted, the server default is used unless ``limit`` or ``all_pages`` is set. + page_size: Rows per page. The SDK validates this against the endpoint-specific maximum. + limit: Maximum number of rows to return. The SDK may fetch multiple pages to satisfy this limit. + all_pages: Fetch and combine pages until the server reports the last page. + max_pages: Optional safety cap for ``all_pages``. raw: Return the decoded JSON payload without tabular extraction. fields: Optional field list or comma-separated field string applied after extraction. as_dataframe: Return a pandas ``DataFrame`` by default; set to ``False`` for Python rows. @@ -4084,33 +3455,24 @@ Returns: payloads when multi-page fetching is used with ``raw=True``. ``` -

hk_cashflow

+

sw_industry_constituent_history

-- 接口名称:港股现金流量表 +- 接口名称:申万行业成份股历史 - HTTP:`GET` -- Path:`api/v1/market/data/hk/hk-cashflow` -- 参数:`stock_code`, `year`, `report_type`, `start_date`, `end_date`, `page`, `page_size` -- 来源文档:`港股现金流量表.md` -- 原始接口:`hk_cashflow` +- Path:`api/v1/market/data/sw-industry/constituent-history` +- 参数:`industry_code` +- 来源文档:`申万行业成份股历史.md` +- 原始接口:`sw_industry_constituent_history` ```text -港股现金流量表. +申万行业成份股历史. -Endpoint: ``api/v1/market/data/hk/hk-cashflow``. +Endpoint: ``api/v1/market/data/sw-industry/constituent-history``. Method: ``GET``. -Documented endpoint: ``hk_cashflow``. +Documented endpoint: ``sw_industry_constituent_history``. Args: - stock_code: 港股代码(如 `00700.HK`) (type: string; required: N). - year: 报告期年份(如 2024),按 `end_date` 日历年过滤,需配 `report_type` (type: int32; required: N). - report_type: 报告类型:annual(年报)/ semi(半年报),需配 `year` (type: string; required: N). - start_date: 报告期范围下界 YYYYMMDD(含),过滤 `end_date >= 此值` (type: int32; required: N). - end_date: 报告期范围上界 YYYYMMDD(含),过滤 `end_date <= 此值` (type: int32; required: N). - page: Page number, starting from 1. If omitted, the server default is used unless ``limit`` or ``all_pages`` is set. - page_size: Rows per page. The SDK validates this against the endpoint-specific maximum. - limit: Maximum number of rows to return. The SDK may fetch multiple pages to satisfy this limit. - all_pages: Fetch and combine pages until the server reports the last page. - max_pages: Optional safety cap for ``all_pages``. + industry_code: 行业代码,带 .SI 后缀,如 801010.SI (type: string; required: Y). raw: Return the decoded JSON payload without tabular extraction. fields: Optional field list or comma-separated field string applied after extraction. as_dataframe: Return a pandas ``DataFrame`` by default; set to ``False`` for Python rows. @@ -4122,28 +3484,27 @@ Returns: payloads when multi-page fetching is used with ``raw=True``. ``` -

hk_income_bank

+

sw_industry_daily_metrics

-- 接口名称:港股利润表 +- 接口名称:申万行业日度指标 - HTTP:`GET` -- Path:`api/v1/market/data/hk/hk-income-bank` -- 参数:`trade_code`, `year`, `report_type`, `start_date`, `end_date`, `page`, `page_size` -- 来源文档:`港股利润表.md` -- 原始接口:`hk_income_bank` +- Path:`api/v1/market/data/sw-industry/daily-metrics` +- 参数:`level`, `start_date`, `end_date`, `industry_code`, `page`, `page_size` +- 来源文档:`申万行业日度指标.md` +- 原始接口:`sw_industry_daily_metrics` ```text -港股利润表. +申万行业日度指标. -Endpoint: ``api/v1/market/data/hk/hk-income-bank``. +Endpoint: ``api/v1/market/data/sw-industry/daily-metrics``. Method: ``GET``. -Documented endpoint: ``hk_income_bank``. +Documented endpoint: ``sw_industry_daily_metrics``. Args: - trade_code: 港股代码(支持 `700` / `00700.HK`) (type: string; required: N). - year: 报告期年份(如 2024),按 `end_date` 日历年过滤,需配 `report_type` (type: int32; required: N). - report_type: 报告类型:annual(年报)/ semi(半年报),需配 `year` (type: string; required: N). - start_date: 起始截止日期 YYYYMMDD,筛选 `end_date >= 此值` (type: int32; required: N). - end_date: 结束截止日期 YYYYMMDD,筛选 `end_date <= 此值` (type: int32; required: N). + level: 行业层级:1/2/3 (type: int; required: Y). + start_date: 起始日期,YYYYMMDD (type: string; required: Y). + end_date: 截止日期,YYYYMMDD (type: string; required: Y). + industry_code: 行业代码,带 .SI 后缀,如 801010.SI (type: string; required: Y). page: Page number, starting from 1. If omitted, the server default is used unless ``limit`` or ``all_pages`` is set. page_size: Rows per page. The SDK validates this against the endpoint-specific maximum. limit: Maximum number of rows to return. The SDK may fetch multiple pages to satisfy this limit. @@ -4160,28 +3521,25 @@ Returns: payloads when multi-page fetching is used with ``raw=True``. ``` -

hk_income_gene

+

sw_industry_overview

-- 接口名称:港股利润表 +- 接口名称:申万行业总览 - HTTP:`GET` -- Path:`api/v1/market/data/hk/hk-income-gene` -- 参数:`trade_code`, `year`, `report_type`, `start_date`, `end_date`, `page`, `page_size` -- 来源文档:`港股利润表.md` -- 原始接口:`hk_income_gene` +- Path:`api/v1/market/data/sw-industry/overview` +- 参数:`date`, `level`, `page`, `page_size` +- 来源文档:`申万行业总览.md` +- 原始接口:`sw_industry_overview` ```text -港股利润表. +申万行业总览. -Endpoint: ``api/v1/market/data/hk/hk-income-gene``. +Endpoint: ``api/v1/market/data/sw-industry/overview``. Method: ``GET``. -Documented endpoint: ``hk_income_gene``. +Documented endpoint: ``sw_industry_overview``. Args: - trade_code: 港股代码(支持 `700` / `00700.HK`) (type: string; required: N). - year: 报告期年份(如 2024),按 `end_date` 日历年过滤,需配 `report_type` (type: int32; required: N). - report_type: 报告类型:annual(年报)/ semi(半年报),需配 `year` (type: string; required: N). - start_date: 起始截止日期 YYYYMMDD,筛选 `end_date >= 此值` (type: int32; required: N). - end_date: 结束截止日期 YYYYMMDD,筛选 `end_date <= 此值` (type: int32; required: N). + date: 交易日,格式 YYYYMMDD (type: string; required: Y). + level: 行业层级:1/2/3,不传返回全部 (type: int; required: N). page: Page number, starting from 1. If omitted, the server default is used unless ``limit`` or ``all_pages`` is set. page_size: Rows per page. The SDK validates this against the endpoint-specific maximum. limit: Maximum number of rows to return. The SDK may fetch multiple pages to satisfy this limit. @@ -4198,33 +3556,31 @@ Returns: payloads when multi-page fetching is used with ``raw=True``. ``` -

hk_income_insur

+### ETF专题 + +

etf_adjust_factor

-- 接口名称:港股利润表 +- 接口名称:ETF复权因子 - HTTP:`GET` -- Path:`api/v1/market/data/hk/hk-income-insur` -- 参数:`trade_code`, `year`, `report_type`, `start_date`, `end_date`, `page`, `page_size` -- 来源文档:`港股利润表.md` -- 原始接口:`hk_income_insur` +- Path:`api/v1/market/data/etf-adjust-factor` +- 参数:`symbol`, `trade_date`, `start_date`, `end_date`, `page`, `page_size` +- 来源文档:`ETF复权因子.md` +- 原始接口:`etf_adjust_factor` ```text -港股利润表. +ETF复权因子. -Endpoint: ``api/v1/market/data/hk/hk-income-insur``. +Endpoint: ``api/v1/market/data/etf-adjust-factor``. Method: ``GET``. -Documented endpoint: ``hk_income_insur``. +Documented endpoint: ``etf_adjust_factor``. Args: - trade_code: 港股代码(支持 `700` / `00700.HK`) (type: string; required: N). - year: 报告期年份(如 2024),按 `end_date` 日历年过滤,需配 `report_type` (type: int32; required: N). - report_type: 报告类型:annual(年报)/ semi(半年报),需配 `year` (type: string; required: N). - start_date: 起始截止日期 YYYYMMDD,筛选 `end_date >= 此值` (type: int32; required: N). - end_date: 结束截止日期 YYYYMMDD,筛选 `end_date <= 此值` (type: int32; required: N). - page: Page number, starting from 1. If omitted, the server default is used unless ``limit`` or ``all_pages`` is set. - page_size: Rows per page. The SDK validates this against the endpoint-specific maximum. - limit: Maximum number of rows to return. The SDK may fetch multiple pages to satisfy this limit. - all_pages: Fetch and combine pages until the server reports the last page. - max_pages: Optional safety cap for ``all_pages``. + symbol: ETF 代码,支持纯数字或带后缀格式;区间扫描必填 (type: string; required: N). + trade_date: 交易日期 YYYYMMDD;空则默认当天,非交易日回退前一交易日 (type: string; required: N). + start_date: 区间起始日期 YYYYMMDD;区间扫描必填且需配 symbol (type: string; required: N). + end_date: 区间结束日期 YYYYMMDD;区间扫描必填且需配 symbol (type: string; required: N). + page: 页码,从 1 开始。 + page_size: 每页条数,最大 2000。 raw: Return the decoded JSON payload without tabular extraction. fields: Optional field list or comma-separated field string applied after extraction. as_dataframe: Return a pandas ``DataFrame`` by default; set to ``False`` for Python rows. @@ -4236,29 +3592,30 @@ Returns: payloads when multi-page fetching is used with ``raw=True``. ``` -

hk_valuatnanalyd

+

etf_candlesticks

-- 接口名称:港股估值分析 +- 接口名称:ETFK线 - HTTP:`GET` -- Path:`api/v1/market/data/hk/hk-valuatnanalyd` -- 参数:`trade_code`, `page`, `page_size` -- 来源文档:`港股估值分析.md` -- 原始接口:`get_hk_valuatnanalyd` +- Path:`api/v1/market/data/etf-candlesticks` +- 参数:`symbol`, `interval_unit`, `interval_value`, `adjust_kind`, `since_ts_millis`, `until_ts_millis`, `limit` +- 来源文档:`ETFK线.md` +- 原始接口:`etf_candlesticks` ```text -港股估值分析. +ETFK线. -Endpoint: ``api/v1/market/data/hk/hk-valuatnanalyd``. +Endpoint: ``api/v1/market/data/etf-candlesticks``. Method: ``GET``. -Documented endpoint: ``get_hk_valuatnanalyd``. +Documented endpoint: ``etf_candlesticks``. Args: - trade_code: 港股代码(支持 `700` / `00700.HK`);留空查全市场 (type: string; required: N). - page: Page number, starting from 1. If omitted, the server default is used unless ``limit`` or ``all_pages`` is set. - page_size: Rows per page. The SDK validates this against the endpoint-specific maximum. - limit: Maximum number of rows to return. The SDK may fetch multiple pages to satisfy this limit. - all_pages: Fetch and combine pages until the server reports the last page. - max_pages: Optional safety cap for ``all_pages``. + symbol: ETF 代码,如 510300.XSHG、159915.XSHE;也接受 .SH、.SZ 短后缀 (type: string; required: Y). + interval_unit: 周期单位:Minute/Day/Week/Month/Year (type: enum; required: Y). + interval_value: 间隔数值,默认 1;例如 Minute+5 表示 5 分钟 K 线 (type: int; required: N). + adjust_kind: 复权:None(默认,不复权)/Forward(前复权)/Backward(后复权) (type: enum; required: N). + since_ts_millis: 开始时间戳,单位毫秒;分钟 K 线与 until 的跨度 ≤3 天 (type: int(ms); required: N). + until_ts_millis: 结束时间戳,单位毫秒 (type: int(ms); required: Y). + limit: 返回条数上限;未传 since 和 limit 时默认最多返回 50 根 K 线 (type: int; required: N). raw: Return the decoded JSON payload without tabular extraction. fields: Optional field list or comma-separated field string applied after extraction. as_dataframe: Return a pandas ``DataFrame`` by default; set to ``False`` for Python rows. @@ -4270,33 +3627,24 @@ Returns: payloads when multi-page fetching is used with ``raw=True``. ``` -

hsi_daily_weight

+

etf_components_all

-- 接口名称:恒生指数每日权重 +- 接口名称:ETF成份列表 - HTTP:`GET` -- Path:`api/v1/market/data/hk/hsi-daily-weight` -- 参数:`trade_date`, `start_date`, `end_date`, `index_slug`, `stock_code`, `page`, `page_size` -- 来源文档:`恒生指数每日权重.md` -- 原始接口:`hsi_daily_weight` +- Path:`api/v2/market/data/etf-components-all` +- 参数:`symbol` +- 来源文档:`ETF成份列表.md` +- 原始接口:`etf_components_all` ```text -恒生指数每日权重. +ETF成份列表. -Endpoint: ``api/v1/market/data/hk/hsi-daily-weight``. +Endpoint: ``api/v2/market/data/etf-components-all``. Method: ``GET``. -Documented endpoint: ``hsi_daily_weight``. +Documented endpoint: ``etf_components_all``. Args: - trade_date: 交易日期 (type: string; required: N). - start_date: 起始日期 (type: string; required: N). - end_date: 结束日期 (type: string; required: N). - index_slug: 指数代码 (type: string; required: N). - stock_code: 成份股代码 (type: string; required: N). - page: Page number, starting from 1. If omitted, the server default is used unless ``limit`` or ``all_pages`` is set. - page_size: Rows per page. The SDK validates this against the endpoint-specific maximum. - limit: Maximum number of rows to return. The SDK may fetch multiple pages to satisfy this limit. - all_pages: Fetch and combine pages until the server reports the last page. - max_pages: Optional safety cap for ``all_pages``. + symbol: ETF 标的代码;不传返回全部 ETF (type: string; required: N). raw: Return the decoded JSON payload without tabular extraction. fields: Optional field list or comma-separated field string applied after extraction. as_dataframe: Return a pandas ``DataFrame`` by default; set to ``False`` for Python rows. @@ -4308,24 +3656,23 @@ Returns: payloads when multi-page fetching is used with ``raw=True``. ``` -

market_cap_hk

+

etf_description_all

-- 接口名称:港股市值 +- 接口名称:ETF基础信息 - HTTP:`GET` -- Path:`api/v1/market/data/hk/market-cap-hk` -- 参数:`trade_code` -- 来源文档:`港股市值.md` -- 原始接口:`get_market_cap_hk` +- Path:`api/v2/market/data/etf-description-all` +- 参数:- +- 来源文档:`ETF基础信息.md` +- 原始接口:`etf_description_all` ```text -港股市值. +ETF基础信息. -Endpoint: ``api/v1/market/data/hk/market-cap-hk``. +Endpoint: ``api/v1/market/data/etf-description-all``. Method: ``GET``. -Documented endpoint: ``get_market_cap_hk``. +Documented endpoint: ``etf_description_all``. Args: - trade_code: 港股交易代码 (type: string; required: Y). raw: Return the decoded JSON payload without tabular extraction. fields: Optional field list or comma-separated field string applied after extraction. as_dataframe: Return a pandas ``DataFrame`` by default; set to ``False`` for Python rows. @@ -4337,28 +3684,37 @@ Returns: payloads when multi-page fetching is used with ``raw=True``. ``` -### 美股数据 +

etf_minutes

-

eastmoney_us_stock_daily_kline

+- 接口名称:ETF历史分钟行情 +- HTTP:`GET` +- Path:`api/v3/market/data/etf_minutes` +- 参数:`symbol`, `interval_value`, `adjust_kind`, `since_ts_millis`, `until_ts_millis`, `limit` +- 来源文档:`ETF历史分钟行情.md` +- 原始接口:`etf_minutes` -- 接口名称:东方财富美股日OHLC +```text +ETF历史分钟行情. +``` + +

etf_pcf_list

+ +- 接口名称:ETF-PCF清单列表 - HTTP:`GET` -- Path:`api/v1/market/data/eastmoney-us-stock-daily-ohlc` -- 参数:`stock_code`, `start_date`, `end_date`, `page`, `page_size` -- 来源文档:`东方财富美股日OHLC.md` -- 原始接口:`eastmoney_us_stock_daily_kline` +- Path:`api/v2/market/data/etf-pcf/etf-pcfs` +- 参数:`date`, `page`, `page_size` +- 来源文档:`ETF-PCF清单列表.md` +- 原始接口:`etf_pcf_list_handler` ```text -东方财富美股日OHLC. +ETF-PCF清单列表. -Endpoint: ``api/v1/market/data/eastmoney-us-stock-daily-ohlc``. +Endpoint: ``api/v1/market/data/etf-pcf/etf-pcfs``. Method: ``GET``. -Documented endpoint: ``eastmoney_us_stock_daily_kline``. +Documented endpoint: ``etf_pcf_list_handler``. Args: - stock_code: 股票代码,如 AAPL (type: string; required: Y). - start_date: 起始日期(含),YYYY-MM-DD 或 YYYYMMDD;不传从最早开始 (type: string; required: N). - end_date: 截止日期(含),YYYY-MM-DD 或 YYYYMMDD;不传到最晚 (type: string; required: N). + date: 日期 YYYYMMDD,必填 (type: int; required: Y). page: Page number, starting from 1. If omitted, the server default is used unless ``limit`` or ``all_pages`` is set. page_size: Rows per page. The SDK validates this against the endpoint-specific maximum. limit: Maximum number of rows to return. The SDK may fetch multiple pages to satisfy this limit. @@ -4375,29 +3731,24 @@ Returns: payloads when multi-page fetching is used with ``raw=True``. ``` -

eastmoney_us_stock_latest_kline

+

etf_pre

-- 接口名称:东方财富美股最新OHLC +- 接口名称:ETF盘前数据 - HTTP:`GET` -- Path:`api/v1/market/data/eastmoney-us-stock-latest-ohlc` -- 参数:`stock_code`, `page`, `page_size` -- 来源文档:`东方财富美股最新OHLC.md` -- 原始接口:`eastmoney_us_stock_latest_kline` +- Path:`api/v2/market/data/etf-pre-data` +- 参数:`date` +- 来源文档:`ETF盘前数据.md` +- 原始接口:`get_etf_pre` ```text -东方财富美股最新OHLC. +ETF盘前数据. -Endpoint: ``api/v1/market/data/eastmoney-us-stock-latest-ohlc``. +Endpoint: ``api/v1/market/data/etf-pre-data``. Method: ``GET``. -Documented endpoint: ``eastmoney_us_stock_latest_kline``. +Documented endpoint: ``get_etf_pre``. Args: - stock_code: 股票代码,如 ADV;不传返回全部美股最新 K 线 (type: string; required: N). - page: Page number, starting from 1. If omitted, the server default is used unless ``limit`` or ``all_pages`` is set. - page_size: Rows per page. The SDK validates this against the endpoint-specific maximum. - limit: Maximum number of rows to return. The SDK may fetch multiple pages to satisfy this limit. - all_pages: Fetch and combine pages until the server reports the last page. - max_pages: Optional safety cap for ``all_pages``. + date: 交易日 YYYYMMDD;不传则使用当日(CST) (type: int; required: N). raw: Return the decoded JSON payload without tabular extraction. fields: Optional field list or comma-separated field string applied after extraction. as_dataframe: Return a pandas ``DataFrame`` by default; set to ``False`` for Python rows. @@ -4409,29 +3760,25 @@ Returns: payloads when multi-page fetching is used with ``raw=True``. ``` -

eastmoney_us_stock_list

+

etf_pre_single

-- 接口名称:东方财富美股列表 +- 接口名称:单只ETF盘前数据 - HTTP:`GET` -- Path:`api/v1/market/data/eastmoney-us-stock-list` -- 参数:`refresh`, `page`, `page_size` -- 来源文档:`东方财富美股列表.md` -- 原始接口:`eastmoney_us_stock_list` +- Path:`api/v2/market/data/etf-pre-single` +- 参数:`symbol`, `date` +- 来源文档:`单只ETF盘前数据.md` +- 原始接口:`get_etf_pre_single_handler` ```text -东方财富美股列表. +单只ETF盘前数据. -Endpoint: ``api/v1/market/data/eastmoney-us-stock-list``. +Endpoint: ``api/v1/market/data/etf-pre-single``. Method: ``GET``. -Documented endpoint: ``eastmoney_us_stock_list``. +Documented endpoint: ``get_etf_pre_single_handler``. Args: - refresh: 为 true 时强制从 CSV 重新加载列表缓存 (type: bool; required: N). - page: Page number, starting from 1. If omitted, the server default is used unless ``limit`` or ``all_pages`` is set. - page_size: Rows per page. The SDK validates this against the endpoint-specific maximum. - limit: Maximum number of rows to return. The SDK may fetch multiple pages to satisfy this limit. - all_pages: Fetch and combine pages until the server reports the last page. - max_pages: Optional safety cap for ``all_pages``. + symbol: ETF 标的代码,带交易所后缀,如 510300.XSHG、159915.XSHE (type: string; required: Y). + date: 交易日 YYYYMMDD;不传则使用当日(CST) (type: int; required: N). raw: Return the decoded JSON payload without tabular extraction. fields: Optional field list or comma-separated field string applied after extraction. as_dataframe: Return a pandas ``DataFrame`` by default; set to ``False`` for Python rows. @@ -4443,62 +3790,56 @@ Returns: payloads when multi-page fetching is used with ``raw=True``. ``` -

us_balance

+

etf_realtime_day_kline

-- 接口名称:美股资产负债表 +- 接口名称:ETF实时日K线 - HTTP:`GET` -- Path:`api/v1/market/data/us/us-balance` -- 参数:`stock_code`, `period`, `report_type`, `start_date`, `end_date`, `page`, `page_size` -- 来源文档:`美股资产负债表.md` -- 原始接口:`us_balance` +- Path:`api/v4/market/data/etf-realtime-day-kline` +- 参数:`symbols` +- 来源文档:`ETF实时日K线.md` +- 原始接口:`etf_realtime_day_kline` ```text -美股资产负债表. +ETF实时日K线. +``` -Endpoint: ``api/v1/market/data/us/us-balance``. -Method: ``GET``. -Documented endpoint: ``us_balance``. +

etf_realtime_minute_kline

-Args: - stock_code: 美股代码,纯代码不带后缀,如 NVDA (type: string; required: Y). - period: 财年(如 2024),匹配 stmt_year,非自然年 (type: int; required: N). - report_type: 报告期类型:Q1 / Q2 / Q3 / Q4 / H1 (type: string; required: N). - start_date: 报告期下界 YYYYMMDD(含),过滤 end_date (type: int; required: N). - end_date: 报告期上界 YYYYMMDD(含),过滤 end_date (type: int; required: N). - page: Page number, starting from 1. If omitted, the server default is used unless ``limit`` or ``all_pages`` is set. - page_size: Rows per page. The SDK validates this against the endpoint-specific maximum. - limit: Maximum number of rows to return. The SDK may fetch multiple pages to satisfy this limit. - all_pages: Fetch and combine pages until the server reports the last page. - max_pages: Optional safety cap for ``all_pages``. - raw: Return the decoded JSON payload without tabular extraction. - fields: Optional field list or comma-separated field string applied after extraction. - as_dataframe: Return a pandas ``DataFrame`` by default; set to ``False`` for Python rows. - **kwargs: Extra request parameters forwarded unchanged. Useful when the service adds parameters before the SDK is regenerated. +- 接口名称:ETF实时分钟K线 +- HTTP:`GET` +- Path:`api/v4/market/data/etf-realtime-minute-kline` +- 参数:`symbols` +- 来源文档:`ETF实时分钟K线.md` +- 原始接口:`etf_realtime_minute_kline` -Returns: - A pandas ``DataFrame`` by default, Python rows when - ``as_dataframe=False``, raw JSON when ``raw=True``, or raw page - payloads when multi-page fetching is used with ``raw=True``. +```text +ETF实时分钟K线. ``` -

us_basic

+### 公募基金 + +

fund_asset_allocation

-- 接口名称:美股基础信息 +- 接口名称:基金资产配置 - HTTP:`GET` -- Path:`api/v1/market/data/us/us-basic` -- 参数:`stock_code`, `page`, `page_size` -- 来源文档:`美股基础信息.md` -- 原始接口:`us_basic` +- Path:`api/v1/market/data/fund/fund-asset-allocation` +- 参数:`fund_code`, `report_date`, `publish_date`, `start_date`, `end_date`, `page`, `page_size` +- 来源文档:`基金资产配置.md` +- 原始接口:`get_fund_asset_allocation` ```text -美股基础信息. +基金资产配置. -Endpoint: ``api/v1/market/data/us/us-basic``. +Endpoint: ``api/v1/market/data/fund/fund-asset-allocation``. Method: ``GET``. -Documented endpoint: ``us_basic``. +Documented endpoint: ``get_fund_asset_allocation``. Args: - stock_code: 美股代码(可选),纯代码如 NVDA;不传则分页返回全部 (type: string; required: N). + fund_code: 基金代码 (type: string; required: Y). + report_date: 报告期 YYYYMMDD(与 start/end 互斥) (type: int; required: N). + publish_date: 发布日期 YYYYMMDD (type: int; required: N). + start_date: 报告期起始日期(需与 end_date 同传) (type: int; required: N). + end_date: 报告期结束日期 (type: int; required: N). page: Page number, starting from 1. If omitted, the server default is used unless ``limit`` or ``all_pages`` is set. page_size: Rows per page. The SDK validates this against the endpoint-specific maximum. limit: Maximum number of rows to return. The SDK may fetch multiple pages to satisfy this limit. @@ -4515,28 +3856,24 @@ Returns: payloads when multi-page fetching is used with ``raw=True``. ``` -

us_cashflow

+

fund_basicinfo

-- 接口名称:美股现金流 +- 接口名称:基金基础信息 - HTTP:`GET` -- Path:`api/v1/market/data/us/us-cashflow` -- 参数:`stock_code`, `period`, `report_type`, `start_date`, `end_date`, `page`, `page_size` -- 来源文档:`美股现金流.md` -- 原始接口:`us_cashflow` +- Path:`api/v1/market/data/fund/fund-basicinfo` +- 参数:`institution_code`, `page`, `page_size` +- 来源文档:`基金基础信息.md` +- 原始接口:`get_fund_basicinfo` ```text -美股现金流. +基金基础信息. -Endpoint: ``api/v1/market/data/us/us-cashflow``. +Endpoint: ``api/v1/market/data/fund/fund-basicinfo``. Method: ``GET``. -Documented endpoint: ``us_cashflow``. +Documented endpoint: ``get_fund_basicinfo``. Args: - stock_code: 美股代码,纯代码不带后缀,如 NVDA (type: string; required: Y). - period: 财年(如 2024),匹配 stmt_year,非自然年 (type: int; required: N). - report_type: 报告期类型:Q1 / Q2 / Q3 / Q4 / H1 (type: string; required: N). - start_date: 报告期下界 YYYYMMDD(含),过滤 end_date (type: int; required: N). - end_date: 报告期上界 YYYYMMDD(含),过滤 end_date (type: int; required: N). + institution_code: 基金代码 (type: string; required: Y). page: Page number, starting from 1. If omitted, the server default is used unless ``limit`` or ``all_pages`` is set. page_size: Rows per page. The SDK validates this against the endpoint-specific maximum. limit: Maximum number of rows to return. The SDK may fetch multiple pages to satisfy this limit. @@ -4553,33 +3890,25 @@ Returns: payloads when multi-page fetching is used with ``raw=True``. ``` -

us_income

+

fund_cal_return

-- 接口名称:美股利润表 +- 接口名称:基金收益 - HTTP:`GET` -- Path:`api/v1/market/data/us/us-income` -- 参数:`stock_code`, `period`, `report_type`, `start_date`, `end_date`, `page`, `page_size` -- 来源文档:`美股利润表.md` -- 原始接口:`us_income` +- Path:`api/v1/market/data/fund/fund-cal-return` +- 参数:`institution_code`, `cal-type` +- 来源文档:`基金收益.md` +- 原始接口:`get_fund_cal_return` ```text -美股利润表. +基金收益. -Endpoint: ``api/v1/market/data/us/us-income``. +Endpoint: ``api/v1/market/data/fund/fund-cal-return``. Method: ``GET``. -Documented endpoint: ``us_income``. +Documented endpoint: ``get_fund_cal_return``. Args: - stock_code: 美股代码,纯代码不带后缀,如 NVDA (type: string; required: Y). - period: 财年(如 2024),匹配 stmt_year,非自然年 (type: int; required: N). - report_type: 报告期类型:Q1 / Q2 / Q3 / Q4 / H1 (type: string; required: N). - start_date: 报告期下界 YYYYMMDD(含),过滤 end_date (type: int; required: N). - end_date: 报告期上界 YYYYMMDD(含),过滤 end_date (type: int; required: N). - page: Page number, starting from 1. If omitted, the server default is used unless ``limit`` or ``all_pages`` is set. - page_size: Rows per page. The SDK validates this against the endpoint-specific maximum. - limit: Maximum number of rows to return. The SDK may fetch multiple pages to satisfy this limit. - all_pages: Fetch and combine pages until the server reports the last page. - max_pages: Optional safety cap for ``all_pages``. + institution_code: 基金代码(6位数字) (type: string; required: Y). + cal_type: 查询区间:1M / 3M / 6M / 1Y / 3Y / 5Y / YTD(请求字段名为 `cal-type`) (type: string; required: Y). Request key: ``cal-type``. raw: Return the decoded JSON payload without tabular extraction. fields: Optional field list or comma-separated field string applied after extraction. as_dataframe: Return a pandas ``DataFrame`` by default; set to ``False`` for Python rows. @@ -4591,31 +3920,25 @@ Returns: payloads when multi-page fetching is used with ``raw=True``. ``` -

eastmoney_us_stock_daily_ohlc

+

fund_classification

-- 接口名称:东方财富美股日OHLC +- 接口名称:基金分类 - HTTP:`GET` -- Path:`api/v1/market/data/eastmoney-us-stock-daily-ohlc` -- 参数:`stock_code`, `start_date`, `end_date`, `page`, `page_size` -- 来源文档:`东方财富美股日OHLC.md` -- 原始接口:`eastmoney_us_stock_daily_kline` +- Path:`api/v1/market/data/fund/fund-classification` +- 参数:`fund_code`, `classify_std` +- 来源文档:`基金分类.md` +- 原始接口:`get_fund_classification` ```text -东方财富美股日OHLC. +基金分类. -Endpoint: ``api/v1/market/data/eastmoney-us-stock-daily-ohlc``. +Endpoint: ``api/v1/market/data/fund/fund-classification``. Method: ``GET``. -Documented endpoint: ``eastmoney_us_stock_daily_kline``. +Documented endpoint: ``get_fund_classification``. Args: - stock_code: 股票代码,如 AAPL (type: string; required: Y). - start_date: 起始日期(含),YYYY-MM-DD 或 YYYYMMDD;不传从最早开始 (type: string; required: N). - end_date: 截止日期(含),YYYY-MM-DD 或 YYYYMMDD;不传到最晚 (type: string; required: N). - page: Page number, starting from 1. If omitted, the server default is used unless ``limit`` or ``all_pages`` is set. - page_size: Rows per page. The SDK validates this against the endpoint-specific maximum. - limit: Maximum number of rows to return. The SDK may fetch multiple pages to satisfy this limit. - all_pages: Fetch and combine pages until the server reports the last page. - max_pages: Optional safety cap for ``all_pages``. + fund_code: 基金代码 (type: string; required: Y). + classify_std: 分类标准:证监会基金分类/晨星基金分类/银河证券分类2017版/Gangtise基金分类/Gangtise基金概念分类,缺省全部 (type: string; required: N). raw: Return the decoded JSON payload without tabular extraction. fields: Optional field list or comma-separated field string applied after extraction. as_dataframe: Return a pandas ``DataFrame`` by default; set to ``False`` for Python rows. @@ -4623,28 +3946,27 @@ Args: Returns: A pandas ``DataFrame`` by default, Python rows when - ``as_dataframe=False``, raw JSON when ``raw=True``, or raw page - payloads when multi-page fetching is used with ``raw=True``. + ``as_dataframe=False``, raw JSON when ``raw=True``. ``` -

eastmoney_us_stock_latest_ohlc

+

fund_company

-- 接口名称:东方财富美股最新OHLC +- 接口名称:基金公司 - HTTP:`GET` -- Path:`api/v1/market/data/eastmoney-us-stock-latest-ohlc` -- 参数:`stock_code`, `page`, `page_size` -- 来源文档:`东方财富美股最新OHLC.md` -- 原始接口:`eastmoney_us_stock_latest_kline` +- Path:`api/v1/market/data/fund/fund-company` +- 参数:`fund_company`, `page`, `page_size` +- 来源文档:`基金公司.md` +- 原始接口:`get_fund_company` ```text -东方财富美股最新OHLC. +基金公司. -Endpoint: ``api/v1/market/data/eastmoney-us-stock-latest-ohlc``. +Endpoint: ``api/v1/market/data/fund/fund-company``. Method: ``GET``. -Documented endpoint: ``eastmoney_us_stock_latest_kline``. +Documented endpoint: ``get_fund_company``. Args: - stock_code: 股票代码,如 ADV;不传返回全部美股最新 K 线 (type: string; required: N). + fund_company: 基金公司名称,精确匹配 (type: string; required: N). page: Page number, starting from 1. If omitted, the server default is used unless ``limit`` or ``all_pages`` is set. page_size: Rows per page. The SDK validates this against the endpoint-specific maximum. limit: Maximum number of rows to return. The SDK may fetch multiple pages to satisfy this limit. @@ -4661,63 +3983,31 @@ Returns: payloads when multi-page fetching is used with ``raw=True``. ``` -### 指数专题 - -

global_index_daily_kline

+

fund_fee

-- 接口名称:全球指数日K线 +- 接口名称:基金费率 - HTTP:`GET` -- Path:`api/v1/market/data/global-index/daily-kline` -- 参数:`secid`, `start_date`, `end_date` -- 来源文档:`全球指数日K线.md` -- 原始接口:`global_index_daily_kline` +- Path:`api/v1/market/data/fund/fund-fee` +- 参数:`fund_code`, `charge_type`, `client_type`, `page`, `page_size` +- 来源文档:`基金费率.md` +- 原始接口:`get_fund_fee` ```text -全球指数日K线. +基金费率. -Endpoint: ``api/v1/market/data/global-index/daily-kline``. +Endpoint: ``api/v1/market/data/fund/fund-fee``. Method: ``GET``. -Documented endpoint: ``global_index_daily_kline``. - -Args: - secid: 东方财富全球指数编码,如 100.NDX、100.DJIA、100.SPX、100.HSI、100.N225 (type: string; required: Y). - start_date: 开始日期 YYYY-MM-DD(含) (type: string; required: N). - end_date: 结束日期 YYYY-MM-DD(含) (type: string; required: N). - raw: Return the decoded JSON payload without tabular extraction. - fields: Optional field list or comma-separated field string applied after extraction. - as_dataframe: Return a pandas ``DataFrame`` by default; set to ``False`` for Python rows. - **kwargs: Extra request parameters forwarded unchanged. Useful when the service adds parameters before the SDK is regenerated. - -Returns: - A pandas ``DataFrame`` by default, Python rows when - ``as_dataframe=False``, raw JSON when ``raw=True``, or raw page - payloads when multi-page fetching is used with ``raw=True``. -``` - -

index_candlesticks

- -- 接口名称:指数K线 -- HTTP:`POST` -- Path:`api/v1/market/data/index-candlesticks` -- 参数:`symbol`, `interval_unit`, `interval_value`, `adjust_kind`, `since_ts_millis`, `until_ts_millis`, `limit` -- 来源文档:`指数K线.md` -- 原始接口:`index_candlesticks` - -```text -指数K线. - -Endpoint: ``api/v1/market/data/index-candlesticks``. -Method: ``POST``. -Documented endpoint: ``index_candlesticks``. +Documented endpoint: ``get_fund_fee``. Args: - symbol: 指数代码,如 000300.XSHG、399001.XSHE;也接受 .SH、.SZ 短后缀 (type: string; required: Y). - interval_unit: 周期单位:Minute/Day/Week/Month/Year (type: enum; required: Y). - interval_value: 间隔数值,默认 1;例如 Minute+5 表示 5 分钟 K 线 (type: int; required: N). - adjust_kind: 复权:None(默认,不复权)/Forward(前复权)/Backward(后复权) (type: enum; required: N). - since_ts_millis: 开始时间戳,单位毫秒;分钟 K 线与 until 的跨度 ≤3 天 (type: int(ms); required: N). - until_ts_millis: 结束时间戳,单位毫秒 (type: int(ms); required: Y). - limit: 返回条数上限;未传 since 和 limit 时默认最多返回 50 根 K 线 (type: int; required: N). + fund_code: 基金代码 (type: string; required: Y). + charge_type: 费率类型:日常申购费/日常赎回费/认购费/管理费/托管费/销售服务费 (type: string; required: N). + client_type: 客户类型:一般/机构/养老金/REITs (type: string; required: N). + page: Page number, starting from 1. If omitted, the server default is used unless ``limit`` or ``all_pages`` is set. + page_size: Rows per page. The SDK validates this against the endpoint-specific maximum. + limit: Maximum number of rows to return. The SDK may fetch multiple pages to satisfy this limit. + all_pages: Fetch and combine pages until the server reports the last page. + max_pages: Optional safety cap for ``all_pages``. raw: Return the decoded JSON payload without tabular extraction. fields: Optional field list or comma-separated field string applied after extraction. as_dataframe: Return a pandas ``DataFrame`` by default; set to ``False`` for Python rows. @@ -4729,30 +4019,27 @@ Returns: payloads when multi-page fetching is used with ``raw=True``. ``` -

index_candlesticks_batch

+

fund_holder_structure

-- 接口名称:批量指数K线 -- HTTP:`POST` -- Path:`api/v1/market/data/index-candlesticks/batch` -- 参数:`symbols`, `interval_unit`, `interval_value`, `adjust_kind`, `since_ts_millis`, `until_ts_millis`, `limit` -- 来源文档:`批量指数K线.md` -- 原始接口:`index_candlesticks_batch` +- 接口名称:基金持有人结构 +- HTTP:`GET` +- Path:`api/v1/market/data/fund/fund-holder-structure` +- 参数:`fund_code`, `report_type`, `start_date`, `end_date` +- 来源文档:`基金持有人结构.md` +- 原始接口:`get_fund_holder_structure` ```text -批量指数K线. +基金持有人结构. -Endpoint: ``api/v1/market/data/index-candlesticks/batch``. -Method: ``POST``. -Documented endpoint: ``index_candlesticks_batch``. +Endpoint: ``api/v1/market/data/fund/fund-holder-structure``. +Method: ``GET``. +Documented endpoint: ``get_fund_holder_structure``. Args: - symbols: 指数代码列表,如 ["000300.XSHG","399001.XSHE"];也接受 .SH、.SZ 短后缀 (type: string[]; required: Y). - interval_unit: 周期单位:Minute/Day/Week/Month/Year (type: enum; required: Y). - interval_value: 间隔数值,默认 1;例如 Minute+5 表示 5 分钟 K 线 (type: int; required: N). - adjust_kind: 复权:None(默认,不复权)/Forward(前复权)/Backward(后复权) (type: enum; required: N). - since_ts_millis: 开始时间戳,单位毫秒;分钟 K 线与 until 的跨度 ≤3 天 (type: int(ms); required: N). - until_ts_millis: 结束时间戳,单位毫秒 (type: int(ms); required: Y). - limit: 每个标的的返回条数上限;未传 since 和 limit 时默认最多返回 50 根 K 线 (type: int; required: N). + fund_code: 基金代码 (type: string; required: Y). + report_type: 报告类型:年度报告/中期报告/上市公告书/基金合同生效公告,缺省全部 (type: string; required: N). + start_date: 报告期起始日期 YYYYMMDD (type: int; required: N). + end_date: 报告期截止日期 YYYYMMDD (type: int; required: N). raw: Return the decoded JSON payload without tabular extraction. fields: Optional field list or comma-separated field string applied after extraction. as_dataframe: Return a pandas ``DataFrame`` by default; set to ``False`` for Python rows. @@ -4760,27 +4047,28 @@ Args: Returns: A pandas ``DataFrame`` by default, Python rows when - ``as_dataframe=False``, raw JSON when ``raw=True``, or raw page - payloads when multi-page fetching is used with ``raw=True``. + ``as_dataframe=False``, raw JSON when ``raw=True``. ``` -

index_description_all

+

fund_index_fund

-- 接口名称:指数基础信息 +- 接口名称:指数跟踪基金 - HTTP:`GET` -- Path:`api/v1/market/data/index-description-all` -- 参数:- -- 来源文档:`指数基础信息.md` -- 原始接口:`index_description_all` +- Path:`api/v2/market/data/fund/index-fund` +- 参数:`index_code`, `scope` +- 来源文档:`指数跟踪基金.md` +- 原始接口:`get_fund_index_fund` ```text -指数基础信息. +指数跟踪基金. -Endpoint: ``api/v1/market/data/index-description-all``. +Endpoint: ``api/v1/market/data/fund/index-fund``. Method: ``GET``. -Documented endpoint: ``index_description_all``. +Documented endpoint: ``get_fund_index_fund``. Args: + index_code: 指数代码,支持裸码或带后缀 (type: string; required: Y). + scope: `all` 全市场(默认)/ `etf` 仅场内 ETF (type: string; required: N). raw: Return the decoded JSON payload without tabular extraction. fields: Optional field list or comma-separated field string applied after extraction. as_dataframe: Return a pandas ``DataFrame`` by default; set to ``False`` for Python rows. @@ -4788,27 +4076,28 @@ Args: Returns: A pandas ``DataFrame`` by default, Python rows when - ``as_dataframe=False``, raw JSON when ``raw=True``, or raw page - payloads when multi-page fetching is used with ``raw=True``. + ``as_dataframe=False``, raw JSON when ``raw=True``. ``` -

index_description_list

+

fund_list

-- 接口名称:中证指数描述列表 +- 接口名称:基金列表 - HTTP:`GET` -- Path:`api/v1/market/data/index/index_description` -- 参数:`page`, `page_size` -- 来源文档:`中证指数描述列表.md` -- 原始接口:`index_description_list_handler` +- Path:`api/v1/market/data/fund/fund-list` +- 参数:`fund_code`, `fund_type`, `page`, `page_size` +- 来源文档:`基金列表.md` +- 原始接口:`get_fund_list` ```text -中证指数描述列表. +基金列表. -Endpoint: ``api/v1/market/data/index/index_description``. +Endpoint: ``api/v1/market/data/fund/fund-list``. Method: ``GET``. -Documented endpoint: ``index_description_list_handler``. +Documented endpoint: ``get_fund_list``. Args: + fund_code: 基金代码 (type: string; required: N). + fund_type: 基金类型,精确匹配(股票型/混合型/债券型/货币型/保本型/其他型/REITs) (type: string; required: N). page: Page number, starting from 1. If omitted, the server default is used unless ``limit`` or ``all_pages`` is set. page_size: Rows per page. The SDK validates this against the endpoint-specific maximum. limit: Maximum number of rows to return. The SDK may fetch multiple pages to satisfy this limit. @@ -4825,25 +4114,26 @@ Returns: payloads when multi-page fetching is used with ``raw=True``. ``` -

index_weight_list

+

fund_manager

-- 接口名称:指数权重列表 +- 接口名称:基金经理任职关系 - HTTP:`GET` -- Path:`api/v1/market/data/index/index_weight` -- 参数:`index_code`, `date`, `page`, `page_size` -- 来源文档:`指数权重列表.md` -- 原始接口:`index_weight_list_handler` +- Path:`api/v1/market/data/fund/fund-manager` +- 参数:`fund_code`, `fund_manager`, `is_inoffice`, `page`, `page_size` +- 来源文档:`基金经理任职关系.md` +- 原始接口:`get_fund_manager` ```text -指数权重列表. +基金经理任职关系. -Endpoint: ``api/v1/market/data/index/index_weight``. +Endpoint: ``api/v1/market/data/fund/fund-manager``. Method: ``GET``. -Documented endpoint: ``index_weight_list_handler``. +Documented endpoint: ``get_fund_manager``. Args: - index_code: 指数代码,如 000300(沪深300),为空会被拒 (type: string; required: Y). - date: 权重采集日期 YYYYMMDD(如 20260529),不传取最新期 (type: string; required: N). + fund_code: 基金代码(与 fund_manager 二选一) (type: string; required: N). + fund_manager: 基金经理姓名(与 fund_code 二选一) (type: string; required: N). + is_inoffice: 1 在任 / 0 离任 (type: string; required: N). page: Page number, starting from 1. If omitted, the server default is used unless ``limit`` or ``all_pages`` is set. page_size: Rows per page. The SDK validates this against the endpoint-specific maximum. limit: Maximum number of rows to return. The SDK may fetch multiple pages to satisfy this limit. @@ -4860,23 +4150,27 @@ Returns: payloads when multi-page fetching is used with ``raw=True``. ``` -

index_weight_summary

+

fund_net_value

-- 接口名称:指数权重汇总 +- 接口名称:基金净值明细 - HTTP:`GET` -- Path:`api/v1/market/data/index/index_weight_summary` -- 参数:`page`, `page_size` -- 来源文档:`指数权重汇总.md` -- 原始接口:`index_weight_summary_handler` +- Path:`api/v1/market/data/fund/fund-net-value` +- 参数:`fund_code`, `nav_date`, `start_date`, `end_date`, `page`, `page_size` +- 来源文档:`基金净值明细.md` +- 原始接口:`get_fund_net_value` ```text -指数权重汇总. +基金净值明细. -Endpoint: ``api/v1/market/data/index/index_weight_summary``. +Endpoint: ``api/v1/market/data/fund/fund-net-value``. Method: ``GET``. -Documented endpoint: ``index_weight_summary_handler``. +Documented endpoint: ``get_fund_net_value``. Args: + fund_code: 基金代码 (type: string; required: Y). + nav_date: 净值日期 YYYYMMDD(与 start/end 互斥) (type: int; required: N). + start_date: 净值开始日期 YYYYMMDD(需与 end_date 同传) (type: int; required: N). + end_date: 净值结束日期 YYYYMMDD (type: int; required: N). page: Page number, starting from 1. If omitted, the server default is used unless ``limit`` or ``all_pages`` is set. page_size: Rows per page. The SDK validates this against the endpoint-specific maximum. limit: Maximum number of rows to return. The SDK may fetch multiple pages to satisfy this limit. @@ -4893,837 +4187,32 @@ Returns: payloads when multi-page fetching is used with ``raw=True``. ``` -

sw_industry_constituent_history

- -- 接口名称:申万行业成份股历史 -- HTTP:`GET` -- Path:`api/v1/market/data/sw-industry/constituent-history` -- 参数:`industry_code` -- 来源文档:`申万行业成份股历史.md` -- 原始接口:`sw_industry_constituent_history` - -```text -申万行业成份股历史. - -Endpoint: ``api/v1/market/data/sw-industry/constituent-history``. -Method: ``GET``. -Documented endpoint: ``sw_industry_constituent_history``. - -Args: - industry_code: 行业代码,带 .SI 后缀,如 801010.SI (type: string; required: Y). - raw: Return the decoded JSON payload without tabular extraction. - fields: Optional field list or comma-separated field string applied after extraction. - as_dataframe: Return a pandas ``DataFrame`` by default; set to ``False`` for Python rows. - **kwargs: Extra request parameters forwarded unchanged. Useful when the service adds parameters before the SDK is regenerated. - -Returns: - A pandas ``DataFrame`` by default, Python rows when - ``as_dataframe=False``, raw JSON when ``raw=True``, or raw page - payloads when multi-page fetching is used with ``raw=True``. -``` - -

sw_industry_daily_metrics

+

fund_net_value_performance

-- 接口名称:申万行业日度指标 +- 接口名称:基金净值收益表现 - HTTP:`GET` -- Path:`api/v1/market/data/sw-industry/daily-metrics` -- 参数:`level`, `start_date`, `end_date`, `industry_code`, `page`, `page_size` -- 来源文档:`申万行业日度指标.md` -- 原始接口:`sw_industry_daily_metrics` +- Path:`api/v1/market/data/fund/fund-net-value-performance` +- 参数:`fund_code`, `stat_date`, `start_date`, `end_date`, `page`, `page_size` +- 来源文档:`基金净值收益表现.md` +- 原始接口:`get_fund_net_value_performance` ```text -申万行业日度指标. +基金净值收益表现. -Endpoint: ``api/v1/market/data/sw-industry/daily-metrics``. +Endpoint: ``api/v1/market/data/fund/fund-net-value-performance``. Method: ``GET``. -Documented endpoint: ``sw_industry_daily_metrics``. - -Args: - level: 行业层级:1/2/3 (type: int; required: Y). - start_date: 起始日期,YYYYMMDD (type: string; required: Y). - end_date: 截止日期,YYYYMMDD (type: string; required: Y). - industry_code: 行业代码,带 .SI 后缀,如 801010.SI (type: string; required: Y). - page: Page number, starting from 1. If omitted, the server default is used unless ``limit`` or ``all_pages`` is set. - page_size: Rows per page. The SDK validates this against the endpoint-specific maximum. - limit: Maximum number of rows to return. The SDK may fetch multiple pages to satisfy this limit. - all_pages: Fetch and combine pages until the server reports the last page. - max_pages: Optional safety cap for ``all_pages``. - raw: Return the decoded JSON payload without tabular extraction. - fields: Optional field list or comma-separated field string applied after extraction. - as_dataframe: Return a pandas ``DataFrame`` by default; set to ``False`` for Python rows. - **kwargs: Extra request parameters forwarded unchanged. Useful when the service adds parameters before the SDK is regenerated. - -Returns: - A pandas ``DataFrame`` by default, Python rows when - ``as_dataframe=False``, raw JSON when ``raw=True``, or raw page - payloads when multi-page fetching is used with ``raw=True``. -``` +Documented endpoint: ``get_fund_net_value_performance``. -

sw_industry_overview

- -- 接口名称:申万行业总览 -- HTTP:`GET` -- Path:`api/v1/market/data/sw-industry/overview` -- 参数:`date`, `level`, `page`, `page_size` -- 来源文档:`申万行业总览.md` -- 原始接口:`sw_industry_overview` - -```text -申万行业总览. - -Endpoint: ``api/v1/market/data/sw-industry/overview``. -Method: ``GET``. -Documented endpoint: ``sw_industry_overview``. - -Args: - date: 交易日,格式 YYYYMMDD (type: string; required: Y). - level: 行业层级:1/2/3,不传返回全部 (type: int; required: N). - page: Page number, starting from 1. If omitted, the server default is used unless ``limit`` or ``all_pages`` is set. - page_size: Rows per page. The SDK validates this against the endpoint-specific maximum. - limit: Maximum number of rows to return. The SDK may fetch multiple pages to satisfy this limit. - all_pages: Fetch and combine pages until the server reports the last page. - max_pages: Optional safety cap for ``all_pages``. - raw: Return the decoded JSON payload without tabular extraction. - fields: Optional field list or comma-separated field string applied after extraction. - as_dataframe: Return a pandas ``DataFrame`` by default; set to ``False`` for Python rows. - **kwargs: Extra request parameters forwarded unchanged. Useful when the service adds parameters before the SDK is regenerated. - -Returns: - A pandas ``DataFrame`` by default, Python rows when - ``as_dataframe=False``, raw JSON when ``raw=True``, or raw page - payloads when multi-page fetching is used with ``raw=True``. -``` - -### ETF专题 - -

etf_adjust_factor

- -- 接口名称:ETF复权因子 -- HTTP:`GET` -- Path:`api/v1/market/data/etf-adjust-factor` -- 参数:`symbol`, `trade_date`, `start_date`, `end_date`, `offset`, `limit` -- 来源文档:`ETF复权因子.md` -- 原始接口:`etf_adjust_factor` - -```text -ETF复权因子. - -Endpoint: ``api/v1/market/data/etf-adjust-factor``. -Method: ``GET``. -Documented endpoint: ``etf_adjust_factor``. - -Args: - symbol: ETF 代码,支持纯数字或带后缀格式;区间扫描必填 (type: string; required: N). - trade_date: 交易日期 YYYYMMDD;空则默认当天,非交易日回退前一交易日 (type: string; required: N). - start_date: 区间起始日期 YYYYMMDD;区间扫描必填且需配 symbol (type: string; required: N). - end_date: 区间结束日期 YYYYMMDD;区间扫描必填且需配 symbol (type: string; required: N). - offset: 返回结果起始偏移 (type: int; required: N). - limit: 返回结果最大条数 (type: int; required: N). - raw: Return the decoded JSON payload without tabular extraction. - fields: Optional field list or comma-separated field string applied after extraction. - as_dataframe: Return a pandas ``DataFrame`` by default; set to ``False`` for Python rows. - **kwargs: Extra request parameters forwarded unchanged. Useful when the service adds parameters before the SDK is regenerated. - -Returns: - A pandas ``DataFrame`` by default, Python rows when - ``as_dataframe=False``, raw JSON when ``raw=True``, or raw page - payloads when multi-page fetching is used with ``raw=True``. -``` - -

etf_candlesticks

- -- 接口名称:ETFK线 -- HTTP:`POST` -- Path:`api/v1/market/data/etf-candlesticks` -- 参数:`symbol`, `interval_unit`, `interval_value`, `adjust_kind`, `since_ts_millis`, `until_ts_millis`, `limit` -- 来源文档:`ETFK线.md` -- 原始接口:`etf_candlesticks` - -```text -ETFK线. - -Endpoint: ``api/v1/market/data/etf-candlesticks``. -Method: ``POST``. -Documented endpoint: ``etf_candlesticks``. - -Args: - symbol: ETF 代码,如 510300.XSHG、159915.XSHE;也接受 .SH、.SZ 短后缀 (type: string; required: Y). - interval_unit: 周期单位:Minute/Day/Week/Month/Year (type: enum; required: Y). - interval_value: 间隔数值,默认 1;例如 Minute+5 表示 5 分钟 K 线 (type: int; required: N). - adjust_kind: 复权:None(默认,不复权)/Forward(前复权)/Backward(后复权) (type: enum; required: N). - since_ts_millis: 开始时间戳,单位毫秒;分钟 K 线与 until 的跨度 ≤3 天 (type: int(ms); required: N). - until_ts_millis: 结束时间戳,单位毫秒 (type: int(ms); required: Y). - limit: 返回条数上限;未传 since 和 limit 时默认最多返回 50 根 K 线 (type: int; required: N). - raw: Return the decoded JSON payload without tabular extraction. - fields: Optional field list or comma-separated field string applied after extraction. - as_dataframe: Return a pandas ``DataFrame`` by default; set to ``False`` for Python rows. - **kwargs: Extra request parameters forwarded unchanged. Useful when the service adds parameters before the SDK is regenerated. - -Returns: - A pandas ``DataFrame`` by default, Python rows when - ``as_dataframe=False``, raw JSON when ``raw=True``, or raw page - payloads when multi-page fetching is used with ``raw=True``. -``` - -

etf_candlesticks_batch

- -- 接口名称:批量ETFK线 -- HTTP:`POST` -- Path:`api/v1/market/data/etf-candlesticks/batch` -- 参数:`symbols`, `interval_unit`, `interval_value`, `adjust_kind`, `since_ts_millis`, `until_ts_millis`, `limit` -- 来源文档:`批量ETFK线.md` -- 原始接口:`etf_candlesticks_batch` - -```text -批量ETFK线. - -Endpoint: ``api/v1/market/data/etf-candlesticks/batch``. -Method: ``POST``. -Documented endpoint: ``etf_candlesticks_batch``. - -Args: - symbols: ETF 代码列表,如 ["510300.XSHG","159915.XSHE"];也接受 .SH、.SZ 短后缀 (type: string[]; required: Y). - interval_unit: 周期单位:Minute/Day/Week/Month/Year (type: enum; required: Y). - interval_value: 间隔数值,默认 1;例如 Minute+5 表示 5 分钟 K 线 (type: int; required: N). - adjust_kind: 复权:None(默认,不复权)/Forward(前复权)/Backward(后复权) (type: enum; required: N). - since_ts_millis: 开始时间戳,单位毫秒;分钟 K 线与 until 的跨度 ≤3 天 (type: int(ms); required: N). - until_ts_millis: 结束时间戳,单位毫秒 (type: int(ms); required: Y). - limit: 每个标的的返回条数上限;未传 since 和 limit 时默认最多返回 50 根 K 线 (type: int; required: N). - raw: Return the decoded JSON payload without tabular extraction. - fields: Optional field list or comma-separated field string applied after extraction. - as_dataframe: Return a pandas ``DataFrame`` by default; set to ``False`` for Python rows. - **kwargs: Extra request parameters forwarded unchanged. Useful when the service adds parameters before the SDK is regenerated. - -Returns: - A pandas ``DataFrame`` by default, Python rows when - ``as_dataframe=False``, raw JSON when ``raw=True``, or raw page - payloads when multi-page fetching is used with ``raw=True``. -``` - -

etf_components

- -- 接口名称:ETF成份股 -- HTTP:`GET` -- Path:`api/v1/market/data/etf-component` -- 参数:`symbol` -- 来源文档:`ETF成份股.md` -- 原始接口:`get_etf_components_handler` - -```text -ETF成份股. - -Endpoint: ``api/v1/market/data/etf-component``. -Method: ``GET``. -Documented endpoint: ``get_etf_components_handler``. - -Args: - symbol: ETF 标的代码,带交易所后缀,如 510300.XSHG、159915.XSHE (type: string; required: Y). - raw: Return the decoded JSON payload without tabular extraction. - fields: Optional field list or comma-separated field string applied after extraction. - as_dataframe: Return a pandas ``DataFrame`` by default; set to ``False`` for Python rows. - **kwargs: Extra request parameters forwarded unchanged. Useful when the service adds parameters before the SDK is regenerated. - -Returns: - A pandas ``DataFrame`` by default, Python rows when - ``as_dataframe=False``, raw JSON when ``raw=True``, or raw page - payloads when multi-page fetching is used with ``raw=True``. -``` - -

etf_components_all

- -- 接口名称:ETF成份列表 -- HTTP:`GET` -- Path:`api/v1/market/data/etf-components-all` -- 参数:- -- 来源文档:`ETF成份列表.md` -- 原始接口:`etf_components_all` - -```text -ETF成份列表. - -Endpoint: ``api/v1/market/data/etf-components-all``. -Method: ``GET``. -Documented endpoint: ``etf_components_all``. - -Args: - raw: Return the decoded JSON payload without tabular extraction. - fields: Optional field list or comma-separated field string applied after extraction. - as_dataframe: Return a pandas ``DataFrame`` by default; set to ``False`` for Python rows. - **kwargs: Extra request parameters forwarded unchanged. Useful when the service adds parameters before the SDK is regenerated. - -Returns: - A pandas ``DataFrame`` by default, Python rows when - ``as_dataframe=False``, raw JSON when ``raw=True``, or raw page - payloads when multi-page fetching is used with ``raw=True``. -``` - -

etf_description_all

- -- 接口名称:ETF基础信息 -- HTTP:`GET` -- Path:`api/v1/market/data/etf-description-all` -- 参数:- -- 来源文档:`ETF基础信息.md` -- 原始接口:`etf_description_all` - -```text -ETF基础信息. - -Endpoint: ``api/v1/market/data/etf-description-all``. -Method: ``GET``. -Documented endpoint: ``etf_description_all``. - -Args: - raw: Return the decoded JSON payload without tabular extraction. - fields: Optional field list or comma-separated field string applied after extraction. - as_dataframe: Return a pandas ``DataFrame`` by default; set to ``False`` for Python rows. - **kwargs: Extra request parameters forwarded unchanged. Useful when the service adds parameters before the SDK is regenerated. - -Returns: - A pandas ``DataFrame`` by default, Python rows when - ``as_dataframe=False``, raw JSON when ``raw=True``, or raw page - payloads when multi-page fetching is used with ``raw=True``. -``` - -

etf_fund_export

- -- 接口名称:指数ETF基金导出 -- HTTP:`GET` -- Path:`api/v1/market/data/etf/zhitou-etf` -- 参数:`request_id`, `page`, `page_size` -- 来源文档:`指数ETF基金导出.md` -- 原始接口:`etf_fund_export` - -```text -指数ETF基金导出. - -Endpoint: ``api/v1/market/data/etf/zhitou-etf``. -Method: ``GET``. -Documented endpoint: ``etf_fund_export``. - -Args: - request_id: 请求唯一标识,由调用方生成,原样写入响应 (type: string; required: Y). - page: Page number, starting from 1. If omitted, the server default is used unless ``limit`` or ``all_pages`` is set. - page_size: Rows per page. The SDK validates this against the endpoint-specific maximum. - limit: Maximum number of rows to return. The SDK may fetch multiple pages to satisfy this limit. - all_pages: Fetch and combine pages until the server reports the last page. - max_pages: Optional safety cap for ``all_pages``. - raw: Return the decoded JSON payload without tabular extraction. - fields: Optional field list or comma-separated field string applied after extraction. - as_dataframe: Return a pandas ``DataFrame`` by default; set to ``False`` for Python rows. - **kwargs: Extra request parameters forwarded unchanged. Useful when the service adds parameters before the SDK is regenerated. - -Returns: - A pandas ``DataFrame`` by default, Python rows when - ``as_dataframe=False``, raw JSON when ``raw=True``, or raw page - payloads when multi-page fetching is used with ``raw=True``. -``` - -

etf_pcf_list

- -- 接口名称:ETF-PCF清单列表 -- HTTP:`GET` -- Path:`api/v1/market/data/etf-pcf/etf-pcfs` -- 参数:`date`, `page`, `page_size` -- 来源文档:`ETF-PCF清单列表.md` -- 原始接口:`etf_pcf_list_handler` - -```text -ETF-PCF清单列表. - -Endpoint: ``api/v1/market/data/etf-pcf/etf-pcfs``. -Method: ``GET``. -Documented endpoint: ``etf_pcf_list_handler``. - -Args: - date: 日期 YYYYMMDD,必填 (type: int; required: Y). - page: Page number, starting from 1. If omitted, the server default is used unless ``limit`` or ``all_pages`` is set. - page_size: Rows per page. The SDK validates this against the endpoint-specific maximum. - limit: Maximum number of rows to return. The SDK may fetch multiple pages to satisfy this limit. - all_pages: Fetch and combine pages until the server reports the last page. - max_pages: Optional safety cap for ``all_pages``. - raw: Return the decoded JSON payload without tabular extraction. - fields: Optional field list or comma-separated field string applied after extraction. - as_dataframe: Return a pandas ``DataFrame`` by default; set to ``False`` for Python rows. - **kwargs: Extra request parameters forwarded unchanged. Useful when the service adds parameters before the SDK is regenerated. - -Returns: - A pandas ``DataFrame`` by default, Python rows when - ``as_dataframe=False``, raw JSON when ``raw=True``, or raw page - payloads when multi-page fetching is used with ``raw=True``. -``` - -

etf_pre

- -- 接口名称:ETF盘前数据 -- HTTP:`GET` -- Path:`api/v1/market/data/etf-pre-data` -- 参数:`date` -- 来源文档:`ETF盘前数据.md` -- 原始接口:`get_etf_pre` - -```text -ETF盘前数据. - -Endpoint: ``api/v1/market/data/etf-pre-data``. -Method: ``GET``. -Documented endpoint: ``get_etf_pre``. - -Args: - date: 交易日 YYYYMMDD;不传则使用当日(CST) (type: int; required: N). - raw: Return the decoded JSON payload without tabular extraction. - fields: Optional field list or comma-separated field string applied after extraction. - as_dataframe: Return a pandas ``DataFrame`` by default; set to ``False`` for Python rows. - **kwargs: Extra request parameters forwarded unchanged. Useful when the service adds parameters before the SDK is regenerated. - -Returns: - A pandas ``DataFrame`` by default, Python rows when - ``as_dataframe=False``, raw JSON when ``raw=True``, or raw page - payloads when multi-page fetching is used with ``raw=True``. -``` - -

etf_pre_single

- -- 接口名称:单只ETF盘前数据 -- HTTP:`GET` -- Path:`api/v1/market/data/etf-pre-single` -- 参数:`symbol`, `date` -- 来源文档:`单只ETF盘前数据.md` -- 原始接口:`get_etf_pre_single_handler` - -```text -单只ETF盘前数据. - -Endpoint: ``api/v1/market/data/etf-pre-single``. -Method: ``GET``. -Documented endpoint: ``get_etf_pre_single_handler``. - -Args: - symbol: ETF 标的代码,带交易所后缀,如 510300.XSHG、159915.XSHE (type: string; required: Y). - date: 交易日 YYYYMMDD;不传则使用当日(CST) (type: int; required: N). - raw: Return the decoded JSON payload without tabular extraction. - fields: Optional field list or comma-separated field string applied after extraction. - as_dataframe: Return a pandas ``DataFrame`` by default; set to ``False`` for Python rows. - **kwargs: Extra request parameters forwarded unchanged. Useful when the service adds parameters before the SDK is regenerated. - -Returns: - A pandas ``DataFrame`` by default, Python rows when - ``as_dataframe=False``, raw JSON when ``raw=True``, or raw page - payloads when multi-page fetching is used with ``raw=True``. -``` - -### 公募基金 - -

fund_basicinfo

- -- 接口名称:基金基础信息 -- HTTP:`GET` -- Path:`api/v1/market/data/fund/fund-basicinfo` -- 参数:`institution_code`, `page`, `page_size` -- 来源文档:`基金基础信息.md` -- 原始接口:`get_fund_basicinfo` - -```text -基金基础信息. - -Endpoint: ``api/v1/market/data/fund/fund-basicinfo``. -Method: ``GET``. -Documented endpoint: ``get_fund_basicinfo``. - -Args: - institution_code: 基金代码 (type: string; required: Y). - page: Page number, starting from 1. If omitted, the server default is used unless ``limit`` or ``all_pages`` is set. - page_size: Rows per page. The SDK validates this against the endpoint-specific maximum. - limit: Maximum number of rows to return. The SDK may fetch multiple pages to satisfy this limit. - all_pages: Fetch and combine pages until the server reports the last page. - max_pages: Optional safety cap for ``all_pages``. - raw: Return the decoded JSON payload without tabular extraction. - fields: Optional field list or comma-separated field string applied after extraction. - as_dataframe: Return a pandas ``DataFrame`` by default; set to ``False`` for Python rows. - **kwargs: Extra request parameters forwarded unchanged. Useful when the service adds parameters before the SDK is regenerated. - -Returns: - A pandas ``DataFrame`` by default, Python rows when - ``as_dataframe=False``, raw JSON when ``raw=True``, or raw page - payloads when multi-page fetching is used with ``raw=True``. -``` - -

fund_cal_return

- -- 接口名称:基金收益 -- HTTP:`GET` -- Path:`api/v1/market/data/fund/fund-cal-return` -- 参数:`institution_code`, `cal-type` -- 来源文档:`基金收益.md` -- 原始接口:`get_fund_cal_return` - -```text -基金收益. - -Endpoint: ``api/v1/market/data/fund/fund-cal-return``. -Method: ``GET``. -Documented endpoint: ``get_fund_cal_return``. - -Args: - institution_code: 基金代码(6位数字) (type: string; required: Y). - cal_type: 查询区间:1M / 3M / 6M / 1Y / 3Y / 5Y / YTD(请求字段名为 `cal-type`) (type: string; required: Y). Request key: ``cal-type``. - raw: Return the decoded JSON payload without tabular extraction. - fields: Optional field list or comma-separated field string applied after extraction. - as_dataframe: Return a pandas ``DataFrame`` by default; set to ``False`` for Python rows. - **kwargs: Extra request parameters forwarded unchanged. Useful when the service adds parameters before the SDK is regenerated. - -Returns: - A pandas ``DataFrame`` by default, Python rows when - ``as_dataframe=False``, raw JSON when ``raw=True``, or raw page - payloads when multi-page fetching is used with ``raw=True``. -``` - -

fund_nav

- -- 接口名称:基金净值 -- HTTP:`GET` -- Path:`api/v1/market/data/fund/fund-nav` -- 参数:`institution_code`, `page`, `page_size` -- 来源文档:`基金净值.md` -- 原始接口:`get_fund_nav` - -```text -基金净值. - -Endpoint: ``api/v1/market/data/fund/fund-nav``. -Method: ``GET``. -Documented endpoint: ``get_fund_nav``. - -Args: - institution_code: 基金代码 (type: string; required: Y). - page: Page number, starting from 1. If omitted, the server default is used unless ``limit`` or ``all_pages`` is set. - page_size: Rows per page. The SDK validates this against the endpoint-specific maximum. - limit: Maximum number of rows to return. The SDK may fetch multiple pages to satisfy this limit. - all_pages: Fetch and combine pages until the server reports the last page. - max_pages: Optional safety cap for ``all_pages``. - raw: Return the decoded JSON payload without tabular extraction. - fields: Optional field list or comma-separated field string applied after extraction. - as_dataframe: Return a pandas ``DataFrame`` by default; set to ``False`` for Python rows. - **kwargs: Extra request parameters forwarded unchanged. Useful when the service adds parameters before the SDK is regenerated. - -Returns: - A pandas ``DataFrame`` by default, Python rows when - ``as_dataframe=False``, raw JSON when ``raw=True``, or raw page - payloads when multi-page fetching is used with ``raw=True``. -``` - -

fund_overview

- -- 接口名称:基金总览 -- HTTP:`GET` -- Path:`api/v1/market/data/fund/fund-overview` -- 参数:`page`, `page_size` -- 来源文档:`基金总览.md` -- 原始接口:`get_fund_overview` - -```text -基金总览. - -Endpoint: ``api/v1/market/data/fund/fund-overview``. -Method: ``GET``. -Documented endpoint: ``get_fund_overview``. - -Args: - page: Page number, starting from 1. If omitted, the server default is used unless ``limit`` or ``all_pages`` is set. - page_size: Rows per page. The SDK validates this against the endpoint-specific maximum. - limit: Maximum number of rows to return. The SDK may fetch multiple pages to satisfy this limit. - all_pages: Fetch and combine pages until the server reports the last page. - max_pages: Optional safety cap for ``all_pages``. - raw: Return the decoded JSON payload without tabular extraction. - fields: Optional field list or comma-separated field string applied after extraction. - as_dataframe: Return a pandas ``DataFrame`` by default; set to ``False`` for Python rows. - **kwargs: Extra request parameters forwarded unchanged. Useful when the service adds parameters before the SDK is regenerated. - -Returns: - A pandas ``DataFrame`` by default, Python rows when - ``as_dataframe=False``, raw JSON when ``raw=True``, or raw page - payloads when multi-page fetching is used with ``raw=True``. -``` - -

fund_support_symbols

- -- 接口名称:基金支持标的 -- HTTP:`GET` -- Path:`api/v1/market/data/fund/fund-support-symbols` -- 参数:`page`, `page_size` -- 来源文档:`基金支持标的.md` -- 原始接口:`get_fund_support_symbols` - -```text -基金支持标的. - -Endpoint: ``api/v1/market/data/fund/fund-support-symbols``. -Method: ``GET``. -Documented endpoint: ``get_fund_support_symbols``. - -Args: - page: Page number, starting from 1. If omitted, the server default is used unless ``limit`` or ``all_pages`` is set. - page_size: Rows per page. The SDK validates this against the endpoint-specific maximum. - limit: Maximum number of rows to return. The SDK may fetch multiple pages to satisfy this limit. - all_pages: Fetch and combine pages until the server reports the last page. - max_pages: Optional safety cap for ``all_pages``. - raw: Return the decoded JSON payload without tabular extraction. - fields: Optional field list or comma-separated field string applied after extraction. - as_dataframe: Return a pandas ``DataFrame`` by default; set to ``False`` for Python rows. - **kwargs: Extra request parameters forwarded unchanged. Useful when the service adds parameters before the SDK is regenerated. - -Returns: - A pandas ``DataFrame`` by default, Python rows when - ``as_dataframe=False``, raw JSON when ``raw=True``, or raw page - payloads when multi-page fetching is used with ``raw=True``. -``` - -

fund_share

- -- 接口名称:基金份额 -- HTTP:`GET` -- Path:`api/v1/market/data/fund/fund-share` -- 参数:`fund_code`, `stati_perd`, `start_date`, `end_date`, `page`, `page_size` -- 来源文档:`基金份额.md` -- 原始接口:`get_fund_share` - -```text -Endpoint: ``api/v1/market/data/fund/fund-share``. -Method: ``GET``. -Documented endpoint: ``get_fund_share``. -``` - -

fund_company

- -- 接口名称:基金公司 -- HTTP:`GET` -- Path:`api/v1/market/data/fund/fund-company` -- 参数:`fund_company`, `page`, `page_size` -- 来源文档:`基金公司.md` -- 原始接口:`get_fund_company` - -```text -Endpoint: ``api/v1/market/data/fund/fund-company``. -Method: ``GET``. -Documented endpoint: ``get_fund_company``. -``` - -

fund_net_value_performance

- -- 接口名称:基金净值收益表现 -- HTTP:`GET` -- Path:`api/v1/market/data/fund/fund-net-value-performance` -- 参数:`fund_code`, `stat_date`, `start_date`, `end_date`, `page`, `page_size` -- 来源文档:`基金净值收益表现.md` -- 原始接口:`get_fund_net_value_performance` - -```text -Endpoint: ``api/v1/market/data/fund/fund-net-value-performance``. -Method: ``GET``. -Documented endpoint: ``get_fund_net_value_performance``. -``` - -

fund_net_value

- -- 接口名称:基金净值明细 -- HTTP:`GET` -- Path:`api/v1/market/data/fund/fund-net-value` -- 参数:`fund_code`, `nav_date`, `start_date`, `end_date`, `page`, `page_size` -- 来源文档:`基金净值明细.md` -- 原始接口:`get_fund_net_value` - -```text -Endpoint: ``api/v1/market/data/fund/fund-net-value``. -Method: ``GET``. -Documented endpoint: ``get_fund_net_value``. -``` - -

fund_classification

- -- 接口名称:基金分类 -- HTTP:`GET` -- Path:`api/v1/market/data/fund/fund-classification` -- 参数:`fund_code`, `classify_std` -- 来源文档:`基金分类.md` -- 原始接口:`get_fund_classification` - -```text -Endpoint: ``api/v1/market/data/fund/fund-classification``. -Method: ``GET``. -Documented endpoint: ``get_fund_classification``. -``` - -

fund_list

- -- 接口名称:基金列表 -- HTTP:`GET` -- Path:`api/v1/market/data/fund/fund-list` -- 参数:`fund_code`, `fund_type`, `page`, `page_size` -- 来源文档:`基金列表.md` -- 原始接口:`get_fund_list` - -```text -Endpoint: ``api/v1/market/data/fund/fund-list``. -Method: ``GET``. -Documented endpoint: ``get_fund_list``. -``` - -

fund_portfolio

- -- 接口名称:基金持仓明细 -- HTTP:`GET` -- Path:`api/v1/market/data/fund/fund-portfolio` -- 参数:`fund_code`, `report_date`, `publish_date`, `start_date`, `end_date`, `page`, `page_size` -- 来源文档:`基金持仓明细.md` -- 原始接口:`get_fund_portfolio` - -```text -Endpoint: ``api/v1/market/data/fund/fund-portfolio``. -Method: ``GET``. -Documented endpoint: ``get_fund_portfolio``. -``` - -

fund_holder_structure

- -- 接口名称:基金持有人结构 -- HTTP:`GET` -- Path:`api/v1/market/data/fund/fund-holder-structure` -- 参数:`fund_code`, `report_type`, `start_date`, `end_date` -- 来源文档:`基金持有人结构.md` -- 原始接口:`get_fund_holder_structure` - -```text -Endpoint: ``api/v1/market/data/fund/fund-holder-structure``. -Method: ``GET``. -Documented endpoint: ``get_fund_holder_structure``. -``` - -

fund_new_found

- -- 接口名称:基金新发 -- HTTP:`GET` -- Path:`api/v1/market/data/fund/fund-new-found` -- 参数:`start_date`, `end_date`, `fund_type`, `page`, `page_size` -- 来源文档:`基金新发.md` -- 原始接口:`get_fund_new_found` - -```text -Endpoint: ``api/v1/market/data/fund/fund-new-found``. -Method: ``GET``. -Documented endpoint: ``get_fund_new_found``. -``` - -

fund_manager

- -- 接口名称:基金经理任职关系 -- HTTP:`GET` -- Path:`api/v1/market/data/fund/fund-manager` -- 参数:`fund_code`, `fund_manager`, `is_inoffice`, `page`, `page_size` -- 来源文档:`基金经理任职关系.md` -- 原始接口:`get_fund_manager` - -```text -Endpoint: ``api/v1/market/data/fund/fund-manager``. -Method: ``GET``. -Documented endpoint: ``get_fund_manager``. -``` - -

fund_daily

- -- 接口名称:基金行情日线 -- HTTP:`GET` -- Path:`api/v1/market/data/fund/fund-daily` -- 参数:`fund_code`, `trade_date`, `start_date`, `end_date`, `page`, `page_size` -- 来源文档:`基金行情日线.md` -- 原始接口:`get_fund_daily` - -```text -Endpoint: ``api/v1/market/data/fund/fund-daily``. -Method: ``GET``. -Documented endpoint: ``get_fund_daily``. -``` - -

fund_fee

- -- 接口名称:基金费率 -- HTTP:`GET` -- Path:`api/v1/market/data/fund/fund-fee` -- 参数:`fund_code`, `charge_type`, `client_type`, `page`, `page_size` -- 来源文档:`基金费率.md` -- 原始接口:`get_fund_fee` - -```text -Endpoint: ``api/v1/market/data/fund/fund-fee``. -Method: ``GET``. -Documented endpoint: ``get_fund_fee``. -``` - -

fund_asset_allocation

- -- 接口名称:基金资产配置 -- HTTP:`GET` -- Path:`api/v1/market/data/fund/fund-asset-allocation` -- 参数:`fund_code`, `report_date`, `publish_date`, `start_date`, `end_date`, `page`, `page_size` -- 来源文档:`基金资产配置.md` -- 原始接口:`get_fund_asset_allocation` - -```text -Endpoint: ``api/v1/market/data/fund/fund-asset-allocation``. -Method: ``GET``. -Documented endpoint: ``get_fund_asset_allocation``. -``` - -

fund_risk_level

- -- 接口名称:基金风险等级 -- HTTP:`GET` -- Path:`api/v1/market/data/fund/fund-risk-level` -- 参数:`fund_code`, `history` -- 来源文档:`基金风险等级.md` -- 原始接口:`get_fund_risk_level` - -```text -Endpoint: ``api/v1/market/data/fund/fund-risk-level``. -Method: ``GET``. -Documented endpoint: ``get_fund_risk_level``. -``` - -

fund_index_fund

- -- 接口名称:指数跟踪基金 -- HTTP:`GET` -- Path:`api/v1/market/data/fund/index-fund` -- 参数:`index_code`, `scope` -- 来源文档:`指数跟踪基金.md` -- 原始接口:`get_fund_index_fund` - -```text -Endpoint: ``api/v1/market/data/fund/index-fund``. -Method: ``GET``. -Documented endpoint: ``get_fund_index_fund``. -``` - -### 期货数据 - -

china_futures_base_data

- -- 接口名称:中国期货基础数据 -- HTTP:`GET` -- Path:`api/v1/market/data/futures/futures-base-data` -- 参数:`trade_date`, `symbol` -- 来源文档:`中国期货基础数据.md` -- 原始接口:`get_china_futures_base_data_handler` - -```text -中国期货基础数据. - -Endpoint: ``api/v1/market/data/futures/futures-base-data``. -Method: ``GET``. -Documented endpoint: ``get_china_futures_base_data_handler``. - -Args: - trade_date: 交易日 YYYYMMDD;不传则使用前一交易日(CST) (type: int; required: N). - symbol: WIND 合约全码如 A2605.DCE;大小写不敏感;不传或空表示该日全部 (type: string; required: N). +Args: + fund_code: 基金代码 (type: string; required: Y). + stat_date: 统计日期 YYYYMMDD(与 start/end 互斥) (type: int; required: N). + start_date: 统计开始日期(需与 end_date 同传) (type: int; required: N). + end_date: 统计结束日期 (type: int; required: N). + page: Page number, starting from 1. If omitted, the server default is used unless ``limit`` or ``all_pages`` is set. + page_size: Rows per page. The SDK validates this against the endpoint-specific maximum. + limit: Maximum number of rows to return. The SDK may fetch multiple pages to satisfy this limit. + all_pages: Fetch and combine pages until the server reports the last page. + max_pages: Optional safety cap for ``all_pages``. raw: Return the decoded JSON payload without tabular extraction. fields: Optional field list or comma-separated field string applied after extraction. as_dataframe: Return a pandas ``DataFrame`` by default; set to ``False`` for Python rows. @@ -5735,24 +4224,31 @@ Returns: payloads when multi-page fetching is used with ``raw=True``. ``` -

china_futures_lists

+

fund_new_found

-- 接口名称:中国期货列表 +- 接口名称:基金新发 - HTTP:`GET` -- Path:`api/v1/market/data/futures/futures-lists` -- 参数:`trade_date` -- 来源文档:`中国期货列表.md` -- 原始接口:`get_china_futures_lists_handler` +- Path:`api/v1/market/data/fund/fund-new-found` +- 参数:`start_date`, `end_date`, `fund_type`, `page`, `page_size` +- 来源文档:`基金新发.md` +- 原始接口:`get_fund_new_found` ```text -中国期货列表. +基金新发. -Endpoint: ``api/v1/market/data/futures/futures-lists``. +Endpoint: ``api/v1/market/data/fund/fund-new-found``. Method: ``GET``. -Documented endpoint: ``get_china_futures_lists_handler``. +Documented endpoint: ``get_fund_new_found``. Args: - trade_date: 交易日 YYYYMMDD;不传则使用前一交易日(CST) (type: int; required: N). + start_date: 成立日起始日期 YYYYMMDD(不传默认近 1 年) (type: int; required: N). + end_date: 成立日截止日期 YYYYMMDD(不传默认今天) (type: int; required: N). + fund_type: 基金类型过滤:混合型/债券型/股票型/货币型/其他型/保本型/REITs (type: string; required: N). + page: Page number, starting from 1. If omitted, the server default is used unless ``limit`` or ``all_pages`` is set. + page_size: Rows per page. The SDK validates this against the endpoint-specific maximum. + limit: Maximum number of rows to return. The SDK may fetch multiple pages to satisfy this limit. + all_pages: Fetch and combine pages until the server reports the last page. + max_pages: Optional safety cap for ``all_pages``. raw: Return the decoded JSON payload without tabular extraction. fields: Optional field list or comma-separated field string applied after extraction. as_dataframe: Return a pandas ``DataFrame`` by default; set to ``False`` for Python rows. @@ -5764,30 +4260,23 @@ Returns: payloads when multi-page fetching is used with ``raw=True``. ``` -

eastmoney_futures_position

+

fund_overview

-- 接口名称:东方财富期货持仓 +- 接口名称:基金总览 - HTTP:`GET` -- Path:`api/v1/market/data/eastmoney-futures-position` -- 参数:`exchange`, `variety_code`, `contract_code`, `trade_date`, `start_date`, `end_date`, `member_name_abbr`, `page`, `page_size` -- 来源文档:`东方财富期货持仓.md` -- 原始接口:`get_eastmoney_futures_position` +- Path:`api/v1/market/data/fund/fund-overview` +- 参数:`page`, `page_size` +- 来源文档:`基金总览.md` +- 原始接口:`get_fund_overview` ```text -东方财富期货持仓. +基金总览. -Endpoint: ``api/v1/market/data/eastmoney-futures-position``. +Endpoint: ``api/v1/market/data/fund/fund-overview``. Method: ``GET``. -Documented endpoint: ``get_eastmoney_futures_position``. +Documented endpoint: ``get_fund_overview``. Args: - exchange: 交易所代码:shfe / dce / czce / cffex / ine / gfe (type: string; required: N). - variety_code: 品种代码,如 cu / au / al / IF (type: string; required: N). - contract_code: 合约代码,如 CU2607 / AU2608 (type: string; required: N). - trade_date: 交易日 YYYYMMDD;与 start_date/end_date 互斥 (type: string; required: N). - start_date: 区间起始日 YYYYMMDD;需与 end_date 同时提供 (type: string; required: N). - end_date: 区间结束日 YYYYMMDD;需与 start_date 同时提供 (type: string; required: N). - member_name_abbr: 会员简称 (type: string; required: N). page: Page number, starting from 1. If omitted, the server default is used unless ``limit`` or ``all_pages`` is set. page_size: Rows per page. The SDK validates this against the endpoint-specific maximum. limit: Maximum number of rows to return. The SDK may fetch multiple pages to satisfy this limit. @@ -5804,28 +4293,33 @@ Returns: payloads when multi-page fetching is used with ``raw=True``. ``` -

futures_contract_kline

+

fund_portfolio

-- 接口名称:期货合约K线 +- 接口名称:基金持仓明细 - HTTP:`GET` -- Path:`api/v1/market/data/futures/kline` -- 参数:`symbol`, `interval`, `start`, `end`, `limit` -- 来源文档:`期货合约K线.md` -- 原始接口:`futures_contract_kline` +- Path:`api/v1/market/data/fund/fund-portfolio` +- 参数:`fund_code`, `report_date`, `publish_date`, `start_date`, `end_date`, `page`, `page_size` +- 来源文档:`基金持仓明细.md` +- 原始接口:`get_fund_portfolio` ```text -期货合约K线. +基金持仓明细. -Endpoint: ``api/v1/market/data/futures/kline``. +Endpoint: ``api/v1/market/data/fund/fund-portfolio``. Method: ``GET``. -Documented endpoint: ``futures_contract_kline``. +Documented endpoint: ``get_fund_portfolio``. Args: - symbol: WIND 合约全码,如 A2605.DCE (type: string; required: Y). - interval: 周期,默认 1min;可选 1min/5min/15min/30min/60min/daily/weekly/monthly/quarterly/yearly (type: string; required: N). - start: 开始时间戳(毫秒);与 end 跨度 ≤3 天;仅 start 表示 [start,+∞) (type: int64; required: N). - end: 结束时间戳(毫秒,闭区间);须与 start 同时传入,禁止只传 end (type: int64; required: N). - limit: 最大返回条数,默认 500 (type: int; required: N). + fund_code: 基金代码 (type: string; required: Y). + report_date: 报告期 YYYYMMDD(与 start/end 互斥) (type: int; required: N). + publish_date: 发布日期 YYYYMMDD (type: int; required: N). + start_date: 报告期起始日期(需与 end_date 同传) (type: int; required: N). + end_date: 报告期结束日期 (type: int; required: N). + page: Page number, starting from 1. If omitted, the server default is used unless ``limit`` or ``all_pages`` is set. + page_size: Rows per page. The SDK validates this against the endpoint-specific maximum. + limit: Maximum number of rows to return. The SDK may fetch multiple pages to satisfy this limit. + all_pages: Fetch and combine pages until the server reports the last page. + max_pages: Optional safety cap for ``all_pages``. raw: Return the decoded JSON payload without tabular extraction. fields: Optional field list or comma-separated field string applied after extraction. as_dataframe: Return a pandas ``DataFrame`` by default; set to ``False`` for Python rows. @@ -5837,25 +4331,25 @@ Returns: payloads when multi-page fetching is used with ``raw=True``. ``` -

major_contract

+

fund_risk_level

-- 接口名称:重大合同 +- 接口名称:基金风险等级 - HTTP:`GET` -- Path:`api/v1/market/data/corporate/contract` -- 参数:`start_date`, `end_date` -- 来源文档:`重大合同.md` -- 原始接口:`major_contract` +- Path:`api/v1/market/data/fund/fund-risk-level` +- 参数:`fund_code`, `history` +- 来源文档:`基金风险等级.md` +- 原始接口:`get_fund_risk_level` ```text -重大合同. +基金风险等级. -Endpoint: ``api/v1/market/data/corporate/contract``. +Endpoint: ``api/v1/market/data/fund/fund-risk-level``. Method: ``GET``. -Documented endpoint: ``major_contract``. +Documented endpoint: ``get_fund_risk_level``. Args: - start_date: 起始日期(YYYYMMDD),区间跨度 ≤ 3 天 (type: string; required: Y). - end_date: 结束日期(YYYYMMDD),区间跨度 ≤ 3 天 (type: string; required: Y). + fund_code: 基金代码 (type: string; required: Y). + history: true 返回全部变更历史,缺省/false 仅当前有效 (type: bool; required: N). raw: Return the decoded JSON payload without tabular extraction. fields: Optional field list or comma-separated field string applied after extraction. as_dataframe: Return a pandas ``DataFrame`` by default; set to ``False`` for Python rows. @@ -5863,28 +4357,30 @@ Args: Returns: A pandas ``DataFrame`` by default, Python rows when - ``as_dataframe=False``, raw JSON when ``raw=True``, or raw page - payloads when multi-page fetching is used with ``raw=True``. + ``as_dataframe=False``, raw JSON when ``raw=True``. ``` -

major_contract_by_symbol

+

fund_share

-- 接口名称:重大合同按标的 +- 接口名称:基金份额 - HTTP:`GET` -- Path:`api/v1/market/data/corporate/contract/by-symbol` -- 参数:`symbol`, `page`, `page_size` -- 来源文档:`重大合同按标的.md` -- 原始接口:`major_contract_by_symbol` +- Path:`api/v1/market/data/fund/fund-share` +- 参数:`fund_code`, `stati_perd`, `start_date`, `end_date`, `page`, `page_size` +- 来源文档:`基金份额.md` +- 原始接口:`get_fund_share` ```text -重大合同按标的. +基金份额. -Endpoint: ``api/v1/market/data/corporate/contract/by-symbol``. +Endpoint: ``api/v1/market/data/fund/fund-share``. Method: ``GET``. -Documented endpoint: ``major_contract_by_symbol``. +Documented endpoint: ``get_fund_share``. Args: - symbol: 证券代码(标的) (type: string; required: Y). + fund_code: 基金代码 (type: string; required: Y). + stati_perd: 统计周期:日/季度/年度/截止时点/半年/全部,默认日 (type: string; required: N). + start_date: 开始日期 YYYYMMDD(按 trade_date 过滤) (type: int; required: N). + end_date: 结束日期 YYYYMMDD (type: int; required: N). page: Page number, starting from 1. If omitted, the server default is used unless ``limit`` or ``all_pages`` is set. page_size: Rows per page. The SDK validates this against the endpoint-specific maximum. limit: Maximum number of rows to return. The SDK may fetch multiple pages to satisfy this limit. @@ -5901,21 +4397,21 @@ Returns: payloads when multi-page fetching is used with ``raw=True``. ``` -

major_contract_summary

+

fund_support_symbols

-- 接口名称:重大合同汇总 +- 接口名称:基金支持标的 - HTTP:`GET` -- Path:`api/v1/market/data/corporate/contract/summary` +- Path:`api/v1/market/data/fund/fund-support-symbols` - 参数:`page`, `page_size` -- 来源文档:`重大合同汇总.md` -- 原始接口:`major_contract_summary` +- 来源文档:`基金支持标的.md` +- 原始接口:`get_fund_support_symbols` ```text -重大合同汇总. +基金支持标的. -Endpoint: ``api/v1/market/data/corporate/contract/summary``. +Endpoint: ``api/v1/market/data/fund/fund-support-symbols``. Method: ``GET``. -Documented endpoint: ``major_contract_summary``. +Documented endpoint: ``get_fund_support_symbols``. Args: page: Page number, starting from 1. If omitted, the server default is used unless ``limit`` or ``all_pages`` is set. @@ -5934,27 +4430,27 @@ Returns: payloads when multi-page fetching is used with ``raw=True``. ``` -

eastmoney_futures_strange

+### 期货数据 + +

china_futures_base_data

-- 接口名称:东方财富期货龙虎榜 +- 接口名称:中国期货基础数据 - HTTP:`GET` -- Path:`api/v1/market/data/eastmoney-futures-strange` -- 参数:`exchange`, `variety`, `contract`, `trade_date` -- 来源文档:`东方财富期货龙虎榜.md` -- 原始接口:`eastmoney_futures_strange` +- Path:`api/v1/market/data/futures/futures-base-data` +- 参数:`trade_date`, `symbol` +- 来源文档:`中国期货基础数据.md` +- 原始接口:`get_china_futures_base_data_handler` ```text -东方财富期货龙虎榜. +中国期货基础数据. -Endpoint: ``api/v1/market/data/eastmoney-futures-strange``. +Endpoint: ``api/v1/market/data/futures/futures-base-data``. Method: ``GET``. -Documented endpoint: ``eastmoney_futures_strange``. +Documented endpoint: ``get_china_futures_base_data_handler``. Args: - exchange: 交易所代码:``shfe``/``dce``/``czce``/``cffex``/``ine``/``gfe`` (type: string; required: Y). - variety: 品种名称,如 ``多晶硅`` (type: string; required: Y). - contract: 合约代码,如 ``ps2609`` (type: string; required: Y). - trade_date: 交易日,``YYYYMMDD`` (type: string; required: Y). + trade_date: 交易日 YYYYMMDD;不传则使用前一交易日(CST) (type: int; required: N). + symbol: WIND 合约全码如 A2605.DCE;大小写不敏感;不传或空表示该日全部 (type: string; required: N). raw: Return the decoded JSON payload without tabular extraction. fields: Optional field list or comma-separated field string applied after extraction. as_dataframe: Return a pandas ``DataFrame`` by default; set to ``False`` for Python rows. @@ -5966,28 +4462,24 @@ Returns: payloads when multi-page fetching is used with ``raw=True``. ``` -

futures_kline

+

china_futures_lists

-- 接口名称:期货合约K线 +- 接口名称:中国期货列表 - HTTP:`GET` -- Path:`api/v1/market/data/futures/kline` -- 参数:`symbol`, `interval`, `start`, `end`, `limit` -- 来源文档:`期货合约K线.md` -- 原始接口:`futures_contract_kline` +- Path:`api/v1/market/data/futures/futures-lists` +- 参数:`trade_date` +- 来源文档:`中国期货列表.md` +- 原始接口:`get_china_futures_lists_handler` ```text -期货合约K线. +中国期货列表. -Endpoint: ``api/v1/market/data/futures/kline``. +Endpoint: ``api/v1/market/data/futures/futures-lists``. Method: ``GET``. -Documented endpoint: ``futures_contract_kline``. +Documented endpoint: ``get_china_futures_lists_handler``. Args: - symbol: WIND 合约全码,如 A2605.DCE (type: string; required: Y). - interval: 周期,默认 1min;可选 1min/5min/15min/30min/60min/daily/weekly/monthly/quarterly/yearly (type: string; required: N). - start: 开始时间戳(毫秒);与 end 跨度 ≤3 天;仅 start 表示 [start,+∞) (type: int64; required: N). - end: 结束时间戳(毫秒,闭区间);须与 start 同时传入,禁止只传 end (type: int64; required: N). - limit: 最大返回条数,默认 500 (type: int; required: N). + trade_date: 交易日 YYYYMMDD;不传则使用前一交易日(CST) (type: int; required: N). raw: Return the decoded JSON payload without tabular extraction. fields: Optional field list or comma-separated field string applied after extraction. as_dataframe: Return a pandas ``DataFrame`` by default; set to ``False`` for Python rows. @@ -5999,28 +4491,30 @@ Returns: payloads when multi-page fetching is used with ``raw=True``. ``` -

futures_eod_price

+

eastmoney_futures_position

-- 接口名称:期货日终行情 +- 接口名称:东方财富期货持仓 - HTTP:`GET` -- Path:`api/v1/market/data/futures/eod-price` -- 参数:`exchange`, `symbol`, `trade_date`, `start_date`, `end_date`, `page`, `page_size` -- 来源文档:`期货日终行情.md` -- 原始接口:`futures_eod_price` +- Path:`api/v1/market/data/eastmoney-futures-position` +- 参数:`exchange`, `variety_code`, `contract_code`, `trade_date`, `start_date`, `end_date`, `member_name_abbr`, `page`, `page_size` +- 来源文档:`东方财富期货持仓.md` +- 原始接口:`get_eastmoney_futures_position` ```text -期货日终行情. +东方财富期货持仓. -Endpoint: ``api/v1/market/data/futures/eod-price``. +Endpoint: ``api/v1/market/data/eastmoney-futures-position``. Method: ``GET``. -Documented endpoint: ``futures_eod_price``. +Documented endpoint: ``get_eastmoney_futures_position``. Args: - exchange: 交易所代码,精确匹配 (type: string; required: N). - symbol: 合约代码,精确匹配 (type: string; required: N). - trade_date: 精确交易日,8 位 ``YYYYMMDD``;不可与 ``start_date``/``end_date`` 同时使用 (type: int; required: N). - start_date: 起始交易日,8 位 ``YYYYMMDD`` (type: int; required: N). - end_date: 结束交易日,8 位 ``YYYYMMDD``;与 ``start_date`` 同时提供时须 ``start_date`` ≤ ``end_date`` (type: int; required: N). + exchange: 交易所代码:shfe / dce / czce / cffex / ine / gfe (type: string; required: N). + variety_code: 品种代码,如 cu / au / al / IF (type: string; required: N). + contract_code: 合约代码,如 CU2607 / AU2608 (type: string; required: N). + trade_date: 交易日 YYYYMMDD;与 start_date/end_date 互斥 (type: string; required: N). + start_date: 区间起始日 YYYYMMDD;需与 end_date 同时提供 (type: string; required: N). + end_date: 区间结束日 YYYYMMDD;需与 start_date 同时提供 (type: string; required: N). + member_name_abbr: 会员简称 (type: string; required: N). page: Page number, starting from 1. If omitted, the server default is used unless ``limit`` or ``all_pages`` is set. page_size: Rows per page. The SDK validates this against the endpoint-specific maximum. limit: Maximum number of rows to return. The SDK may fetch multiple pages to satisfy this limit. @@ -6037,134 +4531,182 @@ Returns: payloads when multi-page fetching is used with ``raw=True``. ``` -

futures_kline_intraday

+

ft_limit

+ +- 接口名称:期货合约涨跌停价 +- HTTP:`GET` +- Path:`api/v1/market/data/futures/ft-limit` +- 参数:`ts_code`, `trade_date`, `start_date`, `end_date`, `cont`, `exchange`, `page`, `page_size` +- 来源文档:`期货合约涨跌停价.md` +- 原始接口:`ft_limit` + +```text +期货合约涨跌停价. +``` + +

fut_settle

+ +- 接口名称:期货每日结算参数 +- HTTP:`GET` +- Path:`api/v1/market/data/futures/fut-settle` +- 参数:`ts_code`, `trade_date`, `start_date`, `end_date`, `exchange`, `page`, `page_size` +- 来源文档:`期货每日结算参数.md` +- 原始接口:`fut_settle` + +```text +期货每日结算参数. +``` + +

fut_weekly_detail

+ +- 接口名称:期货主要品种交易周报 +- HTTP:`GET` +- Path:`api/v1/market/data/futures/fut-weekly-detail` +- 参数:`week`, `prd`, `start_week`, `end_week`, `exchange`, `page`, `page_size` +- 来源文档:`期货主要品种交易周报.md` +- 原始接口:`fut_weekly_detail` + +```text +期货主要品种交易周报. +``` + +

fut_wsr

+ +- 接口名称:期货仓单日报 +- HTTP:`GET` +- Path:`api/v1/market/data/futures/fut-wsr` +- 参数:`trade_date`, `start_date`, `end_date`, `symbol`, `exchange`, `page`, `page_size` +- 来源文档:`期货仓单日报.md` +- 原始接口:`fut_wsr` + +```text +期货仓单日报. +``` + +

futures_contract_kline

-- 接口名称:期货日内K线 +- 接口名称:期货行情 - HTTP:`GET` -- Path:`api/v1/market/data/futures/kline/intraday` +- Path:`api/v1/market/data/futures/kline` - 参数:`symbol`, `interval`, `start`, `end`, `limit` -- 来源文档:`期货日内K线.md` -- 原始接口:`futures_kline_intraday` +- 来源文档:`期货行情.md` +- 原始接口:`futures_contract_kline` ```text -期货日内K线. +期货行情. -Endpoint: ``api/v1/market/data/futures/kline/intraday``. +Endpoint: ``api/v1/market/data/futures/kline``. Method: ``GET``. -Documented endpoint: ``futures_kline_intraday``. +Documented endpoint: ``futures_contract_kline``. Args: - symbol: WIND 合约全码或表内合约代码 (type: string; required: Y). - interval: 当前仅支持 ``1min``,兼容 ``1m``,默认 ``1min`` (type: string; required: N). - start: 开始时间,毫秒时间戳,闭区间 (type: int64; required: N). - end: 结束时间,毫秒时间戳,闭区间;与 ``start`` 同时提供时跨度不得超过 3 天 (type: int64; required: N). - limit: 最大返回条数,默认 600,范围 1~1000 (type: int; required: N). + symbol: 期货合约代码 (type: string; required: Y). + interval: K线周期,默认 ``daily`` (type: string; required: N). + start: 起始时间戳,单位毫秒 (type: integer; required: N). + end: 结束时间戳,单位毫秒,不能单独传 (type: integer; required: N). + limit: 返回条数上限,0 按 1 处理 (type: integer; required: N). raw: Return the decoded JSON payload without tabular extraction. fields: Optional field list or comma-separated field string applied after extraction. as_dataframe: Return a pandas ``DataFrame`` by default; set to ``False`` for Python rows. - **kwargs: Extra request parameters forwarded unchanged. Useful when the service adds parameters before the SDK is regenerated. + **kwargs: Extra request parameters forwarded unchanged. Returns: A pandas ``DataFrame`` by default, Python rows when - ``as_dataframe=False``, raw JSON when ``raw=True``, or raw page - payloads when multi-page fetching is used with ``raw=True``. + ``as_dataframe=False``, or raw JSON when ``raw=True``. ``` -

futures_kline_latest

+

futures_minutes

-- 接口名称:期货最新K线 +- 接口名称:期货历史分钟行情 - HTTP:`GET` -- Path:`api/v1/market/data/futures/kline/latest` -- 参数:`symbol`, `interval` -- 来源文档:`期货最新K线.md` -- 原始接口:`futures_kline_latest` +- Path:`api/v3/market/data/futures_minutes` +- 参数:`symbol`, `interval`, `start`, `end`, `limit` +- 来源文档:`期货历史分钟行情.md` +- 原始接口:`futures_minutes` ```text -期货最新K线. +期货历史分钟行情. -Endpoint: ``api/v1/market/data/futures/kline/latest``. +Endpoint: ``api/v3/market/data/futures_minutes``. Method: ``GET``. -Documented endpoint: ``futures_kline_latest``. +Documented endpoint: ``futures_minutes``. Args: - symbol: WIND 合约全码(如 ``A2605.DCE``)或表内合约代码(如 ``a2605``) (type: string; required: Y). - interval: 当前仅支持 ``1min``,兼容 ``1m``,默认 ``1min`` (type: string; required: N). + symbol: 期货合约代码,带交易所短后缀 (type: string; required: Y). + interval: 分钟周期,默认 ``1min`` (type: string; required: N). + start: 起始时间戳,单位毫秒 (type: integer; required: N). + end: 结束时间戳,单位毫秒,不能单独传 (type: integer; required: N). + limit: 返回条数上限,范围 1~1000 (type: integer; required: N). raw: Return the decoded JSON payload without tabular extraction. fields: Optional field list or comma-separated field string applied after extraction. as_dataframe: Return a pandas ``DataFrame`` by default; set to ``False`` for Python rows. - **kwargs: Extra request parameters forwarded unchanged. Useful when the service adds parameters before the SDK is regenerated. + **kwargs: Extra request parameters forwarded unchanged. Returns: A pandas ``DataFrame`` by default, Python rows when - ``as_dataframe=False``, raw JSON when ``raw=True``, or raw page - payloads when multi-page fetching is used with ``raw=True``. + ``as_dataframe=False``, or raw JSON when ``raw=True``. ``` -

member_build_process

+

futures_minutes_realtime

-- 接口名称:会员建仓过程 +- 接口名称:期货实时分钟K线 - HTTP:`GET` -- Path:`api/v1/market/data/member-build-process` -- 参数:`exchange`, `member_name`, `instrument_id`, `start_date`, `end_date`, `contract_multiplier`, `page`, `page_size` -- 来源文档:`会员建仓过程.md` -- 原始接口:`member_build_process` +- Path:`api/v4/market/data/futures_minutes/realtime` +- 参数:`symbols` +- 来源文档:`期货实时分钟K线.md` +- 原始接口:`futures_minutes_realtime` ```text -会员建仓过程. +期货实时分钟K线. -Endpoint: ``api/v1/market/data/member-build-process``. +Endpoint: ``api/v4/market/data/futures_minutes/realtime``. Method: ``GET``. -Documented endpoint: ``member_build_process``. +Documented endpoint: ``futures_minutes_realtime``. Args: - exchange: 交易所代码,如 ``SHFE``、``DCE``、``CZCE`` (type: string; required: Y). - member_name: 会员名称 (type: string; required: Y). - instrument_id: 合约代码,如 ``rb2601`` (type: string; required: Y). - start_date: 起始日期,``YYYYMMDD`` 或 ``YYYY-MM-DD``,默认 ``20260101`` (type: string; required: N). - end_date: 结束日期,``YYYYMMDD`` 或 ``YYYY-MM-DD``,默认当天 (type: string; required: N). - contract_multiplier: 合约乘数;不传时按品种默认表推导 (type: float; required: N). - page: Page number, starting from 1. If omitted, the server default is used unless ``limit`` or ``all_pages`` is set. - page_size: Rows per page. The SDK validates this against the endpoint-specific maximum. - limit: Maximum number of rows to return. The SDK may fetch multiple pages to satisfy this limit. - all_pages: Fetch and combine pages until the server reports the last page. - max_pages: Optional safety cap for ``all_pages``. + symbols: 期货合约代码列表,1~20 个 (type: array; required: Y). raw: Return the decoded JSON payload without tabular extraction. fields: Optional field list or comma-separated field string applied after extraction. as_dataframe: Return a pandas ``DataFrame`` by default; set to ``False`` for Python rows. - **kwargs: Extra request parameters forwarded unchanged. Useful when the service adds parameters before the SDK is regenerated. + **kwargs: Extra request parameters forwarded unchanged. Returns: A pandas ``DataFrame`` by default, Python rows when - ``as_dataframe=False``, raw JSON when ``raw=True``, or raw page - payloads when multi-page fetching is used with ``raw=True``. + ``as_dataframe=False``, or raw JSON when ``raw=True``. ``` -

member_position_ranking

+

futures_nanhua_index_kline

-- 接口名称:会员持仓排名 +- 接口名称:南华期货指数日K线 +- HTTP:`GET` +- Path:`api/v1/market/data/futures/nanhua-index-kline` +- 参数:`code`, `trade_date`, `start_date`, `end_date`, `page`, `page_size` +- 来源文档:`南华期货指数日K线.md` +- 原始接口:`futures_nanhua_index_kline` + +```text +南华期货指数日K线. +``` + +

major_contract

+ +- 接口名称:重大合同 - HTTP:`GET` -- Path:`api/v1/market/data/member-position-ranking` -- 参数:`exchange`, `instrument_id`, `trade_date`, `direction`, `page`, `page_size` -- 来源文档:`会员持仓排名.md` -- 原始接口:`member_position_ranking` +- Path:`api/v1/market/data/corporate/contract` +- 参数:`start_date`, `end_date` +- 来源文档:`重大合同.md` +- 原始接口:`major_contract` ```text -会员持仓排名. +重大合同. -Endpoint: ``api/v1/market/data/member-position-ranking``. +Endpoint: ``api/v1/market/data/corporate/contract``. Method: ``GET``. -Documented endpoint: ``member_position_ranking``. +Documented endpoint: ``major_contract``. Args: - exchange: 交易所代码,如 ``SHFE``、``DCE``、``CZCE`` (type: string; required: Y). - instrument_id: 合约代码,如 ``a2605`` (type: string; required: Y). - trade_date: 交易日,``YYYYMMDD`` 或 ``YYYY-MM-DD`` (type: string; required: Y). - direction: 查询方向:``long`` 或 ``short``,也接受常见中文和缩写别名 (type: string; required: Y). - page: Page number, starting from 1. If omitted, the server default is used unless ``limit`` or ``all_pages`` is set. - page_size: Rows per page. The SDK validates this against the endpoint-specific maximum. - limit: Maximum number of rows to return. The SDK may fetch multiple pages to satisfy this limit. - all_pages: Fetch and combine pages until the server reports the last page. - max_pages: Optional safety cap for ``all_pages``. + start_date: 起始日期(YYYYMMDD),区间跨度 ≤ 3 天 (type: string; required: Y). + end_date: 结束日期(YYYYMMDD),区间跨度 ≤ 3 天 (type: string; required: Y). raw: Return the decoded JSON payload without tabular extraction. fields: Optional field list or comma-separated field string applied after extraction. as_dataframe: Return a pandas ``DataFrame`` by default; set to ``False`` for Python rows. @@ -6176,26 +4718,29 @@ Returns: payloads when multi-page fetching is used with ``raw=True``. ``` -### 债券专题 - -

cb_base_data

+

major_contract_by_symbol

-- 接口名称:可转债基础数据 +- 接口名称:重大合同按标的 - HTTP:`GET` -- Path:`api/v1/market/data/cb/cb-base-data` -- 参数:`symbol_code` -- 来源文档:`可转债基础数据.md` -- 原始接口:`get_cb_base_data_handler` +- Path:`api/v1/market/data/corporate/contract/by-symbol` +- 参数:`symbol`, `page`, `page_size` +- 来源文档:`重大合同按标的.md` +- 原始接口:`major_contract_by_symbol` ```text -可转债基础数据. +重大合同按标的. -Endpoint: ``api/v1/market/data/cb/cb-base-data``. +Endpoint: ``api/v1/market/data/corporate/contract/by-symbol``. Method: ``GET``. -Documented endpoint: ``get_cb_base_data_handler``. +Documented endpoint: ``major_contract_by_symbol``. Args: - symbol_code: 转债代码 (type: string; required: Y). + symbol: 证券代码(标的) (type: string; required: Y). + page: Page number, starting from 1. If omitted, the server default is used unless ``limit`` or ``all_pages`` is set. + page_size: Rows per page. The SDK validates this against the endpoint-specific maximum. + limit: Maximum number of rows to return. The SDK may fetch multiple pages to satisfy this limit. + all_pages: Fetch and combine pages until the server reports the last page. + max_pages: Optional safety cap for ``all_pages``. raw: Return the decoded JSON payload without tabular extraction. fields: Optional field list or comma-separated field string applied after extraction. as_dataframe: Return a pandas ``DataFrame`` by default; set to ``False`` for Python rows. @@ -6207,23 +4752,28 @@ Returns: payloads when multi-page fetching is used with ``raw=True``. ``` -

cb_lists

+

major_contract_summary

-- 接口名称:可转债列表 +- 接口名称:重大合同汇总 - HTTP:`GET` -- Path:`api/v1/market/data/cb/cb-lists` -- 参数:- -- 来源文档:`可转债列表.md` -- 原始接口:`get_cb_lists_handler` +- Path:`api/v1/market/data/corporate/contract/summary` +- 参数:`page`, `page_size` +- 来源文档:`重大合同汇总.md` +- 原始接口:`major_contract_summary` ```text -可转债列表. +重大合同汇总. -Endpoint: ``api/v1/market/data/cb/cb-lists``. +Endpoint: ``api/v1/market/data/corporate/contract/summary``. Method: ``GET``. -Documented endpoint: ``get_cb_lists_handler``. +Documented endpoint: ``major_contract_summary``. Args: + page: Page number, starting from 1. If omitted, the server default is used unless ``limit`` or ``all_pages`` is set. + page_size: Rows per page. The SDK validates this against the endpoint-specific maximum. + limit: Maximum number of rows to return. The SDK may fetch multiple pages to satisfy this limit. + all_pages: Fetch and combine pages until the server reports the last page. + max_pages: Optional safety cap for ``all_pages``. raw: Return the decoded JSON payload without tabular extraction. fields: Optional field list or comma-separated field string applied after extraction. as_dataframe: Return a pandas ``DataFrame`` by default; set to ``False`` for Python rows. @@ -6235,10 +4785,12 @@ Returns: payloads when multi-page fetching is used with ``raw=True``. ``` +### 债券专题 +

convertible_bond_candlesticks

- 接口名称:可转债K线 -- HTTP:`POST` +- HTTP:`GET` - Path:`api/v1/market/data/convertible-bond-candlesticks` - 参数:`symbol`, `interval_unit`, `interval_value`, `adjust_kind`, `since_ts_millis`, `until_ts_millis`, `limit` - 来源文档:`可转债K线.md` @@ -6248,7 +4800,7 @@ Returns: 可转债K线. Endpoint: ``api/v1/market/data/convertible-bond-candlesticks``. -Method: ``POST``. +Method: ``GET``. Documented endpoint: ``convertible_bond_candlesticks``. Args: @@ -6270,39 +4822,56 @@ Returns: payloads when multi-page fetching is used with ``raw=True``. ``` -

convertible_bond_candlesticks_batch

+

szse_convertible_bond_declaration_snapshots

-- 接口名称:批量可转债K线 -- HTTP:`POST` -- Path:`api/v1/market/data/convertible-bond-candlesticks/batch` -- 参数:`symbols`, `interval_unit`, `interval_value`, `adjust_kind`, `since_ts_millis`, `until_ts_millis`, `limit` -- 来源文档:`批量可转债K线.md` -- 原始接口:`convertible_bond_candlesticks_batch` +- 接口名称:深交所可转债申报快照 +- HTTP:`GET` +- Path:`api/v1/market/data/convertible-bond/szse/declaration-snapshots` +- 参数:`security_code`, `trade_date`, `start_date`, `end_date`, `page`, `page_size` +- 来源文档:`深交所可转债申报快照.md` +- 原始接口:`szse_convertible_bond_declaration_snapshots` ```text -批量可转债K线. +深交所可转债申报快照. +``` -Endpoint: ``api/v1/market/data/convertible-bond-candlesticks/batch``. -Method: ``POST``. -Documented endpoint: ``convertible_bond_candlesticks_batch``. +

szse_convertible_bond_directed_trades

-Args: - symbols: 可转债代码列表,如 ["113027.XSHG","128048.XSHE"];也接受 .SH、.SZ 短后缀 (type: string[]; required: Y). - interval_unit: 周期单位:Minute/Day/Week/Month/Year (type: enum; required: Y). - interval_value: 间隔数值,默认 1;例如 Minute+5 表示 5 分钟 K 线 (type: int; required: N). - adjust_kind: 复权:None(默认,不复权)/Forward(前复权)/Backward(后复权) (type: enum; required: N). - since_ts_millis: 开始时间戳,单位毫秒;分钟 K 线与 until 的跨度 ≤3 天 (type: int(ms); required: N). - until_ts_millis: 结束时间戳,单位毫秒 (type: int(ms); required: Y). - limit: 每个标的的返回条数上限;未传 since 和 limit 时默认最多返回 50 根 K 线 (type: int; required: N). - raw: Return the decoded JSON payload without tabular extraction. - fields: Optional field list or comma-separated field string applied after extraction. - as_dataframe: Return a pandas ``DataFrame`` by default; set to ``False`` for Python rows. - **kwargs: Extra request parameters forwarded unchanged. Useful when the service adds parameters before the SDK is regenerated. +- 接口名称:深交所可转债定向成交 +- HTTP:`GET` +- Path:`api/v1/market/data/convertible-bond/szse/directed-trades` +- 参数:`security_code`, `trade_date`, `start_date`, `end_date`, `page`, `page_size` +- 来源文档:`深交所可转债定向成交.md` +- 原始接口:`szse_convertible_bond_directed_trades` -Returns: - A pandas ``DataFrame`` by default, Python rows when - ``as_dataframe=False``, raw JSON when ``raw=True``, or raw page - payloads when multi-page fetching is used with ``raw=True``. +```text +深交所可转债定向成交. +``` + +

szse_convertible_bond_matching_trades

+ +- 接口名称:深交所可转债匹配成交 +- HTTP:`GET` +- Path:`api/v1/market/data/convertible-bond/szse/matching-trades` +- 参数:`security_code`, `trade_date`, `start_date`, `end_date`, `page`, `page_size` +- 来源文档:`深交所可转债匹配成交.md` +- 原始接口:`szse_convertible_bond_matching_trades` + +```text +深交所可转债匹配成交. +``` + +

szse_convertible_bond_negotiated_trades

+ +- 接口名称:深交所可转债协议成交 +- HTTP:`GET` +- Path:`api/v1/market/data/convertible-bond/szse/negotiated-trades` +- 参数:`security_code`, `trade_date`, `start_date`, `end_date`, `page`, `page_size` +- 来源文档:`深交所可转债协议成交.md` +- 原始接口:`szse_convertible_bond_negotiated_trades` + +```text +深交所可转债协议成交. ``` ### 宏观经济 @@ -6343,12 +4912,25 @@ Returns: payloads when multi-page fetching is used with ``raw=True``. ``` +

chinabond_yield_daily

+ +- 接口名称:中债收益率曲线日度 +- HTTP:`GET` +- Path:`api/v1/market/data/chinabond-yield-daily` +- 参数:`start_date`, `end_date`, `curve_name`, `page`, `page_size` +- 来源文档:`中债收益率曲线日度.md` +- 原始接口:`chinabond_yield_daily` + +```text +中债收益率曲线日度. +``` +

consumer_credit_monthly

- 接口名称:社融信贷 - HTTP:`GET` - Path:`api/v1/market/data/economic/china-credit-loans` -- 参数:- +- 参数:`page`, `page_size` - 来源文档:`社融信贷.md` - 原始接口:`consumer_credit_monthly` @@ -6516,7 +5098,7 @@ Returns: - 接口名称:货币供应 - HTTP:`GET` - Path:`api/v1/market/data/economic/china-money-supply` -- 参数:- +- 参数:`page`, `page_size` - 来源文档:`货币供应.md` - 原始接口:`consumer_money_supply_monthly` @@ -6544,7 +5126,7 @@ Returns: - 接口名称:PMI - HTTP:`GET` - Path:`api/v1/market/data/economic/china-pmi` -- 参数:- +- 参数:`page`, `page_size` - 来源文档:`PMI.md` - 原始接口:`consumer_pmi_monthly` @@ -6572,7 +5154,7 @@ Returns: - 接口名称:PPI - HTTP:`GET` - Path:`api/v1/market/data/economic/china-ppi` -- 参数:- +- 参数:`page`, `page_size` - 来源文档:`PPI.md` - 原始接口:`consumer_ppi_monthly` @@ -6600,7 +5182,7 @@ Returns: - 接口名称:CPI - HTTP:`GET` - Path:`api/v1/market/data/economic/china-cpi` -- 参数:- +- 参数:`page`, `page_size` - 来源文档:`CPI.md` - 原始接口:`consumer_price_index_monthly` @@ -6651,6 +5233,32 @@ Returns: payloads when multi-page fetching is used with ``raw=True``. ``` +

hibor_daily

+ +- 接口名称:HIBOR日度利率 +- HTTP:`GET` +- Path:`api/v1/market/data/hibor-daily` +- 参数:`start_date`, `end_date`, `page`, `page_size` +- 来源文档:`HIBOR日度利率.md` +- 原始接口:`hibor_daily` + +```text +HIBOR日度利率. +``` + +

libor_daily

+ +- 接口名称:国际基准利率日度 +- HTTP:`GET` +- Path:`api/v1/market/data/libor-daily` +- 参数:`start_date`, `end_date`, `currency`, `tenor`, `page`, `page_size` +- 来源文档:`国际基准利率日度.md` +- 原始接口:`libor_daily` + +```text +国际基准利率日度. +``` +

lpr_monthly

- 接口名称:LPR @@ -6707,6 +5315,32 @@ Returns: payloads when multi-page fetching is used with ``raw=True``. ``` +

shibor_daily

+ +- 接口名称:SHIBOR日度利率 +- HTTP:`GET` +- Path:`api/v1/market/data/shibor-daily` +- 参数:`start_date`, `end_date`, `page`, `page_size` +- 来源文档:`SHIBOR日度利率.md` +- 原始接口:`shibor_daily` + +```text +SHIBOR日度利率. +``` + +

shibor_quote_daily

+ +- 接口名称:SHIBOR报价日度 +- HTTP:`GET` +- Path:`api/v1/market/data/shibor-quote-daily` +- 参数:`start_date`, `end_date`, `bank`, `page`, `page_size` +- 来源文档:`SHIBOR报价日度.md` +- 原始接口:`shibor_quote_daily` + +```text +SHIBOR报价日度. +``` +

tax_revenue_monthly

- 接口名称:税收 @@ -6799,13 +5433,26 @@ Returns: payloads when multi-page fetching is used with ``raw=True``. ``` +

wz_index_daily

+ +- 接口名称:温州民间融资综合利率指数日度 +- HTTP:`GET` +- Path:`api/v1/market/data/wz-index-daily` +- 参数:`start_date`, `end_date`, `page`, `page_size` +- 来源文档:`温州民间融资综合利率指数日度.md` +- 原始接口:`wz_index_daily` + +```text +温州民间融资综合利率指数日度. +``` + ### 大模型语料

semantic_search_news

- 接口名称:新闻语义搜索 - HTTP:`GET` -- Path:`api/v1/market/data/semantic-search-news` +- Path:`api/v3/market/data/semantic-search-news` - 参数:`query`, `limit`, `year`, `start_time`, `end_time` - 来源文档:`新闻语义搜索.md` - 原始接口:`semantic_search_news_handler` @@ -6871,7 +5518,7 @@ Returns: - 接口名称:公告列表 - HTTP:`GET` -- Path:`api/v1/market/data/announcements/stock-announcements` +- Path:`api/v3/market/data/announcements/stock-announcements` - 参数:`stock_code`, `start_date`, `end_date`, `type`, `page`, `page_size` - 来源文档:`公告列表.md` - 原始接口:`stock_announcements` @@ -6879,7 +5526,7 @@ Returns: ```text 公告列表. -Endpoint: ``api/v1/market/data/announcements/stock-announcements``. +Endpoint: ``api/v3/market/data/announcements/stock-announcements``. Method: ``GET``. Documented endpoint: ``stock_announcements``. @@ -6908,7 +5555,7 @@ Returns: - 接口名称:研报列表 - HTTP:`GET` -- Path:`api/v1/market/data/report/stock-reports` +- Path:`api/v3/market/data/report/stock-reports` - 参数:`stock_code`, `start_date`, `end_date`, `type`, `page`, `page_size` - 来源文档:`研报列表.md` - 原始接口:`stock_reports` @@ -6916,7 +5563,7 @@ Returns: ```text 研报列表. -Endpoint: ``api/v1/market/data/report/stock-reports``. +Endpoint: ``api/v3/market/data/report/stock-reports``. Method: ``GET``. Documented endpoint: ``stock_reports``. @@ -6941,42 +5588,6 @@ Returns: payloads when multi-page fetching is used with ``raw=True``. ``` -

type_reports

- -- 接口名称:研报分类 -- HTTP:`GET` -- Path:`api/v1/market/data/report/type-reports` -- 参数:`rept_type`, `start_date`, `end_date`, `page`, `page_size` -- 来源文档:`研报分类.md` -- 原始接口:`type_reports` - -```text -研报分类. - -Endpoint: ``api/v1/market/data/report/type-reports``. -Method: ``GET``. -Documented endpoint: ``type_reports``. - -Args: - rept_type: 研报类型:MacroReport / IndustryReport / BrokerMorningReport / StrategyReport / NewStockReport (type: string; required: Y). - start_date: 开始日期 YYYYMMDD (type: string; required: Y). - end_date: 结束日期 YYYYMMDD,不填默认与 `start_date` 相同 (type: string; required: N). - page: Page number, starting from 1. If omitted, the server default is used unless ``limit`` or ``all_pages`` is set. - page_size: Rows per page. The SDK validates this against the endpoint-specific maximum. - limit: Maximum number of rows to return. The SDK may fetch multiple pages to satisfy this limit. - all_pages: Fetch and combine pages until the server reports the last page. - max_pages: Optional safety cap for ``all_pages``. - raw: Return the decoded JSON payload without tabular extraction. - fields: Optional field list or comma-separated field string applied after extraction. - as_dataframe: Return a pandas ``DataFrame`` by default; set to ``False`` for Python rows. - **kwargs: Extra request parameters forwarded unchanged. Useful when the service adds parameters before the SDK is regenerated. - -Returns: - A pandas ``DataFrame`` by default, Python rows when - ``as_dataframe=False``, raw JSON when ``raw=True``, or raw page - payloads when multi-page fetching is used with ``raw=True``. -``` - ### 现货数据

bullion_price

@@ -7014,188 +5625,3 @@ Returns: ``as_dataframe=False``, raw JSON when ``raw=True``, or raw page payloads when multi-page fetching is used with ``raw=True``. ``` - -

bullion_support_symbol

- -- 接口名称:贵金属支持标的 -- HTTP:`GET` -- Path:`api/v1/market/data/bullion/support-symbol` -- 参数:- -- 来源文档:`贵金属支持标的.md` -- 原始接口:`get_bullion_support_symbol` - -```text -贵金属支持标的. - -Endpoint: ``api/v1/market/data/bullion/support-symbol``. -Method: ``GET``. -Documented endpoint: ``get_bullion_support_symbol``. - -Args: - raw: Return the decoded JSON payload without tabular extraction. - fields: Optional field list or comma-separated field string applied after extraction. - as_dataframe: Return a pandas ``DataFrame`` by default; set to ``False`` for Python rows. - **kwargs: Extra request parameters forwarded unchanged. Useful when the service adds parameters before the SDK is regenerated. - -Returns: - A pandas ``DataFrame`` by default, Python rows when - ``as_dataframe=False``, raw JSON when ``raw=True``, or raw page - payloads when multi-page fetching is used with ``raw=True``. -``` - -### 外汇数据 - -

consumer_forex_gold_monthly

- -- 接口名称:外汇黄金 -- HTTP:`GET` -- Path:`api/v1/market/data/economic/china-forex-gold` -- 参数:- -- 来源文档:`外汇黄金.md` -- 原始接口:`consumer_forex_gold_monthly` - -```text -外汇黄金. - -Endpoint: ``api/v1/market/data/economic/china-forex-gold``. -Method: ``GET``. -Documented endpoint: ``consumer_forex_gold_monthly``. - -Args: - raw: Return the decoded JSON payload without tabular extraction. - fields: Optional field list or comma-separated field string applied after extraction. - as_dataframe: Return a pandas ``DataFrame`` by default; set to ``False`` for Python rows. - **kwargs: Extra request parameters forwarded unchanged. Useful when the service adds parameters before the SDK is regenerated. - -Returns: - A pandas ``DataFrame`` by default, Python rows when - ``as_dataframe=False``, raw JSON when ``raw=True``, or raw page - payloads when multi-page fetching is used with ``raw=True``. -``` - -### 未发布 - -

stock_dividends_paginated

- -- 接口名称:股票分红记录分页 -- HTTP:`GET` -- Path:`api/v1/market/data/dividends` -- 参数:`page`, `page_size` -- 来源文档:`股票分红记录分页.md` -- 原始接口:`stock_dividends_paginated` - -```text -股票分红记录分页. - -Endpoint: ``api/v1/market/data/dividends``. -Method: ``GET``. -Documented endpoint: ``stock_dividends_paginated``. - -Args: - page: Page number, starting from 1. If omitted, the server default is used unless ``limit`` or ``all_pages`` is set. - page_size: Rows per page. The SDK validates this against the endpoint-specific maximum. - limit: Maximum number of rows to return. The SDK may fetch multiple pages to satisfy this limit. - all_pages: Fetch and combine pages until the server reports the last page. - max_pages: Optional safety cap for ``all_pages``. - raw: Return the decoded JSON payload without tabular extraction. - fields: Optional field list or comma-separated field string applied after extraction. - as_dataframe: Return a pandas ``DataFrame`` by default; set to ``False`` for Python rows. - **kwargs: Extra request parameters forwarded unchanged. Useful when the service adds parameters before the SDK is regenerated. - -Returns: - A pandas ``DataFrame`` by default, Python rows when - ``as_dataframe=False``, raw JSON when ``raw=True``, or raw page - payloads when multi-page fetching is used with ``raw=True``. -``` - -

stock_intraday

- -- 接口名称:股票日内分时 -- HTTP:`GET` -- Path:`api/v1/market/security/{symbol}/intraday` -- 参数:`symbol` -- 来源文档:`股票日内分时.md` -- 原始接口:`stock_intraday` - -```text -股票日内分时. - -Endpoint: ``api/v1/market/security/{symbol}/intraday``. -Method: ``GET``. -Documented endpoint: ``stock_intraday``. - -Args: - symbol: 标的代码 (type: SymbolKey; required: Y). - raw: Return the decoded JSON payload without tabular extraction. - fields: Optional field list or comma-separated field string applied after extraction. - as_dataframe: Return a pandas ``DataFrame`` by default; set to ``False`` for Python rows. - **kwargs: Extra request parameters forwarded unchanged. Useful when the service adds parameters before the SDK is regenerated. - -Returns: - A pandas ``DataFrame`` by default, Python rows when - ``as_dataframe=False``, raw JSON when ``raw=True``, or raw page - payloads when multi-page fetching is used with ``raw=True``. -``` - -

stock_ipos_paginated

- -- 接口名称:股票IPO分页 -- HTTP:`GET` -- Path:`api/v1/market/data/stock-ipos` -- 参数:`page`, `page_size` -- 来源文档:`股票IPO分页.md` -- 原始接口:`stock_ipos_paginated` - -```text -股票IPO分页. - -Endpoint: ``api/v1/market/data/stock-ipos``. -Method: ``GET``. -Documented endpoint: ``stock_ipos_paginated``. - -Args: - page: Page number, starting from 1. If omitted, the server default is used unless ``limit`` or ``all_pages`` is set. - page_size: Rows per page. The SDK validates this against the endpoint-specific maximum. - limit: Maximum number of rows to return. The SDK may fetch multiple pages to satisfy this limit. - all_pages: Fetch and combine pages until the server reports the last page. - max_pages: Optional safety cap for ``all_pages``. - raw: Return the decoded JSON payload without tabular extraction. - fields: Optional field list or comma-separated field string applied after extraction. - as_dataframe: Return a pandas ``DataFrame`` by default; set to ``False`` for Python rows. - **kwargs: Extra request parameters forwarded unchanged. Useful when the service adds parameters before the SDK is regenerated. - -Returns: - A pandas ``DataFrame`` by default, Python rows when - ``as_dataframe=False``, raw JSON when ``raw=True``, or raw page - payloads when multi-page fetching is used with ``raw=True``. -``` - - - -- 接口名称:相关股票 -- HTTP:`GET` -- Path:`api/v1/market/security/{symbol}/related` -- 参数:`symbol`, `limit` -- 来源文档:`相关股票.md` -- 原始接口:`stock_related` - -```text -相关股票. - -Endpoint: ``api/v1/market/security/{symbol}/related``. -Method: ``GET``. -Documented endpoint: ``stock_related``. - -Args: - symbol: 标的代码 (type: SymbolKey; required: Y). - limit: 返回数量上限,服务端默认 3 (type: int; required: N). - raw: Return the decoded JSON payload without tabular extraction. - fields: Optional field list or comma-separated field string applied after extraction. - as_dataframe: Return a pandas ``DataFrame`` by default; set to ``False`` for Python rows. - **kwargs: Extra request parameters forwarded unchanged. Useful when the service adds parameters before the SDK is regenerated. - -Returns: - A pandas ``DataFrame`` by default, Python rows when - ``as_dataframe=False``, raw JSON when ``raw=True``, or raw page - payloads when multi-page fetching is used with ``raw=True``. -``` diff --git a/pyproject.toml b/pyproject.toml index d971759..8093a4e 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -4,7 +4,7 @@ build-backend = "hatchling.build" [project] name = "ftshare" -version = "0.1.1" +version = "1.0.0" description = "Python SDK for FTShare market data APIs." readme = "README.md" requires-python = ">=3.9" diff --git a/src/ftshare/__init__.py b/src/ftshare/__init__.py index efde0ad..c78693c 100644 --- a/src/ftshare/__init__.py +++ b/src/ftshare/__init__.py @@ -61,6 +61,7 @@ def market_api( base_url: str | None = None, timeout: float = 10, headers: Mapping[str, str] | None = None, + api_key: str | None = None, ) -> FtshareClient: """Create a synchronous FTShare market data API client. @@ -69,11 +70,18 @@ def market_api( package-level ``BASE_URL`` is used. timeout: Request timeout in seconds. headers: Optional headers applied to every request from this client. + api_key: Optional FTShare API key. Defaults to the ``FTSHARE_API_KEY`` + environment variable. Returns: A configured ``FtshareClient`` instance. """ - return _client.market_api(base_url=base_url or BASE_URL, timeout=timeout, headers=headers) + return _client.market_api( + base_url=base_url or BASE_URL, + timeout=timeout, + headers=headers, + api_key=api_key, + ) __all__ = [ diff --git a/src/ftshare/apis/__init__.py b/src/ftshare/apis/__init__.py index 838e19c..fe44466 100644 --- a/src/ftshare/apis/__init__.py +++ b/src/ftshare/apis/__init__.py @@ -12,7 +12,6 @@ from .llm_corpus import LlmCorpusApiMixin from .spot import SpotApiMixin from .forex import ForexApiMixin -from .unpublished import UnpublishedApiMixin __all__ = [ 'StockApiMixin', @@ -27,5 +26,4 @@ 'LlmCorpusApiMixin', 'SpotApiMixin', 'ForexApiMixin', - 'UnpublishedApiMixin', ] diff --git a/src/ftshare/apis/bond.py b/src/ftshare/apis/bond.py index 13ce1b6..373c839 100644 --- a/src/ftshare/apis/bond.py +++ b/src/ftshare/apis/bond.py @@ -11,78 +11,6 @@ class BondApiMixin: """Endpoint methods for the bond ftshare-doc topic.""" - def cb_base_data( - self, - symbol_code: Any | None = None, - *, - raw: bool = False, - fields: Sequence[str] | str | None = None, - as_dataframe: bool = True, - **kwargs: Any, - ) -> Any: - """可转债基础数据. - - Endpoint: ``api/v1/market/data/cb/cb-base-data``. - Method: ``GET``. - Documented endpoint: ``get_cb_base_data_handler``. - - Args: - symbol_code: 转债代码 (type: string; required: Y). - raw: Return the decoded JSON payload without tabular extraction. - fields: Optional field list or comma-separated field string applied after extraction. - as_dataframe: Return a pandas ``DataFrame`` by default; set to ``False`` for Python rows. - **kwargs: Extra request parameters forwarded unchanged. Useful when the service adds parameters before the SDK is regenerated. - - Returns: - A pandas ``DataFrame`` by default, Python rows when - ``as_dataframe=False``, raw JSON when ``raw=True``, or raw page - payloads when multi-page fetching is used with ``raw=True``. - """ - request_params = {'symbol_code': symbol_code} - request_params.update(kwargs) - return self._call_endpoint( - 'cb_base_data', - raw=raw, - fields=fields, - as_dataframe=as_dataframe, - **request_params, - ) - - def cb_lists( - self, - *, - raw: bool = False, - fields: Sequence[str] | str | None = None, - as_dataframe: bool = True, - **kwargs: Any, - ) -> Any: - """可转债列表. - - Endpoint: ``api/v1/market/data/cb/cb-lists``. - Method: ``GET``. - Documented endpoint: ``get_cb_lists_handler``. - - Args: - raw: Return the decoded JSON payload without tabular extraction. - fields: Optional field list or comma-separated field string applied after extraction. - as_dataframe: Return a pandas ``DataFrame`` by default; set to ``False`` for Python rows. - **kwargs: Extra request parameters forwarded unchanged. Useful when the service adds parameters before the SDK is regenerated. - - Returns: - A pandas ``DataFrame`` by default, Python rows when - ``as_dataframe=False``, raw JSON when ``raw=True``, or raw page - payloads when multi-page fetching is used with ``raw=True``. - """ - request_params = {} - request_params.update(kwargs) - return self._call_endpoint( - 'cb_lists', - raw=raw, - fields=fields, - as_dataframe=as_dataframe, - **request_params, - ) - def convertible_bond_candlesticks( self, symbol: Any | None = None, @@ -101,7 +29,7 @@ def convertible_bond_candlesticks( """可转债K线. Endpoint: ``api/v1/market/data/convertible-bond-candlesticks``. - Method: ``POST``. + Method: ``GET``. Documented endpoint: ``convertible_bond_candlesticks``. Args: @@ -131,52 +59,29 @@ def convertible_bond_candlesticks( as_dataframe=as_dataframe, **request_params, ) + def szse_convertible_bond_matching_trades(self, security_code: Any | None = None, trade_date: Any | None = None, start_date: Any | None = None, end_date: Any | None = None, page: int | None = None, page_size: int | None = None, *, raw: bool = False, fields: Sequence[str] | str | None = None, as_dataframe: bool = True, **kwargs: Any) -> Any: + """深交所可转债匹配成交.""" + params = {'security_code': security_code, 'trade_date': trade_date, 'start_date': start_date, 'end_date': end_date, 'page': page, 'page_size': page_size} + params.update(kwargs) + return self._call_endpoint('szse_convertible_bond_matching_trades', raw=raw, fields=fields, as_dataframe=as_dataframe, **params) - def convertible_bond_candlesticks_batch( - self, - symbols: Any | None = None, - interval_unit: Any | None = None, - interval_value: Any | None = None, - adjust_kind: Any | None = None, - since_ts_millis: Any | None = None, - until_ts_millis: Any | None = None, - limit: Any | None = None, - *, - raw: bool = False, - fields: Sequence[str] | str | None = None, - as_dataframe: bool = True, - **kwargs: Any, - ) -> Any: - """批量可转债K线. - Endpoint: ``api/v1/market/data/convertible-bond-candlesticks/batch``. - Method: ``POST``. - Documented endpoint: ``convertible_bond_candlesticks_batch``. + def szse_convertible_bond_negotiated_trades(self, security_code: Any | None = None, trade_date: Any | None = None, start_date: Any | None = None, end_date: Any | None = None, page: int | None = None, page_size: int | None = None, *, raw: bool = False, fields: Sequence[str] | str | None = None, as_dataframe: bool = True, **kwargs: Any) -> Any: + """深交所可转债协议成交.""" + params = {'security_code': security_code, 'trade_date': trade_date, 'start_date': start_date, 'end_date': end_date, 'page': page, 'page_size': page_size} + params.update(kwargs) + return self._call_endpoint('szse_convertible_bond_negotiated_trades', raw=raw, fields=fields, as_dataframe=as_dataframe, **params) - Args: - symbols: 可转债代码列表,如 ["113027.XSHG","128048.XSHE"];也接受 .SH、.SZ 短后缀 (type: string[]; required: Y). - interval_unit: 周期单位:Minute/Day/Week/Month/Year (type: enum; required: Y). - interval_value: 间隔数值,默认 1;例如 Minute+5 表示 5 分钟 K 线 (type: int; required: N). - adjust_kind: 复权:None(默认,不复权)/Forward(前复权)/Backward(后复权) (type: enum; required: N). - since_ts_millis: 开始时间戳,单位毫秒;分钟 K 线与 until 的跨度 ≤3 天 (type: int(ms); required: N). - until_ts_millis: 结束时间戳,单位毫秒 (type: int(ms); required: Y). - limit: 每个标的的返回条数上限;未传 since 和 limit 时默认最多返回 50 根 K 线 (type: int; required: N). - raw: Return the decoded JSON payload without tabular extraction. - fields: Optional field list or comma-separated field string applied after extraction. - as_dataframe: Return a pandas ``DataFrame`` by default; set to ``False`` for Python rows. - **kwargs: Extra request parameters forwarded unchanged. Useful when the service adds parameters before the SDK is regenerated. - Returns: - A pandas ``DataFrame`` by default, Python rows when - ``as_dataframe=False``, raw JSON when ``raw=True``, or raw page - payloads when multi-page fetching is used with ``raw=True``. - """ - request_params = {'symbols': symbols, 'interval_unit': interval_unit, 'interval_value': interval_value, 'adjust_kind': adjust_kind, 'since_ts_millis': since_ts_millis, 'until_ts_millis': until_ts_millis, 'limit': limit} - request_params.update(kwargs) - return self._call_endpoint( - 'convertible_bond_candlesticks_batch', - raw=raw, - fields=fields, - as_dataframe=as_dataframe, - **request_params, - ) + def szse_convertible_bond_directed_trades(self, security_code: Any | None = None, trade_date: Any | None = None, start_date: Any | None = None, end_date: Any | None = None, page: int | None = None, page_size: int | None = None, *, raw: bool = False, fields: Sequence[str] | str | None = None, as_dataframe: bool = True, **kwargs: Any) -> Any: + """深交所可转债定向成交.""" + params = {'security_code': security_code, 'trade_date': trade_date, 'start_date': start_date, 'end_date': end_date, 'page': page, 'page_size': page_size} + params.update(kwargs) + return self._call_endpoint('szse_convertible_bond_directed_trades', raw=raw, fields=fields, as_dataframe=as_dataframe, **params) + + + def szse_convertible_bond_declaration_snapshots(self, security_code: Any | None = None, trade_date: Any | None = None, start_date: Any | None = None, end_date: Any | None = None, page: int | None = None, page_size: int | None = None, *, raw: bool = False, fields: Sequence[str] | str | None = None, as_dataframe: bool = True, **kwargs: Any) -> Any: + """深交所可转债申报快照.""" + params = {'security_code': security_code, 'trade_date': trade_date, 'start_date': start_date, 'end_date': end_date, 'page': page, 'page_size': page_size} + params.update(kwargs) + return self._call_endpoint('szse_convertible_bond_declaration_snapshots', raw=raw, fields=fields, as_dataframe=as_dataframe, **params) diff --git a/src/ftshare/apis/economic.py b/src/ftshare/apis/economic.py index 257626d..e86fd36 100644 --- a/src/ftshare/apis/economic.py +++ b/src/ftshare/apis/economic.py @@ -13,6 +13,11 @@ class EconomicApiMixin: def consumer_credit_monthly( self, + page: int | None = None, + page_size: int | None = None, + limit: int | None = None, + all_pages: bool = False, + max_pages: int | None = None, *, raw: bool = False, fields: Sequence[str] | str | None = None, @@ -38,8 +43,14 @@ def consumer_credit_monthly( """ request_params = {} request_params.update(kwargs) - return self._call_endpoint( - 'consumer_credit_monthly', + path = ENDPOINTS['consumer_credit_monthly'].path + return self.get_paginated( + path, + page=page, + page_size=page_size, + limit=limit, + all_pages=all_pages, + max_pages=max_pages, raw=raw, fields=fields, as_dataframe=as_dataframe, @@ -223,6 +234,11 @@ def consumer_industrial_added_value_monthly( def consumer_money_supply_monthly( self, + page: int | None = None, + page_size: int | None = None, + limit: int | None = None, + all_pages: bool = False, + max_pages: int | None = None, *, raw: bool = False, fields: Sequence[str] | str | None = None, @@ -248,8 +264,14 @@ def consumer_money_supply_monthly( """ request_params = {} request_params.update(kwargs) - return self._call_endpoint( - 'consumer_money_supply_monthly', + path = ENDPOINTS['consumer_money_supply_monthly'].path + return self.get_paginated( + path, + page=page, + page_size=page_size, + limit=limit, + all_pages=all_pages, + max_pages=max_pages, raw=raw, fields=fields, as_dataframe=as_dataframe, @@ -258,6 +280,11 @@ def consumer_money_supply_monthly( def consumer_pmi_monthly( self, + page: int | None = None, + page_size: int | None = None, + limit: int | None = None, + all_pages: bool = False, + max_pages: int | None = None, *, raw: bool = False, fields: Sequence[str] | str | None = None, @@ -283,8 +310,14 @@ def consumer_pmi_monthly( """ request_params = {} request_params.update(kwargs) - return self._call_endpoint( - 'consumer_pmi_monthly', + path = ENDPOINTS['consumer_pmi_monthly'].path + return self.get_paginated( + path, + page=page, + page_size=page_size, + limit=limit, + all_pages=all_pages, + max_pages=max_pages, raw=raw, fields=fields, as_dataframe=as_dataframe, @@ -293,6 +326,11 @@ def consumer_pmi_monthly( def consumer_ppi_monthly( self, + page: int | None = None, + page_size: int | None = None, + limit: int | None = None, + all_pages: bool = False, + max_pages: int | None = None, *, raw: bool = False, fields: Sequence[str] | str | None = None, @@ -318,8 +356,14 @@ def consumer_ppi_monthly( """ request_params = {} request_params.update(kwargs) - return self._call_endpoint( - 'consumer_ppi_monthly', + path = ENDPOINTS['consumer_ppi_monthly'].path + return self.get_paginated( + path, + page=page, + page_size=page_size, + limit=limit, + all_pages=all_pages, + max_pages=max_pages, raw=raw, fields=fields, as_dataframe=as_dataframe, @@ -328,6 +372,11 @@ def consumer_ppi_monthly( def consumer_price_index_monthly( self, + page: int | None = None, + page_size: int | None = None, + limit: int | None = None, + all_pages: bool = False, + max_pages: int | None = None, *, raw: bool = False, fields: Sequence[str] | str | None = None, @@ -353,8 +402,14 @@ def consumer_price_index_monthly( """ request_params = {} request_params.update(kwargs) - return self._call_endpoint( - 'consumer_price_index_monthly', + path = ENDPOINTS['consumer_price_index_monthly'].path + return self.get_paginated( + path, + page=page, + page_size=page_size, + limit=limit, + all_pages=all_pages, + max_pages=max_pages, raw=raw, fields=fields, as_dataframe=as_dataframe, @@ -649,3 +704,54 @@ def wallstreetcn_financial_calendar( as_dataframe=as_dataframe, **request_params, ) + def hibor_daily( + self, + start_date: Any | None = None, + end_date: Any | None = None, + page: int | None = None, + page_size: int | None = None, + *, + raw: bool = False, + fields: Sequence[str] | str | None = None, + as_dataframe: bool = True, + **kwargs: Any, + ) -> Any: + """HIBOR日度利率.""" + params = {'start_date': start_date, 'end_date': end_date, 'page': page, 'page_size': page_size} + params.update(kwargs) + return self._call_endpoint('hibor_daily', raw=raw, fields=fields, as_dataframe=as_dataframe, **params) + + + def shibor_quote_daily(self, start_date: Any | None = None, end_date: Any | None = None, bank: Any | None = None, page: int | None = None, page_size: int | None = None, *, raw: bool = False, fields: Sequence[str] | str | None = None, as_dataframe: bool = True, **kwargs: Any) -> Any: + """SHIBOR报价日度.""" + params = {'start_date': start_date, 'end_date': end_date, 'bank': bank, 'page': page, 'page_size': page_size} + params.update(kwargs) + return self._call_endpoint('shibor_quote_daily', raw=raw, fields=fields, as_dataframe=as_dataframe, **params) + + + def shibor_daily(self, start_date: Any | None = None, end_date: Any | None = None, page: int | None = None, page_size: int | None = None, *, raw: bool = False, fields: Sequence[str] | str | None = None, as_dataframe: bool = True, **kwargs: Any) -> Any: + """SHIBOR日度利率.""" + params = {'start_date': start_date, 'end_date': end_date, 'page': page, 'page_size': page_size} + params.update(kwargs) + return self._call_endpoint('shibor_daily', raw=raw, fields=fields, as_dataframe=as_dataframe, **params) + + + def chinabond_yield_daily(self, start_date: Any | None = None, end_date: Any | None = None, curve_name: Any | None = None, page: int | None = None, page_size: int | None = None, *, raw: bool = False, fields: Sequence[str] | str | None = None, as_dataframe: bool = True, **kwargs: Any) -> Any: + """中债收益率曲线日度.""" + params = {'start_date': start_date, 'end_date': end_date, 'curve_name': curve_name, 'page': page, 'page_size': page_size} + params.update(kwargs) + return self._call_endpoint('chinabond_yield_daily', raw=raw, fields=fields, as_dataframe=as_dataframe, **params) + + + def libor_daily(self, start_date: Any | None = None, end_date: Any | None = None, currency: Any | None = None, tenor: Any | None = None, page: int | None = None, page_size: int | None = None, *, raw: bool = False, fields: Sequence[str] | str | None = None, as_dataframe: bool = True, **kwargs: Any) -> Any: + """国际基准利率日度.""" + params = {'start_date': start_date, 'end_date': end_date, 'currency': currency, 'tenor': tenor, 'page': page, 'page_size': page_size} + params.update(kwargs) + return self._call_endpoint('libor_daily', raw=raw, fields=fields, as_dataframe=as_dataframe, **params) + + + def wz_index_daily(self, start_date: Any | None = None, end_date: Any | None = None, page: int | None = None, page_size: int | None = None, *, raw: bool = False, fields: Sequence[str] | str | None = None, as_dataframe: bool = True, **kwargs: Any) -> Any: + """温州民间融资综合利率指数日度.""" + params = {'start_date': start_date, 'end_date': end_date, 'page': page, 'page_size': page_size} + params.update(kwargs) + return self._call_endpoint('wz_index_daily', raw=raw, fields=fields, as_dataframe=as_dataframe, **params) diff --git a/src/ftshare/apis/etf.py b/src/ftshare/apis/etf.py index 89f0fee..a37ac5b 100644 --- a/src/ftshare/apis/etf.py +++ b/src/ftshare/apis/etf.py @@ -17,8 +17,8 @@ def etf_adjust_factor( trade_date: Any | None = None, start_date: Any | None = None, end_date: Any | None = None, - offset: Any | None = None, - limit: Any | None = None, + page: int | None = None, + page_size: int | None = None, *, raw: bool = False, fields: Sequence[str] | str | None = None, @@ -36,8 +36,8 @@ def etf_adjust_factor( trade_date: 交易日期 YYYYMMDD;空则默认当天,非交易日回退前一交易日 (type: string; required: N). start_date: 区间起始日期 YYYYMMDD;区间扫描必填且需配 symbol (type: string; required: N). end_date: 区间结束日期 YYYYMMDD;区间扫描必填且需配 symbol (type: string; required: N). - offset: 返回结果起始偏移 (type: int; required: N). - limit: 返回结果最大条数 (type: int; required: N). + page: 页码,从 1 开始。 + page_size: 每页条数,最大 2000。 raw: Return the decoded JSON payload without tabular extraction. fields: Optional field list or comma-separated field string applied after extraction. as_dataframe: Return a pandas ``DataFrame`` by default; set to ``False`` for Python rows. @@ -48,7 +48,7 @@ def etf_adjust_factor( ``as_dataframe=False``, raw JSON when ``raw=True``, or raw page payloads when multi-page fetching is used with ``raw=True``. """ - request_params = {'symbol': symbol, 'trade_date': trade_date, 'start_date': start_date, 'end_date': end_date, 'offset': offset, 'limit': limit} + request_params = {'symbol': symbol, 'trade_date': trade_date, 'start_date': start_date, 'end_date': end_date, 'page': page, 'page_size': page_size} request_params.update(kwargs) return self._call_endpoint( 'etf_adjust_factor', @@ -76,7 +76,7 @@ def etf_candlesticks( """ETFK线. Endpoint: ``api/v1/market/data/etf-candlesticks``. - Method: ``POST``. + Method: ``GET``. Documented endpoint: ``etf_candlesticks``. Args: @@ -107,94 +107,9 @@ def etf_candlesticks( **request_params, ) - def etf_candlesticks_batch( - self, - symbols: Any | None = None, - interval_unit: Any | None = None, - interval_value: Any | None = None, - adjust_kind: Any | None = None, - since_ts_millis: Any | None = None, - until_ts_millis: Any | None = None, - limit: Any | None = None, - *, - raw: bool = False, - fields: Sequence[str] | str | None = None, - as_dataframe: bool = True, - **kwargs: Any, - ) -> Any: - """批量ETFK线. - - Endpoint: ``api/v1/market/data/etf-candlesticks/batch``. - Method: ``POST``. - Documented endpoint: ``etf_candlesticks_batch``. - - Args: - symbols: ETF 代码列表,如 ["510300.XSHG","159915.XSHE"];也接受 .SH、.SZ 短后缀 (type: string[]; required: Y). - interval_unit: 周期单位:Minute/Day/Week/Month/Year (type: enum; required: Y). - interval_value: 间隔数值,默认 1;例如 Minute+5 表示 5 分钟 K 线 (type: int; required: N). - adjust_kind: 复权:None(默认,不复权)/Forward(前复权)/Backward(后复权) (type: enum; required: N). - since_ts_millis: 开始时间戳,单位毫秒;分钟 K 线与 until 的跨度 ≤3 天 (type: int(ms); required: N). - until_ts_millis: 结束时间戳,单位毫秒 (type: int(ms); required: Y). - limit: 每个标的的返回条数上限;未传 since 和 limit 时默认最多返回 50 根 K 线 (type: int; required: N). - raw: Return the decoded JSON payload without tabular extraction. - fields: Optional field list or comma-separated field string applied after extraction. - as_dataframe: Return a pandas ``DataFrame`` by default; set to ``False`` for Python rows. - **kwargs: Extra request parameters forwarded unchanged. Useful when the service adds parameters before the SDK is regenerated. - - Returns: - A pandas ``DataFrame`` by default, Python rows when - ``as_dataframe=False``, raw JSON when ``raw=True``, or raw page - payloads when multi-page fetching is used with ``raw=True``. - """ - request_params = {'symbols': symbols, 'interval_unit': interval_unit, 'interval_value': interval_value, 'adjust_kind': adjust_kind, 'since_ts_millis': since_ts_millis, 'until_ts_millis': until_ts_millis, 'limit': limit} - request_params.update(kwargs) - return self._call_endpoint( - 'etf_candlesticks_batch', - raw=raw, - fields=fields, - as_dataframe=as_dataframe, - **request_params, - ) - - def etf_components( - self, - symbol: Any | None = None, - *, - raw: bool = False, - fields: Sequence[str] | str | None = None, - as_dataframe: bool = True, - **kwargs: Any, - ) -> Any: - """ETF成份股. - - Endpoint: ``api/v1/market/data/etf-component``. - Method: ``GET``. - Documented endpoint: ``get_etf_components_handler``. - - Args: - symbol: ETF 标的代码,带交易所后缀,如 510300.XSHG、159915.XSHE (type: string; required: Y). - raw: Return the decoded JSON payload without tabular extraction. - fields: Optional field list or comma-separated field string applied after extraction. - as_dataframe: Return a pandas ``DataFrame`` by default; set to ``False`` for Python rows. - **kwargs: Extra request parameters forwarded unchanged. Useful when the service adds parameters before the SDK is regenerated. - - Returns: - A pandas ``DataFrame`` by default, Python rows when - ``as_dataframe=False``, raw JSON when ``raw=True``, or raw page - payloads when multi-page fetching is used with ``raw=True``. - """ - request_params = {'symbol': symbol} - request_params.update(kwargs) - return self._call_endpoint( - 'etf_components', - raw=raw, - fields=fields, - as_dataframe=as_dataframe, - **request_params, - ) - def etf_components_all( self, + symbol: Any | None = None, *, raw: bool = False, fields: Sequence[str] | str | None = None, @@ -203,11 +118,12 @@ def etf_components_all( ) -> Any: """ETF成份列表. - Endpoint: ``api/v1/market/data/etf-components-all``. + Endpoint: ``api/v2/market/data/etf-components-all``. Method: ``GET``. Documented endpoint: ``etf_components_all``. Args: + symbol: ETF 标的代码;不传返回全部 ETF (type: string; required: N). raw: Return the decoded JSON payload without tabular extraction. fields: Optional field list or comma-separated field string applied after extraction. as_dataframe: Return a pandas ``DataFrame`` by default; set to ``False`` for Python rows. @@ -218,7 +134,7 @@ def etf_components_all( ``as_dataframe=False``, raw JSON when ``raw=True``, or raw page payloads when multi-page fetching is used with ``raw=True``. """ - request_params = {} + request_params = {'symbol': symbol} request_params.update(kwargs) return self._call_endpoint( 'etf_components_all', @@ -263,59 +179,6 @@ def etf_description_all( **request_params, ) - def etf_fund_export( - self, - request_id: Any | None = None, - page: int | None = None, - page_size: int | None = None, - limit: int | None = None, - all_pages: bool = False, - max_pages: int | None = None, - *, - raw: bool = False, - fields: Sequence[str] | str | None = None, - as_dataframe: bool = True, - **kwargs: Any, - ) -> Any: - """指数ETF基金导出. - - Endpoint: ``api/v1/market/data/etf/zhitou-etf``. - Method: ``GET``. - Documented endpoint: ``etf_fund_export``. - - Args: - request_id: 请求唯一标识,由调用方生成,原样写入响应 (type: string; required: Y). - page: Page number, starting from 1. If omitted, the server default is used unless ``limit`` or ``all_pages`` is set. - page_size: Rows per page. The SDK validates this against the endpoint-specific maximum. - limit: Maximum number of rows to return. The SDK may fetch multiple pages to satisfy this limit. - all_pages: Fetch and combine pages until the server reports the last page. - max_pages: Optional safety cap for ``all_pages``. - raw: Return the decoded JSON payload without tabular extraction. - fields: Optional field list or comma-separated field string applied after extraction. - as_dataframe: Return a pandas ``DataFrame`` by default; set to ``False`` for Python rows. - **kwargs: Extra request parameters forwarded unchanged. Useful when the service adds parameters before the SDK is regenerated. - - Returns: - A pandas ``DataFrame`` by default, Python rows when - ``as_dataframe=False``, raw JSON when ``raw=True``, or raw page - payloads when multi-page fetching is used with ``raw=True``. - """ - request_params = {'request_id': request_id} - request_params.update(kwargs) - path = ENDPOINTS['etf_fund_export'].path - return self.get_paginated( - path, - page=page, - page_size=page_size, - limit=limit, - all_pages=all_pages, - max_pages=max_pages, - raw=raw, - fields=fields, - as_dataframe=as_dataframe, - **request_params, - ) - def etf_pcf_list( self, date: Any | None = None, @@ -445,3 +308,22 @@ def etf_pre_single( as_dataframe=as_dataframe, **request_params, ) + def etf_minutes(self, symbol: Any | None = None, interval_value: Any | None = None, adjust_kind: Any | None = None, since_ts_millis: Any | None = None, until_ts_millis: Any | None = None, limit: Any | None = None, *, raw: bool = False, fields: Sequence[str] | str | None = None, as_dataframe: bool = True, **kwargs: Any) -> Any: + """ETF历史分钟行情.""" + params = {'symbol': symbol, 'interval_value': interval_value, 'adjust_kind': adjust_kind, 'since_ts_millis': since_ts_millis, 'until_ts_millis': until_ts_millis, 'limit': limit} + params.update(kwargs) + return self._call_endpoint('etf_minutes', raw=raw, fields=fields, as_dataframe=as_dataframe, **params) + + + def etf_realtime_minute_kline(self, symbols: Any | None = None, *, raw: bool = False, fields: Sequence[str] | str | None = None, as_dataframe: bool = True, **kwargs: Any) -> Any: + """ETF实时分钟K线.""" + params = {'symbols': symbols} + params.update(kwargs) + return self._call_endpoint('etf_realtime_minute_kline', raw=raw, fields=fields, as_dataframe=as_dataframe, **params) + + + def etf_realtime_day_kline(self, symbols: Any | None = None, *, raw: bool = False, fields: Sequence[str] | str | None = None, as_dataframe: bool = True, **kwargs: Any) -> Any: + """ETF实时日K线.""" + params = {'symbols': symbols} + params.update(kwargs) + return self._call_endpoint('etf_realtime_day_kline', raw=raw, fields=fields, as_dataframe=as_dataframe, **params) diff --git a/src/ftshare/apis/forex.py b/src/ftshare/apis/forex.py index 2a26227..16e5b66 100644 --- a/src/ftshare/apis/forex.py +++ b/src/ftshare/apis/forex.py @@ -10,38 +10,3 @@ class ForexApiMixin: """Endpoint methods for the forex ftshare-doc topic.""" - - def consumer_forex_gold_monthly( - self, - *, - raw: bool = False, - fields: Sequence[str] | str | None = None, - as_dataframe: bool = True, - **kwargs: Any, - ) -> Any: - """外汇黄金. - - Endpoint: ``api/v1/market/data/economic/china-forex-gold``. - Method: ``GET``. - Documented endpoint: ``consumer_forex_gold_monthly``. - - Args: - raw: Return the decoded JSON payload without tabular extraction. - fields: Optional field list or comma-separated field string applied after extraction. - as_dataframe: Return a pandas ``DataFrame`` by default; set to ``False`` for Python rows. - **kwargs: Extra request parameters forwarded unchanged. Useful when the service adds parameters before the SDK is regenerated. - - Returns: - A pandas ``DataFrame`` by default, Python rows when - ``as_dataframe=False``, raw JSON when ``raw=True``, or raw page - payloads when multi-page fetching is used with ``raw=True``. - """ - request_params = {} - request_params.update(kwargs) - return self._call_endpoint( - 'consumer_forex_gold_monthly', - raw=raw, - fields=fields, - as_dataframe=as_dataframe, - **request_params, - ) diff --git a/src/ftshare/apis/fund.py b/src/ftshare/apis/fund.py index 8e83cb1..c3c5c86 100644 --- a/src/ftshare/apis/fund.py +++ b/src/ftshare/apis/fund.py @@ -103,59 +103,6 @@ def fund_cal_return( **request_params, ) - def fund_nav( - self, - institution_code: Any | None = None, - page: int | None = None, - page_size: int | None = None, - limit: int | None = None, - all_pages: bool = False, - max_pages: int | None = None, - *, - raw: bool = False, - fields: Sequence[str] | str | None = None, - as_dataframe: bool = True, - **kwargs: Any, - ) -> Any: - """基金净值. - - Endpoint: ``api/v1/market/data/fund/fund-nav``. - Method: ``GET``. - Documented endpoint: ``get_fund_nav``. - - Args: - institution_code: 基金代码 (type: string; required: Y). - page: Page number, starting from 1. If omitted, the server default is used unless ``limit`` or ``all_pages`` is set. - page_size: Rows per page. The SDK validates this against the endpoint-specific maximum. - limit: Maximum number of rows to return. The SDK may fetch multiple pages to satisfy this limit. - all_pages: Fetch and combine pages until the server reports the last page. - max_pages: Optional safety cap for ``all_pages``. - raw: Return the decoded JSON payload without tabular extraction. - fields: Optional field list or comma-separated field string applied after extraction. - as_dataframe: Return a pandas ``DataFrame`` by default; set to ``False`` for Python rows. - **kwargs: Extra request parameters forwarded unchanged. Useful when the service adds parameters before the SDK is regenerated. - - Returns: - A pandas ``DataFrame`` by default, Python rows when - ``as_dataframe=False``, raw JSON when ``raw=True``, or raw page - payloads when multi-page fetching is used with ``raw=True``. - """ - request_params = {'institution_code': institution_code} - request_params.update(kwargs) - path = ENDPOINTS['fund_nav'].path - return self.get_paginated( - path, - page=page, - page_size=page_size, - limit=limit, - all_pages=all_pages, - max_pages=max_pages, - raw=raw, - fields=fields, - as_dataframe=as_dataframe, - **request_params, - ) - def fund_overview( self, page: int | None = None, @@ -832,70 +779,6 @@ def fund_manager( **request_params, ) - def fund_daily( - self, - fund_code: Any | None = None, - trade_date: Any | None = None, - start_date: Any | None = None, - end_date: Any | None = None, - page: int | None = None, - page_size: int | None = None, - limit: int | None = None, - all_pages: bool = False, - max_pages: int | None = None, - *, - raw: bool = False, - fields: Sequence[str] | str | None = None, - as_dataframe: bool = True, - **kwargs: Any, - ) -> Any: - """基金行情日线. - - Endpoint: ``api/v1/market/data/fund/fund-daily``. - Method: ``GET``. - Documented endpoint: ``get_fund_daily``. - - Args: - fund_code: 基金代码 (type: string; required: Y). - trade_date: 交易日期 YYYYMMDD(与 start/end 互斥) (type: string; required: N). - start_date: 起始日期 YYYYMMDD(需与 end_date 同传) (type: string; required: N). - end_date: 结束日期 YYYYMMDD (type: string; required: N). - page: Page number, starting from 1. If omitted, the server default is used unless ``limit`` or ``all_pages`` is set. - page_size: Rows per page. The SDK validates this against the endpoint-specific maximum. - limit: Maximum number of rows to return. The SDK may fetch multiple pages to satisfy this limit. - all_pages: Fetch and combine pages until the server reports the last page. - max_pages: Optional safety cap for ``all_pages``. - raw: Return the decoded JSON payload without tabular extraction. - fields: Optional field list or comma-separated field string applied after extraction. - as_dataframe: Return a pandas ``DataFrame`` by default; set to ``False`` for Python rows. - **kwargs: Extra request parameters forwarded unchanged. Useful when the service adds parameters before the SDK is regenerated. - - Returns: - A pandas ``DataFrame`` by default, Python rows when - ``as_dataframe=False``, raw JSON when ``raw=True``, or raw page - payloads when multi-page fetching is used with ``raw=True``. - """ - request_params = { - 'fund_code': fund_code, - 'trade_date': trade_date, - 'start_date': start_date, - 'end_date': end_date, - } - request_params.update(kwargs) - path = ENDPOINTS['fund_daily'].path - return self.get_paginated( - path, - page=page, - page_size=page_size, - limit=limit, - all_pages=all_pages, - max_pages=max_pages, - raw=raw, - fields=fields, - as_dataframe=as_dataframe, - **request_params, - ) - def fund_fee( self, fund_code: Any | None = None, diff --git a/src/ftshare/apis/futures.py b/src/ftshare/apis/futures.py index b1e39ff..16b34b1 100644 --- a/src/ftshare/apis/futures.py +++ b/src/ftshare/apis/futures.py @@ -295,43 +295,50 @@ def eastmoney_futures_position( **request_params, ) - def eastmoney_futures_strange( + def futures_minutes( self, - exchange: Any | None = None, - variety: Any | None = None, - contract: Any | None = None, - trade_date: Any | None = None, + symbol: Any | None = None, + interval: Any | None = None, + start: Any | None = None, + end: Any | None = None, + limit: Any | None = None, *, raw: bool = False, fields: Sequence[str] | str | None = None, as_dataframe: bool = True, **kwargs: Any, ) -> Any: - """东方财富期货龙虎榜. + """期货历史分钟行情. - Endpoint: ``api/v1/market/data/eastmoney-futures-strange``. + Endpoint: ``api/v3/market/data/futures_minutes``. Method: ``GET``. - Documented endpoint: ``eastmoney_futures_strange``. + Documented endpoint: ``futures_minutes``. Args: - exchange: 交易所代码:``shfe``/``dce``/``czce``/``cffex``/``ine``/``gfe`` (type: string; required: Y). - variety: 品种名称,如 ``多晶硅`` (type: string; required: Y). - contract: 合约代码,如 ``ps2609`` (type: string; required: Y). - trade_date: 交易日,``YYYYMMDD`` (type: string; required: Y). + symbol: 期货合约代码,带交易所短后缀 (type: string; required: Y). + interval: 分钟周期,默认 ``1min`` (type: string; required: N). + start: 起始时间戳,单位毫秒 (type: integer; required: N). + end: 结束时间戳,单位毫秒,不能单独传 (type: integer; required: N). + limit: 返回条数上限,范围 1~1000 (type: integer; required: N). raw: Return the decoded JSON payload without tabular extraction. fields: Optional field list or comma-separated field string applied after extraction. as_dataframe: Return a pandas ``DataFrame`` by default; set to ``False`` for Python rows. - **kwargs: Extra request parameters forwarded unchanged. Useful when the service adds parameters before the SDK is regenerated. + **kwargs: Extra request parameters forwarded unchanged. Returns: A pandas ``DataFrame`` by default, Python rows when - ``as_dataframe=False``, raw JSON when ``raw=True``, or raw page - payloads when multi-page fetching is used with ``raw=True``. + ``as_dataframe=False``, or raw JSON when ``raw=True``. """ - request_params = {'exchange': exchange, 'variety': variety, 'contract': contract, 'trade_date': trade_date} + request_params = { + 'symbol': symbol, + 'interval': interval, + 'start': start, + 'end': end, + 'limit': limit, + } request_params.update(kwargs) return self._call_endpoint( - 'eastmoney_futures_strange', + 'futures_minutes', raw=raw, fields=fields, as_dataframe=as_dataframe, @@ -351,29 +358,34 @@ def futures_contract_kline( as_dataframe: bool = True, **kwargs: Any, ) -> Any: - """期货合约K线. + """期货行情. Endpoint: ``api/v1/market/data/futures/kline``. Method: ``GET``. Documented endpoint: ``futures_contract_kline``. Args: - symbol: WIND 合约全码,如 A2605.DCE (type: string; required: Y). - interval: 周期,默认 1min;可选 1min/5min/15min/30min/60min/daily/weekly/monthly/quarterly/yearly (type: string; required: N). - start: 开始时间戳(毫秒);与 end 跨度 ≤3 天;仅 start 表示 [start,+∞) (type: int64; required: N). - end: 结束时间戳(毫秒,闭区间);须与 start 同时传入,禁止只传 end (type: int64; required: N). - limit: 最大返回条数,默认 500 (type: int; required: N). + symbol: 期货合约代码 (type: string; required: Y). + interval: K线周期,默认 ``daily`` (type: string; required: N). + start: 起始时间戳,单位毫秒 (type: integer; required: N). + end: 结束时间戳,单位毫秒,不能单独传 (type: integer; required: N). + limit: 返回条数上限,0 按 1 处理 (type: integer; required: N). raw: Return the decoded JSON payload without tabular extraction. fields: Optional field list or comma-separated field string applied after extraction. as_dataframe: Return a pandas ``DataFrame`` by default; set to ``False`` for Python rows. - **kwargs: Extra request parameters forwarded unchanged. Useful when the service adds parameters before the SDK is regenerated. + **kwargs: Extra request parameters forwarded unchanged. Returns: A pandas ``DataFrame`` by default, Python rows when - ``as_dataframe=False``, raw JSON when ``raw=True``, or raw page - payloads when multi-page fetching is used with ``raw=True``. + ``as_dataframe=False``, or raw JSON when ``raw=True``. """ - request_params = {'symbol': symbol, 'interval': interval, 'start': start, 'end': end, 'limit': limit} + request_params = { + 'symbol': symbol, + 'interval': interval, + 'start': start, + 'end': end, + 'limit': limit, + } request_params.update(kwargs) return self._call_endpoint( 'futures_contract_kline', @@ -383,317 +395,71 @@ def futures_contract_kline( **request_params, ) - def futures_eod_price( + def futures_minutes_realtime( self, - exchange: Any | None = None, - symbol: Any | None = None, - trade_date: Any | None = None, - start_date: Any | None = None, - end_date: Any | None = None, - page: int | None = None, - page_size: int | None = None, - limit: int | None = None, - all_pages: bool = False, - max_pages: int | None = None, + symbols: Sequence[str] | str | None = None, *, raw: bool = False, fields: Sequence[str] | str | None = None, as_dataframe: bool = True, **kwargs: Any, ) -> Any: - """期货日终行情. + """期货实时分钟K线. - Endpoint: ``api/v1/market/data/futures/eod-price``. + Endpoint: ``api/v4/market/data/futures_minutes/realtime``. Method: ``GET``. - Documented endpoint: ``futures_eod_price``. + Documented endpoint: ``futures_minutes_realtime``. Args: - exchange: 交易所代码,精确匹配 (type: string; required: N). - symbol: 合约代码,精确匹配 (type: string; required: N). - trade_date: 精确交易日,8 位 ``YYYYMMDD``;不可与 ``start_date``/``end_date`` 同时使用 (type: int; required: N). - start_date: 起始交易日,8 位 ``YYYYMMDD`` (type: int; required: N). - end_date: 结束交易日,8 位 ``YYYYMMDD``;与 ``start_date`` 同时提供时须 ``start_date`` ≤ ``end_date`` (type: int; required: N). - page: Page number, starting from 1. If omitted, the server default is used unless ``limit`` or ``all_pages`` is set. - page_size: Rows per page. The SDK validates this against the endpoint-specific maximum. - limit: Maximum number of rows to return. The SDK may fetch multiple pages to satisfy this limit. - all_pages: Fetch and combine pages until the server reports the last page. - max_pages: Optional safety cap for ``all_pages``. + symbols: 期货合约代码列表,1~20 个 (type: array; required: Y). raw: Return the decoded JSON payload without tabular extraction. fields: Optional field list or comma-separated field string applied after extraction. as_dataframe: Return a pandas ``DataFrame`` by default; set to ``False`` for Python rows. - **kwargs: Extra request parameters forwarded unchanged. Useful when the service adds parameters before the SDK is regenerated. + **kwargs: Extra request parameters forwarded unchanged. Returns: A pandas ``DataFrame`` by default, Python rows when - ``as_dataframe=False``, raw JSON when ``raw=True``, or raw page - payloads when multi-page fetching is used with ``raw=True``. + ``as_dataframe=False``, or raw JSON when ``raw=True``. """ - request_params = {'exchange': exchange, 'symbol': symbol, 'trade_date': trade_date, 'start_date': start_date, 'end_date': end_date} - request_params.update(kwargs) - path = ENDPOINTS['futures_eod_price'].path - return self.get_paginated( - path, - page=page, - page_size=page_size, - limit=limit, - all_pages=all_pages, - max_pages=max_pages, - max_page_size=200, - raw=raw, - fields=fields, - as_dataframe=as_dataframe, - **request_params, - ) - - def futures_kline_intraday( - self, - symbol: Any | None = None, - interval: Any | None = None, - start: Any | None = None, - end: Any | None = None, - limit: int | None = None, - *, - raw: bool = False, - fields: Sequence[str] | str | None = None, - as_dataframe: bool = True, - **kwargs: Any, - ) -> Any: - """期货日内K线. - - Endpoint: ``api/v1/market/data/futures/kline/intraday``. - Method: ``GET``. - Documented endpoint: ``futures_kline_intraday``. - - Args: - symbol: WIND 合约全码或表内合约代码 (type: string; required: Y). - interval: 当前仅支持 ``1min``,兼容 ``1m``,默认 ``1min`` (type: string; required: N). - start: 开始时间,毫秒时间戳,闭区间 (type: int64; required: N). - end: 结束时间,毫秒时间戳,闭区间;与 ``start`` 同时提供时跨度不得超过 3 天 (type: int64; required: N). - limit: 最大返回条数,默认 600,范围 1~1000 (type: int; required: N). - raw: Return the decoded JSON payload without tabular extraction. - fields: Optional field list or comma-separated field string applied after extraction. - as_dataframe: Return a pandas ``DataFrame`` by default; set to ``False`` for Python rows. - **kwargs: Extra request parameters forwarded unchanged. Useful when the service adds parameters before the SDK is regenerated. - - Returns: - A pandas ``DataFrame`` by default, Python rows when - ``as_dataframe=False``, raw JSON when ``raw=True``, or raw page - payloads when multi-page fetching is used with ``raw=True``. - """ - request_params = {'symbol': symbol, 'interval': interval, 'start': start, 'end': end, 'limit': limit} + request_params = {'symbols': symbols} request_params.update(kwargs) return self._call_endpoint( - 'futures_kline_intraday', + 'futures_minutes_realtime', raw=raw, fields=fields, as_dataframe=as_dataframe, **request_params, ) + def fut_wsr(self, trade_date: Any | None = None, start_date: Any | None = None, end_date: Any | None = None, symbol: Any | None = None, exchange: Any | None = None, page: int | None = None, page_size: int | None = None, *, raw: bool = False, fields: Sequence[str] | str | None = None, as_dataframe: bool = True, **kwargs: Any) -> Any: + """期货仓单日报.""" + params = {'trade_date': trade_date, 'start_date': start_date, 'end_date': end_date, 'symbol': symbol, 'exchange': exchange, 'page': page, 'page_size': page_size} + params.update(kwargs) + return self._call_endpoint('fut_wsr', raw=raw, fields=fields, as_dataframe=as_dataframe, **params) - def futures_kline_latest( - self, - symbol: Any | None = None, - interval: Any | None = None, - *, - raw: bool = False, - fields: Sequence[str] | str | None = None, - as_dataframe: bool = True, - **kwargs: Any, - ) -> Any: - """期货最新K线. - Endpoint: ``api/v1/market/data/futures/kline/latest``. - Method: ``GET``. - Documented endpoint: ``futures_kline_latest``. + def fut_weekly_detail(self, week: Any | None = None, prd: Any | None = None, start_week: Any | None = None, end_week: Any | None = None, exchange: Any | None = None, page: int | None = None, page_size: int | None = None, *, raw: bool = False, fields: Sequence[str] | str | None = None, as_dataframe: bool = True, **kwargs: Any) -> Any: + """期货主要品种交易周报.""" + params = {'week': week, 'prd': prd, 'start_week': start_week, 'end_week': end_week, 'exchange': exchange, 'page': page, 'page_size': page_size} + params.update(kwargs) + return self._call_endpoint('fut_weekly_detail', raw=raw, fields=fields, as_dataframe=as_dataframe, **params) - Args: - symbol: WIND 合约全码(如 ``A2605.DCE``)或表内合约代码(如 ``a2605``) (type: string; required: Y). - interval: 当前仅支持 ``1min``,兼容 ``1m``,默认 ``1min`` (type: string; required: N). - raw: Return the decoded JSON payload without tabular extraction. - fields: Optional field list or comma-separated field string applied after extraction. - as_dataframe: Return a pandas ``DataFrame`` by default; set to ``False`` for Python rows. - **kwargs: Extra request parameters forwarded unchanged. Useful when the service adds parameters before the SDK is regenerated. - Returns: - A pandas ``DataFrame`` by default, Python rows when - ``as_dataframe=False``, raw JSON when ``raw=True``, or raw page - payloads when multi-page fetching is used with ``raw=True``. - """ - request_params = {'symbol': symbol, 'interval': interval} - request_params.update(kwargs) - return self._call_endpoint( - 'futures_kline_latest', - raw=raw, - fields=fields, - as_dataframe=as_dataframe, - **request_params, - ) + def fut_settle(self, ts_code: Any | None = None, trade_date: Any | None = None, start_date: Any | None = None, end_date: Any | None = None, exchange: Any | None = None, page: int | None = None, page_size: int | None = None, *, raw: bool = False, fields: Sequence[str] | str | None = None, as_dataframe: bool = True, **kwargs: Any) -> Any: + """期货每日结算参数.""" + params = {'ts_code': ts_code, 'trade_date': trade_date, 'start_date': start_date, 'end_date': end_date, 'exchange': exchange, 'page': page, 'page_size': page_size} + params.update(kwargs) + return self._call_endpoint('fut_settle', raw=raw, fields=fields, as_dataframe=as_dataframe, **params) - def member_build_process( - self, - exchange: Any | None = None, - member_name: Any | None = None, - instrument_id: Any | None = None, - start_date: Any | None = None, - end_date: Any | None = None, - contract_multiplier: Any | None = None, - page: int | None = None, - page_size: int | None = None, - limit: int | None = None, - all_pages: bool = False, - max_pages: int | None = None, - *, - raw: bool = False, - fields: Sequence[str] | str | None = None, - as_dataframe: bool = True, - **kwargs: Any, - ) -> Any: - """会员建仓过程. - Endpoint: ``api/v1/market/data/member-build-process``. - Method: ``GET``. - Documented endpoint: ``member_build_process``. - - Args: - exchange: 交易所代码,如 ``SHFE``、``DCE``、``CZCE`` (type: string; required: Y). - member_name: 会员名称 (type: string; required: Y). - instrument_id: 合约代码,如 ``rb2601`` (type: string; required: Y). - start_date: 起始日期,``YYYYMMDD`` 或 ``YYYY-MM-DD``,默认 ``20260101`` (type: string; required: N). - end_date: 结束日期,``YYYYMMDD`` 或 ``YYYY-MM-DD``,默认当天 (type: string; required: N). - contract_multiplier: 合约乘数;不传时按品种默认表推导 (type: float; required: N). - page: Page number, starting from 1. If omitted, the server default is used unless ``limit`` or ``all_pages`` is set. - page_size: Rows per page. The SDK validates this against the endpoint-specific maximum. - limit: Maximum number of rows to return. The SDK may fetch multiple pages to satisfy this limit. - all_pages: Fetch and combine pages until the server reports the last page. - max_pages: Optional safety cap for ``all_pages``. - raw: Return the decoded JSON payload without tabular extraction. - fields: Optional field list or comma-separated field string applied after extraction. - as_dataframe: Return a pandas ``DataFrame`` by default; set to ``False`` for Python rows. - **kwargs: Extra request parameters forwarded unchanged. Useful when the service adds parameters before the SDK is regenerated. - - Returns: - A pandas ``DataFrame`` by default, Python rows when - ``as_dataframe=False``, raw JSON when ``raw=True``, or raw page - payloads when multi-page fetching is used with ``raw=True``. - """ - request_params = {'exchange': exchange, 'member_name': member_name, 'instrument_id': instrument_id, 'start_date': start_date, 'end_date': end_date, 'contract_multiplier': contract_multiplier} - request_params.update(kwargs) - path = ENDPOINTS['member_build_process'].path - return self.get_paginated( - path, - page=page, - page_size=page_size, - limit=limit, - all_pages=all_pages, - max_pages=max_pages, - max_page_size=200, - raw=raw, - fields=fields, - as_dataframe=as_dataframe, - **request_params, - ) - - def member_position_ranking( - self, - exchange: Any | None = None, - instrument_id: Any | None = None, - trade_date: Any | None = None, - direction: Any | None = None, - page: int | None = None, - page_size: int | None = None, - limit: int | None = None, - all_pages: bool = False, - max_pages: int | None = None, - *, - raw: bool = False, - fields: Sequence[str] | str | None = None, - as_dataframe: bool = True, - **kwargs: Any, - ) -> Any: - """会员持仓排名. - - Endpoint: ``api/v1/market/data/member-position-ranking``. - Method: ``GET``. - Documented endpoint: ``member_position_ranking``. - - Args: - exchange: 交易所代码,如 ``SHFE``、``DCE``、``CZCE`` (type: string; required: Y). - instrument_id: 合约代码,如 ``a2605`` (type: string; required: Y). - trade_date: 交易日,``YYYYMMDD`` 或 ``YYYY-MM-DD`` (type: string; required: Y). - direction: 查询方向:``long`` 或 ``short``,也接受常见中文和缩写别名 (type: string; required: Y). - page: Page number, starting from 1. If omitted, the server default is used unless ``limit`` or ``all_pages`` is set. - page_size: Rows per page. The SDK validates this against the endpoint-specific maximum. - limit: Maximum number of rows to return. The SDK may fetch multiple pages to satisfy this limit. - all_pages: Fetch and combine pages until the server reports the last page. - max_pages: Optional safety cap for ``all_pages``. - raw: Return the decoded JSON payload without tabular extraction. - fields: Optional field list or comma-separated field string applied after extraction. - as_dataframe: Return a pandas ``DataFrame`` by default; set to ``False`` for Python rows. - **kwargs: Extra request parameters forwarded unchanged. Useful when the service adds parameters before the SDK is regenerated. - - Returns: - A pandas ``DataFrame`` by default, Python rows when - ``as_dataframe=False``, raw JSON when ``raw=True``, or raw page - payloads when multi-page fetching is used with ``raw=True``. - """ - request_params = {'exchange': exchange, 'instrument_id': instrument_id, 'trade_date': trade_date, 'direction': direction} - request_params.update(kwargs) - path = ENDPOINTS['member_position_ranking'].path - return self.get_paginated( - path, - page=page, - page_size=page_size, - limit=limit, - all_pages=all_pages, - max_pages=max_pages, - max_page_size=200, - raw=raw, - fields=fields, - as_dataframe=as_dataframe, - **request_params, - ) - - def futures_kline( - self, - symbol: Any | None = None, - interval: Any | None = None, - start: Any | None = None, - end: Any | None = None, - limit: Any | None = None, - *, - raw: bool = False, - fields: Sequence[str] | str | None = None, - as_dataframe: bool = True, - **kwargs: Any, - ) -> Any: - """期货合约K线. + def ft_limit(self, ts_code: Any | None = None, trade_date: Any | None = None, start_date: Any | None = None, end_date: Any | None = None, cont: Any | None = None, exchange: Any | None = None, page: int | None = None, page_size: int | None = None, *, raw: bool = False, fields: Sequence[str] | str | None = None, as_dataframe: bool = True, **kwargs: Any) -> Any: + """期货合约涨跌停价.""" + params = {'ts_code': ts_code, 'trade_date': trade_date, 'start_date': start_date, 'end_date': end_date, 'cont': cont, 'exchange': exchange, 'page': page, 'page_size': page_size} + params.update(kwargs) + return self._call_endpoint('ft_limit', raw=raw, fields=fields, as_dataframe=as_dataframe, **params) - Endpoint: ``api/v1/market/data/futures/kline``. - Method: ``GET``. - Documented endpoint: ``futures_contract_kline``. - - Args: - symbol: WIND 合约全码,如 A2605.DCE (type: string; required: Y). - interval: 周期,默认 1min;可选 1min/5min/15min/30min/60min/daily/weekly/monthly/quarterly/yearly (type: string; required: N). - start: 开始时间戳(毫秒);与 end 跨度 ≤3 天;仅 start 表示 [start,+∞) (type: int64; required: N). - end: 结束时间戳(毫秒,闭区间);须与 start 同时传入,禁止只传 end (type: int64; required: N). - limit: 最大返回条数,默认 500 (type: int; required: N). - raw: Return the decoded JSON payload without tabular extraction. - fields: Optional field list or comma-separated field string applied after extraction. - as_dataframe: Return a pandas ``DataFrame`` by default; set to ``False`` for Python rows. - **kwargs: Extra request parameters forwarded unchanged. Useful when the service adds parameters before the SDK is regenerated. - Returns: - A pandas ``DataFrame`` by default, Python rows when - ``as_dataframe=False``, raw JSON when ``raw=True``, or raw page - payloads when multi-page fetching is used with ``raw=True``. - """ - request_params = {'symbol': symbol, 'interval': interval, 'start': start, 'end': end, 'limit': limit} - request_params.update(kwargs) - return self._call_endpoint( - 'futures_kline', - raw=raw, - fields=fields, - as_dataframe=as_dataframe, - **request_params, - ) + def futures_nanhua_index_kline(self, code: Any | None = None, trade_date: Any | None = None, start_date: Any | None = None, end_date: Any | None = None, page: int | None = None, page_size: int | None = None, *, raw: bool = False, fields: Sequence[str] | str | None = None, as_dataframe: bool = True, **kwargs: Any) -> Any: + """南华期货指数日K线.""" + params = {'code': code, 'trade_date': trade_date, 'start_date': start_date, 'end_date': end_date, 'page': page, 'page_size': page_size} + params.update(kwargs) + return self._call_endpoint('futures_nanhua_index_kline', raw=raw, fields=fields, as_dataframe=as_dataframe, **params) diff --git a/src/ftshare/apis/hk.py b/src/ftshare/apis/hk.py index 5f273cb..a780c12 100644 --- a/src/ftshare/apis/hk.py +++ b/src/ftshare/apis/hk.py @@ -11,300 +11,6 @@ class HkApiMixin: """Endpoint methods for the hk ftshare-doc topic.""" - def company_hk( - self, - trade_code: Any | None = None, - *, - raw: bool = False, - fields: Sequence[str] | str | None = None, - as_dataframe: bool = True, - **kwargs: Any, - ) -> Any: - """港股公司信息. - - Endpoint: ``api/v1/market/data/hk/company-hk``. - Method: ``GET``. - Documented endpoint: ``get_company_hk``. - - Args: - trade_code: 港股交易代码 (type: string; required: Y). - raw: Return the decoded JSON payload without tabular extraction. - fields: Optional field list or comma-separated field string applied after extraction. - as_dataframe: Return a pandas ``DataFrame`` by default; set to ``False`` for Python rows. - **kwargs: Extra request parameters forwarded unchanged. Useful when the service adds parameters before the SDK is regenerated. - - Returns: - A pandas ``DataFrame`` by default, Python rows when - ``as_dataframe=False``, raw JSON when ``raw=True``, or raw page - payloads when multi-page fetching is used with ``raw=True``. - """ - request_params = {'trade_code': trade_code} - request_params.update(kwargs) - return self._call_endpoint( - 'company_hk', - raw=raw, - fields=fields, - as_dataframe=as_dataframe, - **request_params, - ) - - def hk_balance_bank( - self, - trade_code: Any | None = None, - year: Any | None = None, - report_type: Any | None = None, - start_date: Any | None = None, - end_date: Any | None = None, - page: int | None = None, - page_size: int | None = None, - limit: int | None = None, - all_pages: bool = False, - max_pages: int | None = None, - *, - raw: bool = False, - fields: Sequence[str] | str | None = None, - as_dataframe: bool = True, - **kwargs: Any, - ) -> Any: - """港股资产负债表. - - Endpoint: ``api/v1/market/data/hk/hk-balance-bank``. - Method: ``GET``. - Documented endpoint: ``hk_balance_bank``. - - Args: - trade_code: 港股代码(支持 `700` / `00700.HK`) (type: string; required: N). - year: 报告期年份(如 2024),按 `end_date` 日历年过滤,需配 `report_type` (type: int32; required: N). - report_type: 报告类型:annual(年报)/ semi(半年报),需配 `year` (type: string; required: N). - start_date: 起始截止日期 YYYYMMDD,筛选 `end_date >= 此值` (type: int32; required: N). - end_date: 结束截止日期 YYYYMMDD,筛选 `end_date <= 此值` (type: int32; required: N). - page: Page number, starting from 1. If omitted, the server default is used unless ``limit`` or ``all_pages`` is set. - page_size: Rows per page. The SDK validates this against the endpoint-specific maximum. - limit: Maximum number of rows to return. The SDK may fetch multiple pages to satisfy this limit. - all_pages: Fetch and combine pages until the server reports the last page. - max_pages: Optional safety cap for ``all_pages``. - raw: Return the decoded JSON payload without tabular extraction. - fields: Optional field list or comma-separated field string applied after extraction. - as_dataframe: Return a pandas ``DataFrame`` by default; set to ``False`` for Python rows. - **kwargs: Extra request parameters forwarded unchanged. Useful when the service adds parameters before the SDK is regenerated. - - Returns: - A pandas ``DataFrame`` by default, Python rows when - ``as_dataframe=False``, raw JSON when ``raw=True``, or raw page - payloads when multi-page fetching is used with ``raw=True``. - """ - request_params = {'trade_code': trade_code, 'year': year, 'report_type': report_type, 'start_date': start_date, 'end_date': end_date} - request_params.update(kwargs) - path = ENDPOINTS['hk_balance_bank'].path - return self.get_paginated( - path, - page=page, - page_size=page_size, - limit=limit, - all_pages=all_pages, - max_pages=max_pages, - raw=raw, - fields=fields, - as_dataframe=as_dataframe, - **request_params, - ) - - def hk_balance_gene( - self, - trade_code: Any | None = None, - year: Any | None = None, - report_type: Any | None = None, - start_date: Any | None = None, - end_date: Any | None = None, - page: int | None = None, - page_size: int | None = None, - limit: int | None = None, - all_pages: bool = False, - max_pages: int | None = None, - *, - raw: bool = False, - fields: Sequence[str] | str | None = None, - as_dataframe: bool = True, - **kwargs: Any, - ) -> Any: - """港股资产负债表. - - Endpoint: ``api/v1/market/data/hk/hk-balance-gene``. - Method: ``GET``. - Documented endpoint: ``hk_balance_gene``. - - Args: - trade_code: 港股代码(支持 `700` / `00700.HK`) (type: string; required: N). - year: 报告期年份(如 2024),按 `end_date` 日历年过滤,需配 `report_type` (type: int32; required: N). - report_type: 报告类型:annual(年报)/ semi(半年报),需配 `year` (type: string; required: N). - start_date: 起始截止日期 YYYYMMDD,筛选 `end_date >= 此值` (type: int32; required: N). - end_date: 结束截止日期 YYYYMMDD,筛选 `end_date <= 此值` (type: int32; required: N). - page: Page number, starting from 1. If omitted, the server default is used unless ``limit`` or ``all_pages`` is set. - page_size: Rows per page. The SDK validates this against the endpoint-specific maximum. - limit: Maximum number of rows to return. The SDK may fetch multiple pages to satisfy this limit. - all_pages: Fetch and combine pages until the server reports the last page. - max_pages: Optional safety cap for ``all_pages``. - raw: Return the decoded JSON payload without tabular extraction. - fields: Optional field list or comma-separated field string applied after extraction. - as_dataframe: Return a pandas ``DataFrame`` by default; set to ``False`` for Python rows. - **kwargs: Extra request parameters forwarded unchanged. Useful when the service adds parameters before the SDK is regenerated. - - Returns: - A pandas ``DataFrame`` by default, Python rows when - ``as_dataframe=False``, raw JSON when ``raw=True``, or raw page - payloads when multi-page fetching is used with ``raw=True``. - """ - request_params = {'trade_code': trade_code, 'year': year, 'report_type': report_type, 'start_date': start_date, 'end_date': end_date} - request_params.update(kwargs) - path = ENDPOINTS['hk_balance_gene'].path - return self.get_paginated( - path, - page=page, - page_size=page_size, - limit=limit, - all_pages=all_pages, - max_pages=max_pages, - raw=raw, - fields=fields, - as_dataframe=as_dataframe, - **request_params, - ) - - def hk_balance_insur( - self, - trade_code: Any | None = None, - year: Any | None = None, - report_type: Any | None = None, - start_date: Any | None = None, - end_date: Any | None = None, - page: int | None = None, - page_size: int | None = None, - limit: int | None = None, - all_pages: bool = False, - max_pages: int | None = None, - *, - raw: bool = False, - fields: Sequence[str] | str | None = None, - as_dataframe: bool = True, - **kwargs: Any, - ) -> Any: - """港股资产负债表. - - Endpoint: ``api/v1/market/data/hk/hk-balance-insur``. - Method: ``GET``. - Documented endpoint: ``hk_balance_insur``. - - Args: - trade_code: 港股代码(支持 `700` / `00700.HK`) (type: string; required: N). - year: 报告期年份(如 2024),按 `end_date` 日历年过滤,需配 `report_type` (type: int32; required: N). - report_type: 报告类型:annual(年报)/ semi(半年报),需配 `year` (type: string; required: N). - start_date: 起始截止日期 YYYYMMDD,筛选 `end_date >= 此值` (type: int32; required: N). - end_date: 结束截止日期 YYYYMMDD,筛选 `end_date <= 此值` (type: int32; required: N). - page: Page number, starting from 1. If omitted, the server default is used unless ``limit`` or ``all_pages`` is set. - page_size: Rows per page. The SDK validates this against the endpoint-specific maximum. - limit: Maximum number of rows to return. The SDK may fetch multiple pages to satisfy this limit. - all_pages: Fetch and combine pages until the server reports the last page. - max_pages: Optional safety cap for ``all_pages``. - raw: Return the decoded JSON payload without tabular extraction. - fields: Optional field list or comma-separated field string applied after extraction. - as_dataframe: Return a pandas ``DataFrame`` by default; set to ``False`` for Python rows. - **kwargs: Extra request parameters forwarded unchanged. Useful when the service adds parameters before the SDK is regenerated. - - Returns: - A pandas ``DataFrame`` by default, Python rows when - ``as_dataframe=False``, raw JSON when ``raw=True``, or raw page - payloads when multi-page fetching is used with ``raw=True``. - """ - request_params = {'trade_code': trade_code, 'year': year, 'report_type': report_type, 'start_date': start_date, 'end_date': end_date} - request_params.update(kwargs) - path = ENDPOINTS['hk_balance_insur'].path - return self.get_paginated( - path, - page=page, - page_size=page_size, - limit=limit, - all_pages=all_pages, - max_pages=max_pages, - raw=raw, - fields=fields, - as_dataframe=as_dataframe, - **request_params, - ) - - def hk_basinfo_get( - self, - hk_code: Any | None = None, - *, - raw: bool = False, - fields: Sequence[str] | str | None = None, - as_dataframe: bool = True, - **kwargs: Any, - ) -> Any: - """港股个股信息. - - Endpoint: ``api/v1/market/data/hk/hk-view``. - Method: ``GET``. - Documented endpoint: ``get_hk_basinfo_get``. - - Args: - hk_code: 港股代码,如 `00700.HK` (type: string; required: Y). - raw: Return the decoded JSON payload without tabular extraction. - fields: Optional field list or comma-separated field string applied after extraction. - as_dataframe: Return a pandas ``DataFrame`` by default; set to ``False`` for Python rows. - **kwargs: Extra request parameters forwarded unchanged. Useful when the service adds parameters before the SDK is regenerated. - - Returns: - A pandas ``DataFrame`` by default, Python rows when - ``as_dataframe=False``, raw JSON when ``raw=True``, or raw page - payloads when multi-page fetching is used with ``raw=True``. - """ - request_params = {'hk_code': hk_code} - request_params.update(kwargs) - return self._call_endpoint( - 'hk_basinfo_get', - raw=raw, - fields=fields, - as_dataframe=as_dataframe, - **request_params, - ) - - def hk_basinfo_post( - self, - hk_code: Any | None = None, - *, - raw: bool = False, - fields: Sequence[str] | str | None = None, - as_dataframe: bool = True, - **kwargs: Any, - ) -> Any: - """港股个股信息. - - Endpoint: ``api/v1/market/data/hk/hk-view``. - Method: ``GET``. - Documented endpoint: ``get_hk_basinfo_post``. - - Args: - hk_code: 港股代码,如 `00700.HK` (type: string; required: Y). - raw: Return the decoded JSON payload without tabular extraction. - fields: Optional field list or comma-separated field string applied after extraction. - as_dataframe: Return a pandas ``DataFrame`` by default; set to ``False`` for Python rows. - **kwargs: Extra request parameters forwarded unchanged. Useful when the service adds parameters before the SDK is regenerated. - - Returns: - A pandas ``DataFrame`` by default, Python rows when - ``as_dataframe=False``, raw JSON when ``raw=True``, or raw page - payloads when multi-page fetching is used with ``raw=True``. - """ - request_params = {'hk_code': hk_code} - request_params.update(kwargs) - return self._call_endpoint( - 'hk_basinfo_post', - raw=raw, - fields=fields, - as_dataframe=as_dataframe, - **request_params, - ) - def hk_candlesticks( self, trade_code: Any | None = None, @@ -354,463 +60,8 @@ def hk_candlesticks( **request_params, ) - def hk_cashflow( - self, - stock_code: Any | None = None, - year: Any | None = None, - report_type: Any | None = None, - start_date: Any | None = None, - end_date: Any | None = None, - page: int | None = None, - page_size: int | None = None, - limit: int | None = None, - all_pages: bool = False, - max_pages: int | None = None, - *, - raw: bool = False, - fields: Sequence[str] | str | None = None, - as_dataframe: bool = True, - **kwargs: Any, - ) -> Any: - """港股现金流量表. - - Endpoint: ``api/v1/market/data/hk/hk-cashflow``. - Method: ``GET``. - Documented endpoint: ``hk_cashflow``. - - Args: - stock_code: 港股代码(如 `00700.HK`) (type: string; required: N). - year: 报告期年份(如 2024),按 `end_date` 日历年过滤,需配 `report_type` (type: int32; required: N). - report_type: 报告类型:annual(年报)/ semi(半年报),需配 `year` (type: string; required: N). - start_date: 报告期范围下界 YYYYMMDD(含),过滤 `end_date >= 此值` (type: int32; required: N). - end_date: 报告期范围上界 YYYYMMDD(含),过滤 `end_date <= 此值` (type: int32; required: N). - page: Page number, starting from 1. If omitted, the server default is used unless ``limit`` or ``all_pages`` is set. - page_size: Rows per page. The SDK validates this against the endpoint-specific maximum. - limit: Maximum number of rows to return. The SDK may fetch multiple pages to satisfy this limit. - all_pages: Fetch and combine pages until the server reports the last page. - max_pages: Optional safety cap for ``all_pages``. - raw: Return the decoded JSON payload without tabular extraction. - fields: Optional field list or comma-separated field string applied after extraction. - as_dataframe: Return a pandas ``DataFrame`` by default; set to ``False`` for Python rows. - **kwargs: Extra request parameters forwarded unchanged. Useful when the service adds parameters before the SDK is regenerated. - - Returns: - A pandas ``DataFrame`` by default, Python rows when - ``as_dataframe=False``, raw JSON when ``raw=True``, or raw page - payloads when multi-page fetching is used with ``raw=True``. - """ - request_params = {'stock_code': stock_code, 'year': year, 'report_type': report_type, 'start_date': start_date, 'end_date': end_date} - request_params.update(kwargs) - path = ENDPOINTS['hk_cashflow'].path - return self.get_paginated( - path, - page=page, - page_size=page_size, - limit=limit, - all_pages=all_pages, - max_pages=max_pages, - raw=raw, - fields=fields, - as_dataframe=as_dataframe, - **request_params, - ) - - def hk_income_bank( - self, - trade_code: Any | None = None, - year: Any | None = None, - report_type: Any | None = None, - start_date: Any | None = None, - end_date: Any | None = None, - page: int | None = None, - page_size: int | None = None, - limit: int | None = None, - all_pages: bool = False, - max_pages: int | None = None, - *, - raw: bool = False, - fields: Sequence[str] | str | None = None, - as_dataframe: bool = True, - **kwargs: Any, - ) -> Any: - """港股利润表. - - Endpoint: ``api/v1/market/data/hk/hk-income-bank``. - Method: ``GET``. - Documented endpoint: ``hk_income_bank``. - - Args: - trade_code: 港股代码(支持 `700` / `00700.HK`) (type: string; required: N). - year: 报告期年份(如 2024),按 `end_date` 日历年过滤,需配 `report_type` (type: int32; required: N). - report_type: 报告类型:annual(年报)/ semi(半年报),需配 `year` (type: string; required: N). - start_date: 起始截止日期 YYYYMMDD,筛选 `end_date >= 此值` (type: int32; required: N). - end_date: 结束截止日期 YYYYMMDD,筛选 `end_date <= 此值` (type: int32; required: N). - page: Page number, starting from 1. If omitted, the server default is used unless ``limit`` or ``all_pages`` is set. - page_size: Rows per page. The SDK validates this against the endpoint-specific maximum. - limit: Maximum number of rows to return. The SDK may fetch multiple pages to satisfy this limit. - all_pages: Fetch and combine pages until the server reports the last page. - max_pages: Optional safety cap for ``all_pages``. - raw: Return the decoded JSON payload without tabular extraction. - fields: Optional field list or comma-separated field string applied after extraction. - as_dataframe: Return a pandas ``DataFrame`` by default; set to ``False`` for Python rows. - **kwargs: Extra request parameters forwarded unchanged. Useful when the service adds parameters before the SDK is regenerated. - - Returns: - A pandas ``DataFrame`` by default, Python rows when - ``as_dataframe=False``, raw JSON when ``raw=True``, or raw page - payloads when multi-page fetching is used with ``raw=True``. - """ - request_params = {'trade_code': trade_code, 'year': year, 'report_type': report_type, 'start_date': start_date, 'end_date': end_date} - request_params.update(kwargs) - path = ENDPOINTS['hk_income_bank'].path - return self.get_paginated( - path, - page=page, - page_size=page_size, - limit=limit, - all_pages=all_pages, - max_pages=max_pages, - raw=raw, - fields=fields, - as_dataframe=as_dataframe, - **request_params, - ) - - def hk_income_gene( - self, - trade_code: Any | None = None, - year: Any | None = None, - report_type: Any | None = None, - start_date: Any | None = None, - end_date: Any | None = None, - page: int | None = None, - page_size: int | None = None, - limit: int | None = None, - all_pages: bool = False, - max_pages: int | None = None, - *, - raw: bool = False, - fields: Sequence[str] | str | None = None, - as_dataframe: bool = True, - **kwargs: Any, - ) -> Any: - """港股利润表. - - Endpoint: ``api/v1/market/data/hk/hk-income-gene``. - Method: ``GET``. - Documented endpoint: ``hk_income_gene``. - - Args: - trade_code: 港股代码(支持 `700` / `00700.HK`) (type: string; required: N). - year: 报告期年份(如 2024),按 `end_date` 日历年过滤,需配 `report_type` (type: int32; required: N). - report_type: 报告类型:annual(年报)/ semi(半年报),需配 `year` (type: string; required: N). - start_date: 起始截止日期 YYYYMMDD,筛选 `end_date >= 此值` (type: int32; required: N). - end_date: 结束截止日期 YYYYMMDD,筛选 `end_date <= 此值` (type: int32; required: N). - page: Page number, starting from 1. If omitted, the server default is used unless ``limit`` or ``all_pages`` is set. - page_size: Rows per page. The SDK validates this against the endpoint-specific maximum. - limit: Maximum number of rows to return. The SDK may fetch multiple pages to satisfy this limit. - all_pages: Fetch and combine pages until the server reports the last page. - max_pages: Optional safety cap for ``all_pages``. - raw: Return the decoded JSON payload without tabular extraction. - fields: Optional field list or comma-separated field string applied after extraction. - as_dataframe: Return a pandas ``DataFrame`` by default; set to ``False`` for Python rows. - **kwargs: Extra request parameters forwarded unchanged. Useful when the service adds parameters before the SDK is regenerated. - - Returns: - A pandas ``DataFrame`` by default, Python rows when - ``as_dataframe=False``, raw JSON when ``raw=True``, or raw page - payloads when multi-page fetching is used with ``raw=True``. - """ - request_params = {'trade_code': trade_code, 'year': year, 'report_type': report_type, 'start_date': start_date, 'end_date': end_date} - request_params.update(kwargs) - path = ENDPOINTS['hk_income_gene'].path - return self.get_paginated( - path, - page=page, - page_size=page_size, - limit=limit, - all_pages=all_pages, - max_pages=max_pages, - raw=raw, - fields=fields, - as_dataframe=as_dataframe, - **request_params, - ) - - def hk_income_insur( - self, - trade_code: Any | None = None, - year: Any | None = None, - report_type: Any | None = None, - start_date: Any | None = None, - end_date: Any | None = None, - page: int | None = None, - page_size: int | None = None, - limit: int | None = None, - all_pages: bool = False, - max_pages: int | None = None, - *, - raw: bool = False, - fields: Sequence[str] | str | None = None, - as_dataframe: bool = True, - **kwargs: Any, - ) -> Any: - """港股利润表. - - Endpoint: ``api/v1/market/data/hk/hk-income-insur``. - Method: ``GET``. - Documented endpoint: ``hk_income_insur``. - - Args: - trade_code: 港股代码(支持 `700` / `00700.HK`) (type: string; required: N). - year: 报告期年份(如 2024),按 `end_date` 日历年过滤,需配 `report_type` (type: int32; required: N). - report_type: 报告类型:annual(年报)/ semi(半年报),需配 `year` (type: string; required: N). - start_date: 起始截止日期 YYYYMMDD,筛选 `end_date >= 此值` (type: int32; required: N). - end_date: 结束截止日期 YYYYMMDD,筛选 `end_date <= 此值` (type: int32; required: N). - page: Page number, starting from 1. If omitted, the server default is used unless ``limit`` or ``all_pages`` is set. - page_size: Rows per page. The SDK validates this against the endpoint-specific maximum. - limit: Maximum number of rows to return. The SDK may fetch multiple pages to satisfy this limit. - all_pages: Fetch and combine pages until the server reports the last page. - max_pages: Optional safety cap for ``all_pages``. - raw: Return the decoded JSON payload without tabular extraction. - fields: Optional field list or comma-separated field string applied after extraction. - as_dataframe: Return a pandas ``DataFrame`` by default; set to ``False`` for Python rows. - **kwargs: Extra request parameters forwarded unchanged. Useful when the service adds parameters before the SDK is regenerated. - - Returns: - A pandas ``DataFrame`` by default, Python rows when - ``as_dataframe=False``, raw JSON when ``raw=True``, or raw page - payloads when multi-page fetching is used with ``raw=True``. - """ - request_params = {'trade_code': trade_code, 'year': year, 'report_type': report_type, 'start_date': start_date, 'end_date': end_date} - request_params.update(kwargs) - path = ENDPOINTS['hk_income_insur'].path - return self.get_paginated( - path, - page=page, - page_size=page_size, - limit=limit, - all_pages=all_pages, - max_pages=max_pages, - raw=raw, - fields=fields, - as_dataframe=as_dataframe, - **request_params, - ) - - def hk_valuatnanalyd( - self, - trade_code: Any | None = None, - page: int | None = None, - page_size: int | None = None, - limit: int | None = None, - all_pages: bool = False, - max_pages: int | None = None, - *, - raw: bool = False, - fields: Sequence[str] | str | None = None, - as_dataframe: bool = True, - **kwargs: Any, - ) -> Any: - """港股估值分析. - - Endpoint: ``api/v1/market/data/hk/hk-valuatnanalyd``. - Method: ``GET``. - Documented endpoint: ``get_hk_valuatnanalyd``. - - Args: - trade_code: 港股代码(支持 `700` / `00700.HK`);留空查全市场 (type: string; required: N). - page: Page number, starting from 1. If omitted, the server default is used unless ``limit`` or ``all_pages`` is set. - page_size: Rows per page. The SDK validates this against the endpoint-specific maximum. - limit: Maximum number of rows to return. The SDK may fetch multiple pages to satisfy this limit. - all_pages: Fetch and combine pages until the server reports the last page. - max_pages: Optional safety cap for ``all_pages``. - raw: Return the decoded JSON payload without tabular extraction. - fields: Optional field list or comma-separated field string applied after extraction. - as_dataframe: Return a pandas ``DataFrame`` by default; set to ``False`` for Python rows. - **kwargs: Extra request parameters forwarded unchanged. Useful when the service adds parameters before the SDK is regenerated. - - Returns: - A pandas ``DataFrame`` by default, Python rows when - ``as_dataframe=False``, raw JSON when ``raw=True``, or raw page - payloads when multi-page fetching is used with ``raw=True``. - """ - request_params = {'trade_code': trade_code} - request_params.update(kwargs) - path = ENDPOINTS['hk_valuatnanalyd'].path - return self.get_paginated( - path, - page=page, - page_size=page_size, - limit=limit, - all_pages=all_pages, - max_pages=max_pages, - raw=raw, - fields=fields, - as_dataframe=as_dataframe, - **request_params, - ) - - def hsi_daily_weight( - self, - trade_date: Any | None = None, - start_date: Any | None = None, - end_date: Any | None = None, - index_slug: Any | None = None, - stock_code: Any | None = None, - page: int | None = None, - page_size: int | None = None, - limit: int | None = None, - all_pages: bool = False, - max_pages: int | None = None, - *, - raw: bool = False, - fields: Sequence[str] | str | None = None, - as_dataframe: bool = True, - **kwargs: Any, - ) -> Any: - """恒生指数每日权重. - - Endpoint: ``api/v1/market/data/hk/hsi-daily-weight``. - Method: ``GET``. - Documented endpoint: ``hsi_daily_weight``. - - Args: - trade_date: 交易日期 (type: string; required: N). - start_date: 起始日期 (type: string; required: N). - end_date: 结束日期 (type: string; required: N). - index_slug: 指数代码 (type: string; required: N). - stock_code: 成份股代码 (type: string; required: N). - page: Page number, starting from 1. If omitted, the server default is used unless ``limit`` or ``all_pages`` is set. - page_size: Rows per page. The SDK validates this against the endpoint-specific maximum. - limit: Maximum number of rows to return. The SDK may fetch multiple pages to satisfy this limit. - all_pages: Fetch and combine pages until the server reports the last page. - max_pages: Optional safety cap for ``all_pages``. - raw: Return the decoded JSON payload without tabular extraction. - fields: Optional field list or comma-separated field string applied after extraction. - as_dataframe: Return a pandas ``DataFrame`` by default; set to ``False`` for Python rows. - **kwargs: Extra request parameters forwarded unchanged. Useful when the service adds parameters before the SDK is regenerated. - - Returns: - A pandas ``DataFrame`` by default, Python rows when - ``as_dataframe=False``, raw JSON when ``raw=True``, or raw page - payloads when multi-page fetching is used with ``raw=True``. - """ - request_params = { - 'trade_date': trade_date, - 'start_date': start_date, - 'end_date': end_date, - 'index_slug': index_slug, - 'stock_code': stock_code, - } - request_params.update(kwargs) - path = ENDPOINTS['hsi_daily_weight'].path - return self.get_paginated( - path, - page=page, - page_size=page_size, - limit=limit, - all_pages=all_pages, - max_pages=max_pages, - raw=raw, - fields=fields, - as_dataframe=as_dataframe, - max_page_size=ENDPOINTS['hsi_daily_weight'].max_page_size, - **request_params, - ) - - def market_cap_hk( - self, - trade_code: Any | None = None, - *, - raw: bool = False, - fields: Sequence[str] | str | None = None, - as_dataframe: bool = True, - **kwargs: Any, - ) -> Any: - """港股市值. - - Endpoint: ``api/v1/market/data/hk/market-cap-hk``. - Method: ``GET``. - Documented endpoint: ``get_market_cap_hk``. - - Args: - trade_code: 港股交易代码 (type: string; required: Y). - raw: Return the decoded JSON payload without tabular extraction. - fields: Optional field list or comma-separated field string applied after extraction. - as_dataframe: Return a pandas ``DataFrame`` by default; set to ``False`` for Python rows. - **kwargs: Extra request parameters forwarded unchanged. Useful when the service adds parameters before the SDK is regenerated. - - Returns: - A pandas ``DataFrame`` by default, Python rows when - ``as_dataframe=False``, raw JSON when ``raw=True``, or raw page - payloads when multi-page fetching is used with ``raw=True``. - """ - request_params = {'trade_code': trade_code} - request_params.update(kwargs) - return self._call_endpoint( - 'market_cap_hk', - raw=raw, - fields=fields, - as_dataframe=as_dataframe, - **request_params, - ) - - def eastmoney_hk_index_daily_kline( - self, - index_code: Any | None = None, - trade_date: Any | None = None, - start_date: Any | None = None, - end_date: Any | None = None, - page: int | None = None, - page_size: int | None = None, - limit: int | None = None, - all_pages: bool = False, - max_pages: int | None = None, - *, - raw: bool = False, - fields: Sequence[str] | str | None = None, - as_dataframe: bool = True, - **kwargs: Any, - ) -> Any: - """东方财富港股指数日K. - - Endpoint: ``api/v1/market/data/eastmoney-hk-index-daily-kline``. - Method: ``GET``. - Documented endpoint: ``get_eastmoney_hk_index_daily_kline``. - - Args: - index_code: 指数代码,如 HSI / HSCEI / HSTECH;不传返回全部指数 (type: string; required: N). - trade_date: 交易日 YYYY-MM-DD;与 start_date/end_date 互斥 (type: string; required: N). - start_date: 区间起始日 YYYY-MM-DD;需与 end_date 同时提供 (type: string; required: N). - end_date: 区间结束日 YYYY-MM-DD;需与 start_date 同时提供 (type: string; required: N). - page: Page number, starting from 1. If omitted, the server default is used unless ``limit`` or ``all_pages`` is set. - page_size: Rows per page. The SDK validates this against the endpoint-specific maximum. - limit: Maximum number of rows to return. The SDK may fetch multiple pages to satisfy this limit. - all_pages: Fetch and combine pages until the server reports the last page. - max_pages: Optional safety cap for ``all_pages``. - raw: Return the decoded JSON payload without tabular extraction. - fields: Optional field list or comma-separated field string applied after extraction. - as_dataframe: Return a pandas ``DataFrame`` by default; set to ``False`` for Python rows. - **kwargs: Extra request parameters forwarded unchanged. Useful when the service adds parameters before the SDK is regenerated. - - Returns: - A pandas ``DataFrame`` by default, Python rows when - ``as_dataframe=False``, raw JSON when ``raw=True``, or raw page - payloads when multi-page fetching is used with ``raw=True``. - """ - request_params = {'index_code': index_code, 'trade_date': trade_date, 'start_date': start_date, 'end_date': end_date} - request_params.update(kwargs) - path = ENDPOINTS['eastmoney_hk_index_daily_kline'].path - return self.get_paginated( - path, - page=page, - page_size=page_size, - limit=limit, - all_pages=all_pages, - max_pages=max_pages, - raw=raw, - fields=fields, - as_dataframe=as_dataframe, - **request_params, - ) + def hk_stock_info_all(self, *, raw: bool = False, fields: Sequence[str] | str | None = None, as_dataframe: bool = True, **kwargs: Any) -> Any: + """港股实时行情.""" + params = {} + params.update(kwargs) + return self._call_endpoint('hk_stock_info_all', raw=raw, fields=fields, as_dataframe=as_dataframe, **params) diff --git a/src/ftshare/apis/index.py b/src/ftshare/apis/index.py index 9cd2f15..ffcb41c 100644 --- a/src/ftshare/apis/index.py +++ b/src/ftshare/apis/index.py @@ -16,6 +16,7 @@ def global_index_daily_kline( secid: Any | None = None, start_date: Any | None = None, end_date: Any | None = None, + limit: Any | None = None, *, raw: bool = False, fields: Sequence[str] | str | None = None, @@ -32,6 +33,7 @@ def global_index_daily_kline( secid: 东方财富全球指数编码,如 100.NDX、100.DJIA、100.SPX、100.HSI、100.N225 (type: string; required: Y). start_date: 开始日期 YYYY-MM-DD(含) (type: string; required: N). end_date: 结束日期 YYYY-MM-DD(含) (type: string; required: N). + limit: 返回根数上限,最大 5000 (type: int; required: N). raw: Return the decoded JSON payload without tabular extraction. fields: Optional field list or comma-separated field string applied after extraction. as_dataframe: Return a pandas ``DataFrame`` by default; set to ``False`` for Python rows. @@ -42,7 +44,7 @@ def global_index_daily_kline( ``as_dataframe=False``, raw JSON when ``raw=True``, or raw page payloads when multi-page fetching is used with ``raw=True``. """ - request_params = {'secid': secid, 'start_date': start_date, 'end_date': end_date} + request_params = {'secid': secid, 'start_date': start_date, 'end_date': end_date, 'limit': limit} request_params.update(kwargs) return self._call_endpoint( 'global_index_daily_kline', @@ -70,7 +72,7 @@ def index_candlesticks( """指数K线. Endpoint: ``api/v1/market/data/index-candlesticks``. - Method: ``POST``. + Method: ``GET``. Documented endpoint: ``index_candlesticks``. Args: @@ -101,55 +103,6 @@ def index_candlesticks( **request_params, ) - def index_candlesticks_batch( - self, - symbols: Any | None = None, - interval_unit: Any | None = None, - interval_value: Any | None = None, - adjust_kind: Any | None = None, - since_ts_millis: Any | None = None, - until_ts_millis: Any | None = None, - limit: Any | None = None, - *, - raw: bool = False, - fields: Sequence[str] | str | None = None, - as_dataframe: bool = True, - **kwargs: Any, - ) -> Any: - """批量指数K线. - - Endpoint: ``api/v1/market/data/index-candlesticks/batch``. - Method: ``POST``. - Documented endpoint: ``index_candlesticks_batch``. - - Args: - symbols: 指数代码列表,如 ["000300.XSHG","399001.XSHE"];也接受 .SH、.SZ 短后缀 (type: string[]; required: Y). - interval_unit: 周期单位:Minute/Day/Week/Month/Year (type: enum; required: Y). - interval_value: 间隔数值,默认 1;例如 Minute+5 表示 5 分钟 K 线 (type: int; required: N). - adjust_kind: 复权:None(默认,不复权)/Forward(前复权)/Backward(后复权) (type: enum; required: N). - since_ts_millis: 开始时间戳,单位毫秒;分钟 K 线与 until 的跨度 ≤3 天 (type: int(ms); required: N). - until_ts_millis: 结束时间戳,单位毫秒 (type: int(ms); required: Y). - limit: 每个标的的返回条数上限;未传 since 和 limit 时默认最多返回 50 根 K 线 (type: int; required: N). - raw: Return the decoded JSON payload without tabular extraction. - fields: Optional field list or comma-separated field string applied after extraction. - as_dataframe: Return a pandas ``DataFrame`` by default; set to ``False`` for Python rows. - **kwargs: Extra request parameters forwarded unchanged. Useful when the service adds parameters before the SDK is regenerated. - - Returns: - A pandas ``DataFrame`` by default, Python rows when - ``as_dataframe=False``, raw JSON when ``raw=True``, or raw page - payloads when multi-page fetching is used with ``raw=True``. - """ - request_params = {'symbols': symbols, 'interval_unit': interval_unit, 'interval_value': interval_value, 'adjust_kind': adjust_kind, 'since_ts_millis': since_ts_millis, 'until_ts_millis': until_ts_millis, 'limit': limit} - request_params.update(kwargs) - return self._call_endpoint( - 'index_candlesticks_batch', - raw=raw, - fields=fields, - as_dataframe=as_dataframe, - **request_params, - ) - def index_description_list( self, page: int | None = None, @@ -314,6 +267,11 @@ def index_weight_summary( def index_description_all( self, + page: int | None = None, + page_size: int | None = None, + limit: int | None = None, + all_pages: bool = False, + max_pages: int | None = None, *, raw: bool = False, fields: Sequence[str] | str | None = None, @@ -339,8 +297,14 @@ def index_description_all( """ request_params = {} request_params.update(kwargs) - return self._call_endpoint( - 'index_description_all', + path = ENDPOINTS['index_description_all'].path + return self.get_paginated( + path, + page=page, + page_size=page_size, + limit=limit, + all_pages=all_pages, + max_pages=max_pages, raw=raw, fields=fields, as_dataframe=as_dataframe, @@ -497,3 +461,22 @@ def sw_industry_overview( as_dataframe=as_dataframe, **request_params, ) + def index_minutes(self, symbol: Any | None = None, interval_value: Any | None = None, since_ts_millis: Any | None = None, until_ts_millis: Any | None = None, limit: Any | None = None, *, raw: bool = False, fields: Sequence[str] | str | None = None, as_dataframe: bool = True, **kwargs: Any) -> Any: + """指数历史分钟行情.""" + params = {'symbol': symbol, 'interval_value': interval_value, 'since_ts_millis': since_ts_millis, 'until_ts_millis': until_ts_millis, 'limit': limit} + params.update(kwargs) + return self._call_endpoint('index_minutes', raw=raw, fields=fields, as_dataframe=as_dataframe, **params) + + + def index_realtime_minute_kline(self, symbols: Any | None = None, *, raw: bool = False, fields: Sequence[str] | str | None = None, as_dataframe: bool = True, **kwargs: Any) -> Any: + """指数实时分钟K线.""" + params = {'symbols': symbols} + params.update(kwargs) + return self._call_endpoint('index_realtime_minute_kline', raw=raw, fields=fields, as_dataframe=as_dataframe, **params) + + + def index_realtime_day_kline(self, symbols: Any | None = None, *, raw: bool = False, fields: Sequence[str] | str | None = None, as_dataframe: bool = True, **kwargs: Any) -> Any: + """指数实时日K线.""" + params = {'symbols': symbols} + params.update(kwargs) + return self._call_endpoint('index_realtime_day_kline', raw=raw, fields=fields, as_dataframe=as_dataframe, **params) diff --git a/src/ftshare/apis/llm_corpus.py b/src/ftshare/apis/llm_corpus.py index 749cd4a..23c0d2e 100644 --- a/src/ftshare/apis/llm_corpus.py +++ b/src/ftshare/apis/llm_corpus.py @@ -107,63 +107,6 @@ def semantic_search_news( **request_params, ) - def type_reports( - self, - rept_type: Any | None = None, - start_date: Any | None = None, - end_date: Any | None = None, - page: int | None = None, - page_size: int | None = None, - limit: int | None = None, - all_pages: bool = False, - max_pages: int | None = None, - *, - raw: bool = False, - fields: Sequence[str] | str | None = None, - as_dataframe: bool = True, - **kwargs: Any, - ) -> Any: - """研报分类. - - Endpoint: ``api/v1/market/data/report/type-reports``. - Method: ``GET``. - Documented endpoint: ``type_reports``. - - Args: - rept_type: 研报类型:MacroReport / IndustryReport / BrokerMorningReport / StrategyReport / NewStockReport (type: string; required: Y). - start_date: 开始日期 YYYYMMDD (type: string; required: Y). - end_date: 结束日期 YYYYMMDD,不填默认与 `start_date` 相同 (type: string; required: N). - page: Page number, starting from 1. If omitted, the server default is used unless ``limit`` or ``all_pages`` is set. - page_size: Rows per page. The SDK validates this against the endpoint-specific maximum. - limit: Maximum number of rows to return. The SDK may fetch multiple pages to satisfy this limit. - all_pages: Fetch and combine pages until the server reports the last page. - max_pages: Optional safety cap for ``all_pages``. - raw: Return the decoded JSON payload without tabular extraction. - fields: Optional field list or comma-separated field string applied after extraction. - as_dataframe: Return a pandas ``DataFrame`` by default; set to ``False`` for Python rows. - **kwargs: Extra request parameters forwarded unchanged. Useful when the service adds parameters before the SDK is regenerated. - - Returns: - A pandas ``DataFrame`` by default, Python rows when - ``as_dataframe=False``, raw JSON when ``raw=True``, or raw page - payloads when multi-page fetching is used with ``raw=True``. - """ - request_params = {'rept_type': rept_type, 'start_date': start_date, 'end_date': end_date} - request_params.update(kwargs) - path = ENDPOINTS['type_reports'].path - return self.get_paginated( - path, - page=page, - page_size=page_size, - limit=limit, - all_pages=all_pages, - max_pages=max_pages, - raw=raw, - fields=fields, - as_dataframe=as_dataframe, - **request_params, - ) - def stock_announcements( self, stock_code: Any | None = None, @@ -183,7 +126,7 @@ def stock_announcements( ) -> Any: """公告列表. - Endpoint: ``api/v1/market/data/announcements/stock-announcements``. + Endpoint: ``api/v3/market/data/announcements/stock-announcements``. Method: ``GET``. Documented endpoint: ``stock_announcements``. @@ -242,7 +185,7 @@ def stock_reports( ) -> Any: """研报列表. - Endpoint: ``api/v1/market/data/report/stock-reports``. + Endpoint: ``api/v3/market/data/report/stock-reports``. Method: ``GET``. Documented endpoint: ``stock_reports``. diff --git a/src/ftshare/apis/spot.py b/src/ftshare/apis/spot.py index 97efb2b..0d8e537 100644 --- a/src/ftshare/apis/spot.py +++ b/src/ftshare/apis/spot.py @@ -67,38 +67,3 @@ def bullion_price( as_dataframe=as_dataframe, **request_params, ) - - def bullion_support_symbol( - self, - *, - raw: bool = False, - fields: Sequence[str] | str | None = None, - as_dataframe: bool = True, - **kwargs: Any, - ) -> Any: - """贵金属支持标的. - - Endpoint: ``api/v1/market/data/bullion/support-symbol``. - Method: ``GET``. - Documented endpoint: ``get_bullion_support_symbol``. - - Args: - raw: Return the decoded JSON payload without tabular extraction. - fields: Optional field list or comma-separated field string applied after extraction. - as_dataframe: Return a pandas ``DataFrame`` by default; set to ``False`` for Python rows. - **kwargs: Extra request parameters forwarded unchanged. Useful when the service adds parameters before the SDK is regenerated. - - Returns: - A pandas ``DataFrame`` by default, Python rows when - ``as_dataframe=False``, raw JSON when ``raw=True``, or raw page - payloads when multi-page fetching is used with ``raw=True``. - """ - request_params = {} - request_params.update(kwargs) - return self._call_endpoint( - 'bullion_support_symbol', - raw=raw, - fields=fields, - as_dataframe=as_dataframe, - **request_params, - ) diff --git a/src/ftshare/apis/stock.py b/src/ftshare/apis/stock.py index ffeda6c..0f312f0 100644 --- a/src/ftshare/apis/stock.py +++ b/src/ftshare/apis/stock.py @@ -131,69 +131,6 @@ def cashflow( **request_params, ) - def daec_ohlcs( - self, - symbol: Any | None = None, - since: Any | None = None, - until: Any | None = None, - interval: Any | None = None, - adjust: Any | None = None, - compat: Any | None = None, - span: Any | None = None, - limit: Any | None = None, - until_ts_ms: Any | None = None, - *, - raw: bool = False, - fields: Sequence[str] | str | None = None, - as_dataframe: bool = True, - **kwargs: Any, - ) -> Any: - """DAEC历史OHLC. - - Endpoint: ``api/v1/market/data/daec/history/ohlcs``. - Method: ``GET``. - Documented endpoint: ``daec_ohlcs``. - - Args: - symbol: 标的代码 (type: string; required: Y). - since: 起始时间 (type: string; required: N). - until: 截止时间 (type: string; required: N). - interval: K 线周期 (type: string; required: N). - adjust: 复权类型 (type: string; required: N). - compat: 兼容模式 (type: string; required: N). - span: 时间跨度 (type: string; required: N). - limit: 返回条数 (type: int; required: N). - until_ts_ms: 截止时间戳(毫秒) (type: int; required: N). - raw: Return the decoded JSON payload without tabular extraction. - fields: Optional field list or comma-separated field string applied after extraction. - as_dataframe: Return a pandas ``DataFrame`` by default; set to ``False`` for Python rows. - **kwargs: Extra request parameters forwarded unchanged. Useful when the service adds parameters before the SDK is regenerated. - - Returns: - A pandas ``DataFrame`` by default, Python rows when - ``as_dataframe=False``, raw JSON when ``raw=True``, or raw page - payloads when multi-page fetching is used with ``raw=True``. - """ - request_params = { - 'symbol': symbol, - 'since': since, - 'until': until, - 'interval': interval, - 'adjust': adjust, - 'compat': compat, - 'span': span, - 'limit': limit, - 'until_ts_ms': until_ts_ms, - } - request_params.update(kwargs) - return self._call_endpoint( - 'daec_ohlcs', - raw=raw, - fields=fields, - as_dataframe=as_dataframe, - **request_params, - ) - def cashflow_stock_code( self, *, @@ -650,68 +587,6 @@ def goodwill_stock_impairment( **request_params, ) - def stk_ah_comparison( - self, - hk_code: Any | None = None, - ts_code: Any | None = None, - trade_date: Any | None = None, - start_date: Any | None = None, - end_date: Any | None = None, - page: int | None = None, - page_size: int | None = None, - limit: int | None = None, - all_pages: bool = False, - max_pages: int | None = None, - *, - raw: bool = False, - fields: Sequence[str] | str | None = None, - as_dataframe: bool = True, - **kwargs: Any, - ) -> Any: - """AH股对比. - - Endpoint: ``api/v1/market/data/hk/stk-ah-comparison``. - Method: ``GET``. - Documented endpoint: ``get_stk_ah_comparison``. - - Args: - hk_code: 港股股票代码,支持 `700` 或 `00700.HK` (type: string; required: N). - ts_code: A 股股票代码,格式 `xxxxxx.SH/SZ/BJ` (type: string; required: N). - trade_date: 交易日期 YYYYMMDD (type: int32; required: N). - start_date: 起始日期 YYYYMMDD (type: int32; required: N). - end_date: 结束日期 YYYYMMDD (type: int32; required: N). - page: Page number, starting from 1. If omitted, the server default is used unless ``limit`` or ``all_pages`` is set. - page_size: Rows per page. The SDK validates this against the endpoint-specific maximum. - limit: Maximum number of rows to return. The SDK may fetch multiple pages to satisfy this limit. - all_pages: Fetch and combine pages until the server reports the last page. - max_pages: Optional safety cap for ``all_pages``. - raw: Return the decoded JSON payload without tabular extraction. - fields: Optional field list or comma-separated field string applied after extraction. - as_dataframe: Return a pandas ``DataFrame`` by default; set to ``False`` for Python rows. - **kwargs: Extra request parameters forwarded unchanged. Useful when the service adds parameters before the SDK is regenerated. - - Returns: - A pandas ``DataFrame`` by default, Python rows when - ``as_dataframe=False``, raw JSON when ``raw=True``, or raw page - payloads when multi-page fetching is used with ``raw=True``. - """ - request_params = {'hk_code': hk_code, 'ts_code': ts_code, 'trade_date': trade_date, 'start_date': start_date, 'end_date': end_date} - request_params.update(kwargs) - path = ENDPOINTS['stk_ah_comparison'].path - return self.get_paginated( - path, - page=page, - page_size=page_size, - limit=limit, - all_pages=all_pages, - max_pages=max_pages, - max_page_size=1000, - raw=raw, - fields=fields, - as_dataframe=as_dataframe, - **request_params, - ) - def stock_float_holders( self, stock_code: Any | None = None, @@ -767,118 +642,6 @@ def stock_float_holders( **request_params, ) - def stock_ggcg_em( - self, - symbol: Any | None = None, - page: int | None = None, - page_size: int | None = None, - limit: int | None = None, - all_pages: bool = False, - max_pages: int | None = None, - *, - raw: bool = False, - fields: Sequence[str] | str | None = None, - as_dataframe: bool = True, - **kwargs: Any, - ) -> Any: - """东方财富股东增减持. - - Endpoint: ``api/v1/market/data/holder/stock-ggcg-em``. - Method: ``GET``. - Documented endpoint: ``stock_ggcg_em_handler``. - - Args: - symbol: 数据类型:全部 / 股东增持 / 股东减持,默认全部 (type: string; required: N). - page: Page number, starting from 1. If omitted, the server default is used unless ``limit`` or ``all_pages`` is set. - page_size: Rows per page. The SDK validates this against the endpoint-specific maximum. - limit: Maximum number of rows to return. The SDK may fetch multiple pages to satisfy this limit. - all_pages: Fetch and combine pages until the server reports the last page. - max_pages: Optional safety cap for ``all_pages``. - raw: Return the decoded JSON payload without tabular extraction. - fields: Optional field list or comma-separated field string applied after extraction. - as_dataframe: Return a pandas ``DataFrame`` by default; set to ``False`` for Python rows. - **kwargs: Extra request parameters forwarded unchanged. Useful when the service adds parameters before the SDK is regenerated. - - Returns: - A pandas ``DataFrame`` by default, Python rows when - ``as_dataframe=False``, raw JSON when ``raw=True``, or raw page - payloads when multi-page fetching is used with ``raw=True``. - """ - request_params = {'symbol': symbol} - request_params.update(kwargs) - path = ENDPOINTS['stock_ggcg_em'].path - return self.get_paginated( - path, - page=page, - page_size=page_size, - limit=limit, - all_pages=all_pages, - max_pages=max_pages, - raw=raw, - fields=fields, - as_dataframe=as_dataframe, - **request_params, - ) - - def stock_ggmx( - self, - stock_code: Any | None = None, - change_direction: Any | None = None, - start_date: Any | None = None, - end_date: Any | None = None, - page: int | None = None, - page_size: int | None = None, - limit: int | None = None, - all_pages: bool = False, - max_pages: int | None = None, - *, - raw: bool = False, - fields: Sequence[str] | str | None = None, - as_dataframe: bool = True, - **kwargs: Any, - ) -> Any: - """董监高持股变动. - - Endpoint: ``api/v1/market/data/holder/stock-ggmx``. - Method: ``GET``. - Documented endpoint: ``stock_ggmx_handler``. - - Args: - stock_code: 股票代码(如 600001),别名 stockCode (type: string; required: N). - change_direction: 变动方向:增持 / 减持,别名 changeDirection (type: string; required: N). - start_date: 变动日期起始 YYYY-MM-DD,别名 startDate (type: string; required: N). - end_date: 变动日期截止 YYYY-MM-DD,别名 endDate (type: string; required: N). - page: Page number, starting from 1. If omitted, the server default is used unless ``limit`` or ``all_pages`` is set. - page_size: Rows per page. The SDK validates this against the endpoint-specific maximum. - limit: Maximum number of rows to return. The SDK may fetch multiple pages to satisfy this limit. - all_pages: Fetch and combine pages until the server reports the last page. - max_pages: Optional safety cap for ``all_pages``. - raw: Return the decoded JSON payload without tabular extraction. - fields: Optional field list or comma-separated field string applied after extraction. - as_dataframe: Return a pandas ``DataFrame`` by default; set to ``False`` for Python rows. - **kwargs: Extra request parameters forwarded unchanged. Useful when the service adds parameters before the SDK is regenerated. - - Returns: - A pandas ``DataFrame`` by default, Python rows when - ``as_dataframe=False``, raw JSON when ``raw=True``, or raw page - payloads when multi-page fetching is used with ``raw=True``. - """ - request_params = {'stock_code': stock_code, 'change_direction': change_direction, 'start_date': start_date, 'end_date': end_date} - request_params.update(kwargs) - path = ENDPOINTS['stock_ggmx'].path - return self.get_paginated( - path, - page=page, - page_size=page_size, - limit=limit, - all_pages=all_pages, - max_pages=max_pages, - raw=raw, - fields=fields, - as_dataframe=as_dataframe, - **request_params, - ) - def stock_ggmx_buy_ranking( self, time_range: Any | None = None, @@ -895,7 +658,7 @@ def stock_ggmx_buy_ranking( ) -> Any: """董监高增持排名. - Endpoint: ``api/v1/market/data/holder/stock-ggmx-buy-ranking``. + Endpoint: ``api/v3/market/data/holder/stock-ggmx-buy-ranking``. Method: ``GET``. Documented endpoint: ``stock_ggmx_buy_ranking_handler``. @@ -948,7 +711,7 @@ def stock_ggmx_sell_ranking( ) -> Any: """董监高减持排名. - Endpoint: ``api/v1/market/data/holder/stock-ggmx-sell-ranking``. + Endpoint: ``api/v3/market/data/holder/stock-ggmx-sell-ranking``. Method: ``GET``. Documented endpoint: ``stock_ggmx_sell_ranking_handler``. @@ -1213,6 +976,11 @@ def bse_mapping( self, o_code: Any | None = None, n_code: Any | None = None, + page: int | None = None, + page_size: int | None = None, + limit: int | None = None, + all_pages: bool = False, + max_pages: int | None = None, *, raw: bool = False, fields: Sequence[str] | str | None = None, @@ -1228,20 +996,26 @@ def bse_mapping( Args: o_code: 旧代码(如 `838163.BJ`) (type: string; required: N). n_code: 新代码(如 `920163.BJ`) (type: string; required: N). + page: Page number, starting from 1. + page_size: Rows per page, up to the endpoint-specific maximum. + limit: Maximum number of rows to return. The SDK may fetch multiple pages to satisfy this limit. + all_pages: Fetch and combine pages until the server reports the last page. + max_pages: Optional safety cap for ``all_pages``. raw: Return the decoded JSON payload without tabular extraction. fields: Optional field list or comma-separated field string applied after extraction. as_dataframe: Return a pandas ``DataFrame`` by default; set to ``False`` for Python rows. **kwargs: Extra request parameters forwarded unchanged. Useful when the service adds parameters before the SDK is regenerated. - - Returns: - A pandas ``DataFrame`` by default, Python rows when - ``as_dataframe=False``, raw JSON when ``raw=True``, or raw page - payloads when multi-page fetching is used with ``raw=True``. """ request_params = {'o_code': o_code, 'n_code': n_code} request_params.update(kwargs) - return self._call_endpoint( - 'bse_mapping', + path = ENDPOINTS['bse_mapping'].path + return self.get_paginated( + path, + page=page, + page_size=page_size, + limit=limit, + all_pages=all_pages, + max_pages=max_pages, raw=raw, fields=fields, as_dataframe=as_dataframe, @@ -1397,35 +1171,21 @@ def eastmoney_board_daily_kline( **request_params, ) - def eastmoney_all_board_daily_kline( + def eastmoney_concept_boards( self, - start_date: Any | None = None, - end_date: Any | None = None, - page: int | None = None, - page_size: int | None = None, - limit: int | None = None, - all_pages: bool = False, - max_pages: int | None = None, *, raw: bool = False, fields: Sequence[str] | str | None = None, as_dataframe: bool = True, **kwargs: Any, ) -> Any: - """东方财富全板块日线OHLC. + """东方财富概念板块. - Endpoint: ``api/v1/market/data/eastmoney-all-board-daily-ohlc``. + Endpoint: ``api/v1/market/data/eastmoney-concept-boards``. Method: ``GET``. - Documented endpoint: ``eastmoney_all_board_daily_kline``. + Documented endpoint: ``eastmoney_concept_boards``. Args: - start_date: 起始日期(含),YYYY-MM-DD 或 YYYYMMDD (type: string; required: N). - end_date: 截止日期(含),YYYY-MM-DD 或 YYYYMMDD (type: string; required: N). - page: Page number, starting from 1. If omitted, the server default is used unless ``limit`` or ``all_pages`` is set. - page_size: Rows per page. The SDK validates this against the endpoint-specific maximum. - limit: Maximum number of rows to return. The SDK may fetch multiple pages to satisfy this limit. - all_pages: Fetch and combine pages until the server reports the last page. - max_pages: Optional safety cap for ``all_pages``. raw: Return the decoded JSON payload without tabular extraction. fields: Optional field list or comma-separated field string applied after extraction. as_dataframe: Return a pandas ``DataFrame`` by default; set to ``False`` for Python rows. @@ -1436,26 +1196,21 @@ def eastmoney_all_board_daily_kline( ``as_dataframe=False``, raw JSON when ``raw=True``, or raw page payloads when multi-page fetching is used with ``raw=True``. """ - request_params = {'start_date': start_date, 'end_date': end_date} + request_params = {} request_params.update(kwargs) - path = ENDPOINTS['eastmoney_all_board_daily_kline'].path - return self.get_paginated( - path, - page=page, - page_size=page_size, - limit=limit, - all_pages=all_pages, - max_pages=max_pages, - max_page_size=ENDPOINTS['eastmoney_all_board_daily_kline'].max_page_size, + return self._call_endpoint( + 'eastmoney_concept_boards', raw=raw, fields=fields, as_dataframe=as_dataframe, **request_params, ) - def eastmoney_board_latest_kline( + def eastmoney_dapan_flow( self, - board_code: Any | None = None, + trade_date: Any | None = None, + start_date: Any | None = None, + end_date: Any | None = None, page: int | None = None, page_size: int | None = None, limit: int | None = None, @@ -1467,14 +1222,16 @@ def eastmoney_board_latest_kline( as_dataframe: bool = True, **kwargs: Any, ) -> Any: - """东方财富板块最新OHLC. + """东方财富大盘资金流. - Endpoint: ``api/v1/market/data/eastmoney-board-latest-ohlc``. + Endpoint: ``api/v1/market/data/eastmoney-dapan-flow``. Method: ``GET``. - Documented endpoint: ``eastmoney_board_latest_kline``. + Documented endpoint: ``get_eastmoney_dapan_flow``. Args: - board_code: 板块代码,如 BK1024;不传则返回全部板块最新K线 (type: string; required: N). + trade_date: 交易日 YYYYMMDD;与 start_date/end_date 互斥 (type: string; required: N). + start_date: 区间起始日 YYYYMMDD;需与 end_date 同时提供 (type: string; required: N). + end_date: 区间结束日 YYYYMMDD;需与 start_date 同时提供 (type: string; required: N). page: Page number, starting from 1. If omitted, the server default is used unless ``limit`` or ``all_pages`` is set. page_size: Rows per page. The SDK validates this against the endpoint-specific maximum. limit: Maximum number of rows to return. The SDK may fetch multiple pages to satisfy this limit. @@ -1490,9 +1247,9 @@ def eastmoney_board_latest_kline( ``as_dataframe=False``, raw JSON when ``raw=True``, or raw page payloads when multi-page fetching is used with ``raw=True``. """ - request_params = {'board_code': board_code} + request_params = {'trade_date': trade_date, 'start_date': start_date, 'end_date': end_date} request_params.update(kwargs) - path = ENDPOINTS['eastmoney_board_latest_kline'].path + path = ENDPOINTS['eastmoney_dapan_flow'].path return self.get_paginated( path, page=page, @@ -1506,118 +1263,26 @@ def eastmoney_board_latest_kline( **request_params, ) - def eastmoney_concept_boards( + def eastmoney_market_valuation( self, + market_code: Any | None = None, + trade_date: Any | None = None, + start_date: Any | None = None, + end_date: Any | None = None, + page: int | None = None, + page_size: int | None = None, + limit: int | None = None, + all_pages: bool = False, + max_pages: int | None = None, *, raw: bool = False, fields: Sequence[str] | str | None = None, as_dataframe: bool = True, **kwargs: Any, ) -> Any: - """东方财富概念板块. + """东方财富市场估值. - Endpoint: ``api/v1/market/data/eastmoney-concept-boards``. - Method: ``GET``. - Documented endpoint: ``eastmoney_concept_boards``. - - Args: - raw: Return the decoded JSON payload without tabular extraction. - fields: Optional field list or comma-separated field string applied after extraction. - as_dataframe: Return a pandas ``DataFrame`` by default; set to ``False`` for Python rows. - **kwargs: Extra request parameters forwarded unchanged. Useful when the service adds parameters before the SDK is regenerated. - - Returns: - A pandas ``DataFrame`` by default, Python rows when - ``as_dataframe=False``, raw JSON when ``raw=True``, or raw page - payloads when multi-page fetching is used with ``raw=True``. - """ - request_params = {} - request_params.update(kwargs) - return self._call_endpoint( - 'eastmoney_concept_boards', - raw=raw, - fields=fields, - as_dataframe=as_dataframe, - **request_params, - ) - - def eastmoney_dapan_flow( - self, - trade_date: Any | None = None, - start_date: Any | None = None, - end_date: Any | None = None, - page: int | None = None, - page_size: int | None = None, - limit: int | None = None, - all_pages: bool = False, - max_pages: int | None = None, - *, - raw: bool = False, - fields: Sequence[str] | str | None = None, - as_dataframe: bool = True, - **kwargs: Any, - ) -> Any: - """东方财富大盘资金流. - - Endpoint: ``api/v1/market/data/eastmoney-dapan-flow``. - Method: ``GET``. - Documented endpoint: ``get_eastmoney_dapan_flow``. - - Args: - trade_date: 交易日 YYYYMMDD;与 start_date/end_date 互斥 (type: string; required: N). - start_date: 区间起始日 YYYYMMDD;需与 end_date 同时提供 (type: string; required: N). - end_date: 区间结束日 YYYYMMDD;需与 start_date 同时提供 (type: string; required: N). - page: Page number, starting from 1. If omitted, the server default is used unless ``limit`` or ``all_pages`` is set. - page_size: Rows per page. The SDK validates this against the endpoint-specific maximum. - limit: Maximum number of rows to return. The SDK may fetch multiple pages to satisfy this limit. - all_pages: Fetch and combine pages until the server reports the last page. - max_pages: Optional safety cap for ``all_pages``. - raw: Return the decoded JSON payload without tabular extraction. - fields: Optional field list or comma-separated field string applied after extraction. - as_dataframe: Return a pandas ``DataFrame`` by default; set to ``False`` for Python rows. - **kwargs: Extra request parameters forwarded unchanged. Useful when the service adds parameters before the SDK is regenerated. - - Returns: - A pandas ``DataFrame`` by default, Python rows when - ``as_dataframe=False``, raw JSON when ``raw=True``, or raw page - payloads when multi-page fetching is used with ``raw=True``. - """ - request_params = {'trade_date': trade_date, 'start_date': start_date, 'end_date': end_date} - request_params.update(kwargs) - path = ENDPOINTS['eastmoney_dapan_flow'].path - return self.get_paginated( - path, - page=page, - page_size=page_size, - limit=limit, - all_pages=all_pages, - max_pages=max_pages, - raw=raw, - fields=fields, - as_dataframe=as_dataframe, - **request_params, - ) - - def eastmoney_market_valuation( - self, - market_code: Any | None = None, - trade_date: Any | None = None, - start_date: Any | None = None, - end_date: Any | None = None, - page: int | None = None, - page_size: int | None = None, - limit: int | None = None, - all_pages: bool = False, - max_pages: int | None = None, - *, - raw: bool = False, - fields: Sequence[str] | str | None = None, - as_dataframe: bool = True, - **kwargs: Any, - ) -> Any: - """东方财富市场估值. - - Endpoint: ``api/v1/market/data/eastmoney-market-valuation``. + Endpoint: ``api/v1/market/data/eastmoney-market-valuation``. Method: ``GET``. Documented endpoint: ``get_eastmoney_market_valuation``. @@ -1877,76 +1542,6 @@ def eastmoney_stock_valuation( **request_params, ) - def hk_sh_stock_connect_members( - self, - *, - raw: bool = False, - fields: Sequence[str] | str | None = None, - as_dataframe: bool = True, - **kwargs: Any, - ) -> Any: - """沪港通成份. - - Endpoint: ``api/v1/market/data/hk-sh-stock-connect-members``. - Method: ``GET``. - Documented endpoint: ``hk_sh_stock_connect_members``. - - Args: - raw: Return the decoded JSON payload without tabular extraction. - fields: Optional field list or comma-separated field string applied after extraction. - as_dataframe: Return a pandas ``DataFrame`` by default; set to ``False`` for Python rows. - **kwargs: Extra request parameters forwarded unchanged. Useful when the service adds parameters before the SDK is regenerated. - - Returns: - A pandas ``DataFrame`` by default, Python rows when - ``as_dataframe=False``, raw JSON when ``raw=True``, or raw page - payloads when multi-page fetching is used with ``raw=True``. - """ - request_params = {} - request_params.update(kwargs) - return self._call_endpoint( - 'hk_sh_stock_connect_members', - raw=raw, - fields=fields, - as_dataframe=as_dataframe, - **request_params, - ) - - def hk_sz_stock_connect_members( - self, - *, - raw: bool = False, - fields: Sequence[str] | str | None = None, - as_dataframe: bool = True, - **kwargs: Any, - ) -> Any: - """深港通成份. - - Endpoint: ``api/v1/market/data/hk-sz-stock-connect-members``. - Method: ``GET``. - Documented endpoint: ``hk_sz_stock_connect_members``. - - Args: - raw: Return the decoded JSON payload without tabular extraction. - fields: Optional field list or comma-separated field string applied after extraction. - as_dataframe: Return a pandas ``DataFrame`` by default; set to ``False`` for Python rows. - **kwargs: Extra request parameters forwarded unchanged. Useful when the service adds parameters before the SDK is regenerated. - - Returns: - A pandas ``DataFrame`` by default, Python rows when - ``as_dataframe=False``, raw JSON when ``raw=True``, or raw page - payloads when multi-page fetching is used with ``raw=True``. - """ - request_params = {} - request_params.update(kwargs) - return self._call_endpoint( - 'hk_sz_stock_connect_members', - raw=raw, - fields=fields, - as_dataframe=as_dataframe, - **request_params, - ) - def northbound( self, date: Any | None = None, @@ -2025,43 +1620,6 @@ def namechange( **request_params, ) - def nth_trade_date( - self, - n: Any | None = None, - *, - raw: bool = False, - fields: Sequence[str] | str | None = None, - as_dataframe: bool = True, - **kwargs: Any, - ) -> Any: - """第N个交易日. - - Endpoint: ``api/v1/market/data/time/get-nth-trade-date``. - Method: ``GET``. - Documented endpoint: ``get_nth_trade_date``. - - Args: - n: 需要获取的前 N 个交易日,N >= 1 (type: uint32; required: Y). - raw: Return the decoded JSON payload without tabular extraction. - fields: Optional field list or comma-separated field string applied after extraction. - as_dataframe: Return a pandas ``DataFrame`` by default; set to ``False`` for Python rows. - **kwargs: Extra request parameters forwarded unchanged. Useful when the service adds parameters before the SDK is regenerated. - - Returns: - A pandas ``DataFrame`` by default, Python rows when - ``as_dataframe=False``, raw JSON when ``raw=True``, or raw page - payloads when multi-page fetching is used with ``raw=True``. - """ - request_params = {'n': n} - request_params.update(kwargs) - return self._call_endpoint( - 'nth_trade_date', - raw=raw, - fields=fields, - as_dataframe=as_dataframe, - **request_params, - ) - def trading_calendar( self, market: Any | None = None, @@ -2185,41 +1743,6 @@ def search( **request_params, ) - def sh_hk_stock_connect_members( - self, - *, - raw: bool = False, - fields: Sequence[str] | str | None = None, - as_dataframe: bool = True, - **kwargs: Any, - ) -> Any: - """沪股通成份. - - Endpoint: ``api/v1/market/data/sh-hk-stock-connect-members``. - Method: ``GET``. - Documented endpoint: ``sh_hk_stock_connect_members``. - - Args: - raw: Return the decoded JSON payload without tabular extraction. - fields: Optional field list or comma-separated field string applied after extraction. - as_dataframe: Return a pandas ``DataFrame`` by default; set to ``False`` for Python rows. - **kwargs: Extra request parameters forwarded unchanged. Useful when the service adds parameters before the SDK is regenerated. - - Returns: - A pandas ``DataFrame`` by default, Python rows when - ``as_dataframe=False``, raw JSON when ``raw=True``, or raw page - payloads when multi-page fetching is used with ``raw=True``. - """ - request_params = {} - request_params.update(kwargs) - return self._call_endpoint( - 'sh_hk_stock_connect_members', - raw=raw, - fields=fields, - as_dataframe=as_dataframe, - **request_params, - ) - def southbound( self, date: Any | None = None, @@ -2310,21 +1833,33 @@ def suspension_list( **request_params, ) - def sz_hk_stock_connect_members( + def ths_board_kline( self, + board_code: Any | None = None, + page: int | None = None, + page_size: int | None = None, + limit: int | None = None, + all_pages: bool = False, + max_pages: int | None = None, *, raw: bool = False, fields: Sequence[str] | str | None = None, as_dataframe: bool = True, **kwargs: Any, ) -> Any: - """深股通成份. + """同花顺板块K线. - Endpoint: ``api/v1/market/data/sz-hk-stock-connect-members``. + Endpoint: ``api/v1/market/data/ths-board-kline``. Method: ``GET``. - Documented endpoint: ``sz_hk_stock_connect_members``. + Documented endpoint: ``ths_board_kline``. Args: + board_code: 板块代码,如 886056 (type: string; required: Y). + page: Page number, starting from 1. If omitted, the server default is used unless ``limit`` or ``all_pages`` is set. + page_size: Rows per page. The SDK validates this against the endpoint-specific maximum. + limit: Maximum number of rows to return. The SDK may fetch multiple pages to satisfy this limit. + all_pages: Fetch and combine pages until the server reports the last page. + max_pages: Optional safety cap for ``all_pages``. raw: Return the decoded JSON payload without tabular extraction. fields: Optional field list or comma-separated field string applied after extraction. as_dataframe: Return a pandas ``DataFrame`` by default; set to ``False`` for Python rows. @@ -2335,20 +1870,27 @@ def sz_hk_stock_connect_members( ``as_dataframe=False``, raw JSON when ``raw=True``, or raw page payloads when multi-page fetching is used with ``raw=True``. """ - request_params = {} + request_params = {'board_code': board_code} request_params.update(kwargs) - return self._call_endpoint( - 'sz_hk_stock_connect_members', + path = ENDPOINTS['ths_board_kline'].path + return self.get_paginated( + path, + page=page, + page_size=page_size, + limit=limit, + all_pages=all_pages, + max_pages=max_pages, raw=raw, fields=fields, as_dataframe=as_dataframe, **request_params, ) - def ths_all_board_kline( + def xueqiu_rank( self, - start_date: Any | None = None, - end_date: Any | None = None, + rank_group: Any | None = None, + period: Any | None = None, + trade_date: Any | None = None, page: int | None = None, page_size: int | None = None, limit: int | None = None, @@ -2360,155 +1902,11 @@ def ths_all_board_kline( as_dataframe: bool = True, **kwargs: Any, ) -> Any: - """同花顺全板块K线. + """雪球股票排名. - Endpoint: ``api/v1/market/data/ths-all-board-kline``. + Endpoint: ``api/v1/market/data/xueqiu-rank``. Method: ``GET``. - Documented endpoint: ``ths_all_board_kline``. - - Args: - start_date: 起始日期(含),YYYY-MM-DD 或 YYYYMMDD (type: string; required: N). - end_date: 截止日期(含),YYYY-MM-DD 或 YYYYMMDD (type: string; required: N). - page: Page number, starting from 1. If omitted, the server default is used unless ``limit`` or ``all_pages`` is set. - page_size: Rows per page. The SDK validates this against the endpoint-specific maximum. - limit: Maximum number of rows to return. The SDK may fetch multiple pages to satisfy this limit. - all_pages: Fetch and combine pages until the server reports the last page. - max_pages: Optional safety cap for ``all_pages``. - raw: Return the decoded JSON payload without tabular extraction. - fields: Optional field list or comma-separated field string applied after extraction. - as_dataframe: Return a pandas ``DataFrame`` by default; set to ``False`` for Python rows. - **kwargs: Extra request parameters forwarded unchanged. Useful when the service adds parameters before the SDK is regenerated. - - Returns: - A pandas ``DataFrame`` by default, Python rows when - ``as_dataframe=False``, raw JSON when ``raw=True``, or raw page - payloads when multi-page fetching is used with ``raw=True``. - """ - request_params = {'start_date': start_date, 'end_date': end_date} - request_params.update(kwargs) - path = ENDPOINTS['ths_all_board_kline'].path - return self.get_paginated( - path, - page=page, - page_size=page_size, - limit=limit, - all_pages=all_pages, - max_pages=max_pages, - raw=raw, - fields=fields, - as_dataframe=as_dataframe, - **request_params, - ) - - def ths_board_kline( - self, - board_code: Any | None = None, - page: int | None = None, - page_size: int | None = None, - limit: int | None = None, - all_pages: bool = False, - max_pages: int | None = None, - *, - raw: bool = False, - fields: Sequence[str] | str | None = None, - as_dataframe: bool = True, - **kwargs: Any, - ) -> Any: - """同花顺板块K线. - - Endpoint: ``api/v1/market/data/ths-board-kline``. - Method: ``GET``. - Documented endpoint: ``ths_board_kline``. - - Args: - board_code: 板块代码,如 886056 (type: string; required: Y). - page: Page number, starting from 1. If omitted, the server default is used unless ``limit`` or ``all_pages`` is set. - page_size: Rows per page. The SDK validates this against the endpoint-specific maximum. - limit: Maximum number of rows to return. The SDK may fetch multiple pages to satisfy this limit. - all_pages: Fetch and combine pages until the server reports the last page. - max_pages: Optional safety cap for ``all_pages``. - raw: Return the decoded JSON payload without tabular extraction. - fields: Optional field list or comma-separated field string applied after extraction. - as_dataframe: Return a pandas ``DataFrame`` by default; set to ``False`` for Python rows. - **kwargs: Extra request parameters forwarded unchanged. Useful when the service adds parameters before the SDK is regenerated. - - Returns: - A pandas ``DataFrame`` by default, Python rows when - ``as_dataframe=False``, raw JSON when ``raw=True``, or raw page - payloads when multi-page fetching is used with ``raw=True``. - """ - request_params = {'board_code': board_code} - request_params.update(kwargs) - path = ENDPOINTS['ths_board_kline'].path - return self.get_paginated( - path, - page=page, - page_size=page_size, - limit=limit, - all_pages=all_pages, - max_pages=max_pages, - raw=raw, - fields=fields, - as_dataframe=as_dataframe, - **request_params, - ) - - def ths_board_list( - self, - *, - raw: bool = False, - fields: Sequence[str] | str | None = None, - as_dataframe: bool = True, - **kwargs: Any, - ) -> Any: - """同花顺板块列表. - - Endpoint: ``api/v1/market/data/ths-board-list``. - Method: ``GET``. - Documented endpoint: ``ths_board_list``. - - Args: - raw: Return the decoded JSON payload without tabular extraction. - fields: Optional field list or comma-separated field string applied after extraction. - as_dataframe: Return a pandas ``DataFrame`` by default; set to ``False`` for Python rows. - **kwargs: Extra request parameters forwarded unchanged. Useful when the service adds parameters before the SDK is regenerated. - - Returns: - A pandas ``DataFrame`` by default, Python rows when - ``as_dataframe=False``, raw JSON when ``raw=True``, or raw page - payloads when multi-page fetching is used with ``raw=True``. - """ - request_params = {} - request_params.update(kwargs) - return self._call_endpoint( - 'ths_board_list', - raw=raw, - fields=fields, - as_dataframe=as_dataframe, - **request_params, - ) - - def xueqiu_rank( - self, - rank_group: Any | None = None, - period: Any | None = None, - trade_date: Any | None = None, - page: int | None = None, - page_size: int | None = None, - limit: int | None = None, - all_pages: bool = False, - max_pages: int | None = None, - *, - raw: bool = False, - fields: Sequence[str] | str | None = None, - as_dataframe: bool = True, - **kwargs: Any, - ) -> Any: - """雪球股票排名. - - Endpoint: ``api/v1/market/data/xueqiu-rank``. - Method: ``GET``. - Documented endpoint: ``xueqiu_rank``. + Documented endpoint: ``xueqiu_rank``. Args: rank_group: 榜单组:`follow`(关注)/ `tweet`(讨论)/ `deal`(交易) (type: string; required: N). @@ -2562,7 +1960,7 @@ def yzxdr_detail( as_dataframe: bool = True, **kwargs: Any, ) -> Any: - """除权除息明细. + """一致行动人明细. Endpoint: ``api/v1/market/data/yzxdr-detail``. Method: ``GET``. @@ -2709,8 +2107,9 @@ def stock_pledge_detail( **request_params, ) - def stock_pledge_summary( + def abnormal_trading_details( self, + date: Any | None = None, page: int | None = None, page_size: int | None = None, limit: int | None = None, @@ -2721,53 +2120,6 @@ def stock_pledge_summary( fields: Sequence[str] | str | None = None, as_dataframe: bool = True, **kwargs: Any, - ) -> Any: - """股权质押汇总. - - Endpoint: ``api/v1/market/data/pledge/pledge-summary``. - Method: ``GET``. - Documented endpoint: ``stock_pledge_summary``. - - Args: - page: Page number, starting from 1. If omitted, the server default is used unless ``limit`` or ``all_pages`` is set. - page_size: Rows per page. The SDK validates this against the endpoint-specific maximum. - limit: Maximum number of rows to return. The SDK may fetch multiple pages to satisfy this limit. - all_pages: Fetch and combine pages until the server reports the last page. - max_pages: Optional safety cap for ``all_pages``. - raw: Return the decoded JSON payload without tabular extraction. - fields: Optional field list or comma-separated field string applied after extraction. - as_dataframe: Return a pandas ``DataFrame`` by default; set to ``False`` for Python rows. - **kwargs: Extra request parameters forwarded unchanged. Useful when the service adds parameters before the SDK is regenerated. - - Returns: - A pandas ``DataFrame`` by default, Python rows when - ``as_dataframe=False``, raw JSON when ``raw=True``, or raw page - payloads when multi-page fetching is used with ``raw=True``. - """ - request_params = {} - request_params.update(kwargs) - path = ENDPOINTS['stock_pledge_summary'].path - return self.get_paginated( - path, - page=page, - page_size=page_size, - limit=limit, - all_pages=all_pages, - max_pages=max_pages, - raw=raw, - fields=fields, - as_dataframe=as_dataframe, - **request_params, - ) - - def abnormal_trading_details( - self, - date: Any | None = None, - *, - raw: bool = False, - fields: Sequence[str] | str | None = None, - as_dataframe: bool = True, - **kwargs: Any, ) -> Any: """龙虎榜明细. @@ -2789,313 +2141,7 @@ def abnormal_trading_details( """ request_params = {'date': date} request_params.update(kwargs) - return self._call_endpoint( - 'abnormal_trading_details', - raw=raw, - fields=fields, - as_dataframe=as_dataframe, - **request_params, - ) - - def abnormal_trading_overview( - self, - date: Any | None = None, - *, - raw: bool = False, - fields: Sequence[str] | str | None = None, - as_dataframe: bool = True, - **kwargs: Any, - ) -> Any: - """龙虎榜总览. - - Endpoint: ``api/v1/market/data/abnormal-trading-overview``. - Method: ``GET``. - Documented endpoint: ``abnormal_trading_overview``. - - Args: - date: 查询日期 YYYYMMDD;不传则使用当前内存快照 (type: string; required: N). - raw: Return the decoded JSON payload without tabular extraction. - fields: Optional field list or comma-separated field string applied after extraction. - as_dataframe: Return a pandas ``DataFrame`` by default; set to ``False`` for Python rows. - **kwargs: Extra request parameters forwarded unchanged. Useful when the service adds parameters before the SDK is regenerated. - - Returns: - A pandas ``DataFrame`` by default, Python rows when - ``as_dataframe=False``, raw JSON when ``raw=True``, or raw page - payloads when multi-page fetching is used with ``raw=True``. - """ - request_params = {'date': date} - request_params.update(kwargs) - return self._call_endpoint( - 'abnormal_trading_overview', - raw=raw, - fields=fields, - as_dataframe=as_dataframe, - **request_params, - ) - - def block_trades( - self, - date: Any | None = None, - *, - raw: bool = False, - fields: Sequence[str] | str | None = None, - as_dataframe: bool = True, - **kwargs: Any, - ) -> Any: - """大宗交易. - - Endpoint: ``api/v1/market/data/block-trades``. - Method: ``GET``. - Documented endpoint: ``block_trades``. - - Args: - date: 查询日期 YYYYMMDD;不传则使用当前内存快照 (type: string; required: N). - raw: Return the decoded JSON payload without tabular extraction. - fields: Optional field list or comma-separated field string applied after extraction. - as_dataframe: Return a pandas ``DataFrame`` by default; set to ``False`` for Python rows. - **kwargs: Extra request parameters forwarded unchanged. Useful when the service adds parameters before the SDK is regenerated. - - Returns: - A pandas ``DataFrame`` by default, Python rows when - ``as_dataframe=False``, raw JSON when ``raw=True``, or raw page - payloads when multi-page fetching is used with ``raw=True``. - """ - request_params = {'date': date} - request_params.update(kwargs) - return self._call_endpoint( - 'block_trades', - raw=raw, - fields=fields, - as_dataframe=as_dataframe, - **request_params, - ) - - def limit_down_pool( - self, - trade_date: Any | None = None, - *, - raw: bool = False, - fields: Sequence[str] | str | None = None, - as_dataframe: bool = True, - **kwargs: Any, - ) -> Any: - """跌停池. - - Endpoint: ``api/v1/market/data/limit-down-pool``. - Method: ``GET``. - Documented endpoint: ``limit_down_pool``. - - Args: - trade_date: 交易日期,格式 YYYYMMDD;不传或传当日时查询实时数据 (type: string; required: N). - raw: Return the decoded JSON payload without tabular extraction. - fields: Optional field list or comma-separated field string applied after extraction. - as_dataframe: Return a pandas ``DataFrame`` by default; set to ``False`` for Python rows. - **kwargs: Extra request parameters forwarded unchanged. Useful when the service adds parameters before the SDK is regenerated. - - Returns: - A pandas ``DataFrame`` by default, Python rows when - ``as_dataframe=False``, raw JSON when ``raw=True``, or raw page - payloads when multi-page fetching is used with ``raw=True``. - """ - request_params = {'trade_date': trade_date} - request_params.update(kwargs) - return self._call_endpoint( - 'limit_down_pool', - raw=raw, - fields=fields, - as_dataframe=as_dataframe, - **request_params, - ) - - def limit_event_timeline_3s( - self, - symbol: Any | None = None, - trade_date: Any | None = None, - *, - raw: bool = False, - fields: Sequence[str] | str | None = None, - as_dataframe: bool = True, - **kwargs: Any, - ) -> Any: - """涨跌停事件时间线. - - Endpoint: ``api/v1/market/data/limit-event-timeline-3s``. - Method: ``GET``. - Documented endpoint: ``limit_event_timeline_3s``. - - Args: - symbol: 标的代码,如 000001.XSHE;不传返回全市场 (type: string; required: N). - trade_date: 交易日期,格式 YYYYMMDD;不传或传当日时查询实时数据 (type: string; required: N). - raw: Return the decoded JSON payload without tabular extraction. - fields: Optional field list or comma-separated field string applied after extraction. - as_dataframe: Return a pandas ``DataFrame`` by default; set to ``False`` for Python rows. - **kwargs: Extra request parameters forwarded unchanged. Useful when the service adds parameters before the SDK is regenerated. - - Returns: - A pandas ``DataFrame`` by default, Python rows when - ``as_dataframe=False``, raw JSON when ``raw=True``, or raw page - payloads when multi-page fetching is used with ``raw=True``. - """ - request_params = {'symbol': symbol, 'trade_date': trade_date} - request_params.update(kwargs) - return self._call_endpoint( - 'limit_event_timeline_3s', - raw=raw, - fields=fields, - as_dataframe=as_dataframe, - **request_params, - ) - - def limit_up_break_pool( - self, - trade_date: Any | None = None, - *, - raw: bool = False, - fields: Sequence[str] | str | None = None, - as_dataframe: bool = True, - **kwargs: Any, - ) -> Any: - """炸板池. - - Endpoint: ``api/v1/market/data/limit-up-break-pool``. - Method: ``GET``. - Documented endpoint: ``limit_up_break_pool``. - - Args: - trade_date: 交易日期,格式 YYYYMMDD;不传或传当日时查询实时数据 (type: string; required: N). - raw: Return the decoded JSON payload without tabular extraction. - fields: Optional field list or comma-separated field string applied after extraction. - as_dataframe: Return a pandas ``DataFrame`` by default; set to ``False`` for Python rows. - **kwargs: Extra request parameters forwarded unchanged. Useful when the service adds parameters before the SDK is regenerated. - - Returns: - A pandas ``DataFrame`` by default, Python rows when - ``as_dataframe=False``, raw JSON when ``raw=True``, or raw page - payloads when multi-page fetching is used with ``raw=True``. - """ - request_params = {'trade_date': trade_date} - request_params.update(kwargs) - return self._call_endpoint( - 'limit_up_break_pool', - raw=raw, - fields=fields, - as_dataframe=as_dataframe, - **request_params, - ) - - def limit_up_pool( - self, - trade_date: Any | None = None, - *, - raw: bool = False, - fields: Sequence[str] | str | None = None, - as_dataframe: bool = True, - **kwargs: Any, - ) -> Any: - """涨停池. - - Endpoint: ``api/v1/market/data/limit-up-pool``. - Method: ``GET``. - Documented endpoint: ``limit_up_pool``. - - Args: - trade_date: 交易日期,格式 YYYYMMDD;不传或传当日时查询实时数据 (type: string; required: N). - raw: Return the decoded JSON payload without tabular extraction. - fields: Optional field list or comma-separated field string applied after extraction. - as_dataframe: Return a pandas ``DataFrame`` by default; set to ``False`` for Python rows. - **kwargs: Extra request parameters forwarded unchanged. Useful when the service adds parameters before the SDK is regenerated. - - Returns: - A pandas ``DataFrame`` by default, Python rows when - ``as_dataframe=False``, raw JSON when ``raw=True``, or raw page - payloads when multi-page fetching is used with ``raw=True``. - """ - request_params = {'trade_date': trade_date} - request_params.update(kwargs) - return self._call_endpoint( - 'limit_up_pool', - raw=raw, - fields=fields, - as_dataframe=as_dataframe, - **request_params, - ) - - def limit_up_pool_yesterday( - self, - *, - raw: bool = False, - fields: Sequence[str] | str | None = None, - as_dataframe: bool = True, - **kwargs: Any, - ) -> Any: - """昨日涨停池. - - Endpoint: ``api/v1/market/data/limit-up-pool-yesterday``. - Method: ``GET``. - Documented endpoint: ``limit_up_pool_yesterday``. - - Args: - raw: Return the decoded JSON payload without tabular extraction. - fields: Optional field list or comma-separated field string applied after extraction. - as_dataframe: Return a pandas ``DataFrame`` by default; set to ``False`` for Python rows. - **kwargs: Extra request parameters forwarded unchanged. Useful when the service adds parameters before the SDK is regenerated. - - Returns: - A pandas ``DataFrame`` by default, Python rows when - ``as_dataframe=False``, raw JSON when ``raw=True``, or raw page - payloads when multi-page fetching is used with ``raw=True``. - """ - request_params = {} - request_params.update(kwargs) - return self._call_endpoint( - 'limit_up_pool_yesterday', - raw=raw, - fields=fields, - as_dataframe=as_dataframe, - **request_params, - ) - - def margin_trading_details( - self, - date: Any | None = None, - page: int | None = None, - page_size: int | None = None, - limit: int | None = None, - all_pages: bool = False, - max_pages: int | None = None, - *, - raw: bool = False, - fields: Sequence[str] | str | None = None, - as_dataframe: bool = True, - **kwargs: Any, - ) -> Any: - """融资融券明细. - - Endpoint: ``api/v1/market/data/margin-trading-details``. - Method: ``GET``. - Documented endpoint: ``margin_trading_details``. - - Args: - date: 查询日期 YYYYMMDD;不传则使用当前内存快照 (type: string; required: N). - page: Page number, starting from 1. If omitted, the server default is used unless ``limit`` or ``all_pages`` is set. - page_size: Rows per page. The SDK validates this against the endpoint-specific maximum. - limit: Maximum number of rows to return. The SDK may fetch multiple pages to satisfy this limit. - all_pages: Fetch and combine pages until the server reports the last page. - max_pages: Optional safety cap for ``all_pages``. - raw: Return the decoded JSON payload without tabular extraction. - fields: Optional field list or comma-separated field string applied after extraction. - as_dataframe: Return a pandas ``DataFrame`` by default; set to ``False`` for Python rows. - **kwargs: Extra request parameters forwarded unchanged. Useful when the service adds parameters before the SDK is regenerated. - - Returns: - A pandas ``DataFrame`` by default, Python rows when - ``as_dataframe=False``, raw JSON when ``raw=True``, or raw page - payloads when multi-page fetching is used with ``raw=True``. - """ - request_params = {'date': date} - request_params.update(kwargs) - path = ENDPOINTS['margin_trading_details'].path + path = ENDPOINTS['abnormal_trading_details'].path return self.get_paginated( path, page=page, @@ -3109,7 +2155,7 @@ def margin_trading_details( **request_params, ) - def margin_trading_details_paginated( + def abnormal_trading_overview( self, date: Any | None = None, page: int | None = None, @@ -3123,19 +2169,14 @@ def margin_trading_details_paginated( as_dataframe: bool = True, **kwargs: Any, ) -> Any: - """融资融券明细分页. + """龙虎榜总览. - Endpoint: ``api/v1/market/data/margin-trading-details``. + Endpoint: ``api/v1/market/data/abnormal-trading-overview``. Method: ``GET``. - Documented endpoint: ``margin_trading_details_paginated``. - - Args: - date: 查询日期 YYYYMMDD;不传则使用当前内存快照 (type: string; required: N). - page: Page number, starting from 1. If omitted, the server default is used unless ``limit`` or ``all_pages`` is set. - page_size: Rows per page. The SDK validates this against the endpoint-specific maximum. - limit: Maximum number of rows to return. The SDK may fetch multiple pages to satisfy this limit. - all_pages: Fetch and combine pages until the server reports the last page. - max_pages: Optional safety cap for ``all_pages``. + Documented endpoint: ``abnormal_trading_overview``. + + Args: + date: 查询日期 YYYYMMDD;不传则使用当前内存快照 (type: string; required: N). raw: Return the decoded JSON payload without tabular extraction. fields: Optional field list or comma-separated field string applied after extraction. as_dataframe: Return a pandas ``DataFrame`` by default; set to ``False`` for Python rows. @@ -3148,7 +2189,7 @@ def margin_trading_details_paginated( """ request_params = {'date': date} request_params.update(kwargs) - path = ENDPOINTS['margin_trading_details_paginated'].path + path = ENDPOINTS['abnormal_trading_overview'].path return self.get_paginated( path, page=page, @@ -3162,23 +2203,28 @@ def margin_trading_details_paginated( **request_params, ) - def risk_warning_stock_quotes( + def block_trades( self, date: Any | None = None, + page: int | None = None, + page_size: int | None = None, + limit: int | None = None, + all_pages: bool = False, + max_pages: int | None = None, *, raw: bool = False, fields: Sequence[str] | str | None = None, as_dataframe: bool = True, **kwargs: Any, ) -> Any: - """风险警示股行情. + """大宗交易. - Endpoint: ``api/v1/market/data/risk-warning-stocks/quotes``. + Endpoint: ``api/v1/market/data/block-trades``. Method: ``GET``. - Documented endpoint: ``risk_warning_stock_quotes``. + Documented endpoint: ``block_trades``. Args: - date: 交易日,格式 YYYYMMDD (type: string; required: Y). + date: 查询日期 YYYYMMDD;不传则使用当前内存快照 (type: string; required: N). raw: Return the decoded JSON payload without tabular extraction. fields: Optional field list or comma-separated field string applied after extraction. as_dataframe: Return a pandas ``DataFrame`` by default; set to ``False`` for Python rows. @@ -3191,31 +2237,39 @@ def risk_warning_stock_quotes( """ request_params = {'date': date} request_params.update(kwargs) - return self._call_endpoint( - 'risk_warning_stock_quotes', + path = ENDPOINTS['block_trades'].path + return self.get_paginated( + path, + page=page, + page_size=page_size, + limit=limit, + all_pages=all_pages, + max_pages=max_pages, raw=raw, fields=fields, as_dataframe=as_dataframe, **request_params, ) - def risk_warning_stocks( + def limit_event_timeline_3s( self, - date: Any | None = None, + symbol: Any | None = None, + trade_date: Any | None = None, *, raw: bool = False, fields: Sequence[str] | str | None = None, as_dataframe: bool = True, **kwargs: Any, ) -> Any: - """风险警示股. + """涨跌停事件时间线. - Endpoint: ``api/v1/market/data/risk-warning-stocks``. + Endpoint: ``api/v1/market/data/limit-event-timeline-3s``. Method: ``GET``. - Documented endpoint: ``risk_warning_stocks``. + Documented endpoint: ``limit_event_timeline_3s``. Args: - date: 交易日,格式 YYYYMMDD (type: string; required: Y). + symbol: 标的代码,如 000001.XSHE;不传返回全市场 (type: string; required: N). + trade_date: 交易日期,格式 YYYYMMDD;不传或传当日时查询实时数据 (type: string; required: N). raw: Return the decoded JSON payload without tabular extraction. fields: Optional field list or comma-separated field string applied after extraction. as_dataframe: Return a pandas ``DataFrame`` by default; set to ``False`` for Python rows. @@ -3226,20 +2280,19 @@ def risk_warning_stocks( ``as_dataframe=False``, raw JSON when ``raw=True``, or raw page payloads when multi-page fetching is used with ``raw=True``. """ - request_params = {'date': date} + request_params = {'symbol': symbol, 'trade_date': trade_date} request_params.update(kwargs) return self._call_endpoint( - 'risk_warning_stocks', + 'limit_event_timeline_3s', raw=raw, fields=fields, as_dataframe=as_dataframe, **request_params, ) - def report_announcement_list( + def margin_trading_details( self, date: Any | None = None, - sec_code: Any | None = None, page: int | None = None, page_size: int | None = None, limit: int | None = None, @@ -3251,15 +2304,14 @@ def report_announcement_list( as_dataframe: bool = True, **kwargs: Any, ) -> Any: - """报告公告列表. + """融资融券明细. - Endpoint: ``api/v1/market/data/report-announcements/list``. + Endpoint: ``api/v1/market/data/margin-trading-details``. Method: ``GET``. - Documented endpoint: ``report_announcement_list``. + Documented endpoint: ``margin_trading_details``. Args: - date: 公告日期 (type: string; required: N). - sec_code: 证券代码 (type: string; required: N). + date: 查询日期 YYYYMMDD;不传则使用当前内存快照 (type: string; required: N). page: Page number, starting from 1. If omitted, the server default is used unless ``limit`` or ``all_pages`` is set. page_size: Rows per page. The SDK validates this against the endpoint-specific maximum. limit: Maximum number of rows to return. The SDK may fetch multiple pages to satisfy this limit. @@ -3275,9 +2327,9 @@ def report_announcement_list( ``as_dataframe=False``, raw JSON when ``raw=True``, or raw page payloads when multi-page fetching is used with ``raw=True``. """ - request_params = {'date': date, 'sec_code': sec_code} + request_params = {'date': date} request_params.update(kwargs) - path = ENDPOINTS['report_announcement_list'].path + path = ENDPOINTS['margin_trading_details'].path return self.get_paginated( path, page=page, @@ -3285,30 +2337,29 @@ def report_announcement_list( limit=limit, all_pages=all_pages, max_pages=max_pages, - max_page_size=ENDPOINTS['report_announcement_list'].max_page_size, raw=raw, fields=fields, as_dataframe=as_dataframe, **request_params, ) - def report_announcement_summary( + def risk_warning_stock_quotes( self, - announcement_id: Any | None = None, + date: Any | None = None, *, raw: bool = False, fields: Sequence[str] | str | None = None, as_dataframe: bool = True, **kwargs: Any, ) -> Any: - """报告公告摘要. + """风险警示股行情. - Endpoint: ``api/v1/market/data/report-announcements/summary``. + Endpoint: ``api/v1/market/data/risk-warning-stocks/quotes``. Method: ``GET``. - Documented endpoint: ``report_announcement_summary``. + Documented endpoint: ``risk_warning_stock_quotes``. Args: - announcement_id: 公告 ID (type: string; required: Y). + date: 交易日,格式 YYYYMMDD (type: string; required: Y). raw: Return the decoded JSON payload without tabular extraction. fields: Optional field list or comma-separated field string applied after extraction. as_dataframe: Return a pandas ``DataFrame`` by default; set to ``False`` for Python rows. @@ -3319,37 +2370,38 @@ def report_announcement_summary( ``as_dataframe=False``, raw JSON when ``raw=True``, or raw page payloads when multi-page fetching is used with ``raw=True``. """ - request_params = {'announcement_id': announcement_id} + request_params = {'date': date} request_params.update(kwargs) return self._call_endpoint( - 'report_announcement_summary', + 'risk_warning_stock_quotes', raw=raw, fields=fields, as_dataframe=as_dataframe, **request_params, ) - def stk_code_change( + def risk_warning_stocks( self, - trade_code: Any | None = None, - start_date: Any | None = None, - end_date: Any | None = None, + date: Any | None = None, + page: int | None = None, + page_size: int | None = None, + limit: int | None = None, + all_pages: bool = False, + max_pages: int | None = None, *, raw: bool = False, fields: Sequence[str] | str | None = None, as_dataframe: bool = True, **kwargs: Any, ) -> Any: - """A股代码变更. + """风险警示股. - Endpoint: ``api/v1/market/data/stk-code-change``. + Endpoint: ``api/v1/market/data/risk-warning-stocks``. Method: ``GET``. - Documented endpoint: ``get_stk_code_change``. + Documented endpoint: ``risk_warning_stocks``. Args: - trade_code: 股票代码(带 .SZ/.SH 后缀),支持逗号分隔多个 (type: string; required: Y). - start_date: 过滤区间起始日期,``YYYYMMDD`` 格式 (type: string; required: N). - end_date: 过滤区间结束日期,``YYYYMMDD`` 格式;与 ``start_date`` 同时提供时须 ``start_date`` ≤ ``end_date`` (type: string; required: N). + date: 交易日,格式 YYYYMMDD (type: string; required: Y). raw: Return the decoded JSON payload without tabular extraction. fields: Optional field list or comma-separated field string applied after extraction. as_dataframe: Return a pandas ``DataFrame`` by default; set to ``False`` for Python rows. @@ -3360,10 +2412,16 @@ def stk_code_change( ``as_dataframe=False``, raw JSON when ``raw=True``, or raw page payloads when multi-page fetching is used with ``raw=True``. """ - request_params = {'trade_code': trade_code, 'start_date': start_date, 'end_date': end_date} + request_params = {'date': date} request_params.update(kwargs) - return self._call_endpoint( - 'stk_code_change', + path = ENDPOINTS['risk_warning_stocks'].path + return self.get_paginated( + path, + page=page, + page_size=page_size, + limit=limit, + all_pages=all_pages, + max_pages=max_pages, raw=raw, fields=fields, as_dataframe=as_dataframe, @@ -3617,55 +2675,14 @@ def stk_premarket( **request_params, ) - def stk_status_change( - self, - trade_code: Any | None = None, - change_date: Any | None = None, - change_type: Any | None = None, - *, - raw: bool = False, - fields: Sequence[str] | str | None = None, - as_dataframe: bool = True, - **kwargs: Any, - ) -> Any: - """A股状态变更. - - Endpoint: ``api/v1/market/data/stk-status-change``. - Method: ``GET``. - Documented endpoint: ``get_stk_status_change``. - - Args: - trade_code: 股票代码(带 .SZ/.SH 后缀),支持逗号分隔多个;不填表示不按代码过滤 (type: string; required: N). - change_date: 变更日期,精确过滤,``YYYYMMDD`` 格式 (type: string; required: N). - change_type: 变更类型,精确过滤,常见值如 ``上市``、``退市``、``暂停上市`` (type: string; required: N). - raw: Return the decoded JSON payload without tabular extraction. - fields: Optional field list or comma-separated field string applied after extraction. - as_dataframe: Return a pandas ``DataFrame`` by default; set to ``False`` for Python rows. - **kwargs: Extra request parameters forwarded unchanged. Useful when the service adds parameters before the SDK is regenerated. - - Returns: - A pandas ``DataFrame`` by default, Python rows when - ``as_dataframe=False``, raw JSON when ``raw=True``, or raw page - payloads when multi-page fetching is used with ``raw=True``. - """ - request_params = {'trade_code': trade_code, 'change_date': change_date, 'change_type': change_type} - request_params.update(kwargs) - return self._call_endpoint( - 'stk_status_change', - raw=raw, - fields=fields, - as_dataframe=as_dataframe, - **request_params, - ) - def stock_adjust_factor( self, symbol: Any | None = None, trade_date: Any | None = None, start_date: Any | None = None, end_date: Any | None = None, - offset: Any | None = None, - limit: Any | None = None, + page: int | None = None, + page_size: int | None = None, *, raw: bool = False, fields: Sequence[str] | str | None = None, @@ -3683,8 +2700,8 @@ def stock_adjust_factor( trade_date: 交易日期 YYYYMMDD;空则默认当天,非交易日回退前一交易日 (type: string; required: N). start_date: 区间起始日期 YYYYMMDD;区间扫描必填且需配 symbol (type: string; required: N). end_date: 区间结束日期 YYYYMMDD;区间扫描必填且需配 symbol (type: string; required: N). - offset: 返回结果起始偏移 (type: int; required: N). - limit: 返回结果最大条数 (type: int; required: N). + page: 页码,从 1 开始。 + page_size: 每页条数,最大 2000。 raw: Return the decoded JSON payload without tabular extraction. fields: Optional field list or comma-separated field string applied after extraction. as_dataframe: Return a pandas ``DataFrame`` by default; set to ``False`` for Python rows. @@ -3695,7 +2712,7 @@ def stock_adjust_factor( ``as_dataframe=False``, raw JSON when ``raw=True``, or raw page payloads when multi-page fetching is used with ``raw=True``. """ - request_params = {'symbol': symbol, 'trade_date': trade_date, 'start_date': start_date, 'end_date': end_date, 'offset': offset, 'limit': limit} + request_params = {'symbol': symbol, 'trade_date': trade_date, 'start_date': start_date, 'end_date': end_date, 'page': page, 'page_size': page_size} request_params.update(kwargs) return self._call_endpoint( 'stock_adjust_factor', @@ -3723,7 +2740,7 @@ def stock_candlesticks( """股票K线. Endpoint: ``api/v1/market/data/stock-candlesticks``. - Method: ``POST``. + Method: ``GET``. Documented endpoint: ``stock_candlesticks``. Args: @@ -3754,58 +2771,11 @@ def stock_candlesticks( **request_params, ) - def stock_candlesticks_batch( - self, - symbols: Any | None = None, - interval_unit: Any | None = None, - interval_value: Any | None = None, - adjust_kind: Any | None = None, - since_ts_millis: Any | None = None, - until_ts_millis: Any | None = None, - limit: Any | None = None, - *, - raw: bool = False, - fields: Sequence[str] | str | None = None, - as_dataframe: bool = True, - **kwargs: Any, - ) -> Any: - """批量股票K线. - - Endpoint: ``api/v1/market/data/stock-candlesticks/batch``. - Method: ``POST``. - Documented endpoint: ``stock_candlesticks_batch``. - - Args: - symbols: 标的代码列表,允许股票、ETF、可转债和指数混合,例如 ["600519.SH","510300.SH","113027.SH","000300.SH"] (type: string[]; required: Y). - interval_unit: 周期单位:Minute/Day/Week/Month/Year (type: enum; required: Y). - interval_value: 间隔数值,默认 1;例如 Minute+5 表示 5 分钟 K 线 (type: int; required: N). - adjust_kind: 复权类型:None(默认)/Forward(前复权)/Backward(后复权) (type: enum; required: N). - since_ts_millis: 开始时间戳;分钟 K 线与 until 的跨度不超过 3 天 (type: int(ms); required: N). - until_ts_millis: 结束时间戳,单位毫秒 (type: int(ms); required: Y). - limit: 每个标的的返回条数上限;未传 since 和 limit 时默认 50 (type: int; required: N). - raw: Return the decoded JSON payload without tabular extraction. - fields: Optional field list or comma-separated field string applied after extraction. - as_dataframe: Return a pandas ``DataFrame`` by default; set to ``False`` for Python rows. - **kwargs: Extra request parameters forwarded unchanged. Useful when the service adds parameters before the SDK is regenerated. - - Returns: - A pandas ``DataFrame`` by default, Python rows when - ``as_dataframe=False``, raw JSON when ``raw=True``, or raw page - payloads when multi-page fetching is used with ``raw=True``. - """ - request_params = {'symbols': symbols, 'interval_unit': interval_unit, 'interval_value': interval_value, 'adjust_kind': adjust_kind, 'since_ts_millis': since_ts_millis, 'until_ts_millis': until_ts_millis, 'limit': limit} - request_params.update(kwargs) - return self._call_endpoint( - 'stock_candlesticks_batch', - raw=raw, - fields=fields, - as_dataframe=as_dataframe, - **request_params, - ) - def stock_capital_flows( self, date: Any | None = None, + time: Any | None = None, + symbol: Any | None = None, page: int | None = None, page_size: int | None = None, limit: int | None = None, @@ -3825,6 +2795,8 @@ def stock_capital_flows( Args: date: 查询日期 YYYYMMDD;传入时查询该日 15:30 快照 (type: string; required: N). + time: 15 分钟切片,格式 HHMM;必须与 date 同时使用 (type: string; required: N). + symbol: 精确股票代码,例如 600000.SH、000001.SZ、830001.BJ (type: string; required: N). page: Page number, starting from 1. If omitted, the server default is used unless ``limit`` or ``all_pages`` is set. page_size: Rows per page. The SDK validates this against the endpoint-specific maximum. limit: Maximum number of rows to return. The SDK may fetch multiple pages to satisfy this limit. @@ -3840,7 +2812,7 @@ def stock_capital_flows( ``as_dataframe=False``, raw JSON when ``raw=True``, or raw page payloads when multi-page fetching is used with ``raw=True``. """ - request_params = {'date': date} + request_params = {'date': date, 'time': time, 'symbol': symbol} request_params.update(kwargs) path = ENDPOINTS['stock_capital_flows'].path return self.get_paginated( @@ -3856,59 +2828,6 @@ def stock_capital_flows( **request_params, ) - def stock_capital_flows_paginated( - self, - date: Any | None = None, - page: int | None = None, - page_size: int | None = None, - limit: int | None = None, - all_pages: bool = False, - max_pages: int | None = None, - *, - raw: bool = False, - fields: Sequence[str] | str | None = None, - as_dataframe: bool = True, - **kwargs: Any, - ) -> Any: - """股票资金流向. - - Endpoint: ``api/v1/market/data/stock-capital-flows``. - Method: ``GET``. - Documented endpoint: ``stock_capital_flows_paginated``. - - Args: - date: 查询日期 YYYYMMDD;传入时查询该日 15:30 快照 (type: string; required: N). - page: Page number, starting from 1. If omitted, the server default is used unless ``limit`` or ``all_pages`` is set. - page_size: Rows per page. The SDK validates this against the endpoint-specific maximum. - limit: Maximum number of rows to return. The SDK may fetch multiple pages to satisfy this limit. - all_pages: Fetch and combine pages until the server reports the last page. - max_pages: Optional safety cap for ``all_pages``. - raw: Return the decoded JSON payload without tabular extraction. - fields: Optional field list or comma-separated field string applied after extraction. - as_dataframe: Return a pandas ``DataFrame`` by default; set to ``False`` for Python rows. - **kwargs: Extra request parameters forwarded unchanged. Useful when the service adds parameters before the SDK is regenerated. - - Returns: - A pandas ``DataFrame`` by default, Python rows when - ``as_dataframe=False``, raw JSON when ``raw=True``, or raw page - payloads when multi-page fetching is used with ``raw=True``. - """ - request_params = {'date': date} - request_params.update(kwargs) - path = ENDPOINTS['stock_capital_flows_paginated'].path - return self.get_paginated( - path, - page=page, - page_size=page_size, - limit=limit, - all_pages=all_pages, - max_pages=max_pages, - raw=raw, - fields=fields, - as_dataframe=as_dataframe, - **request_params, - ) - def stock_comment_desire_em( self, symbol: Any | None = None, @@ -4206,7 +3125,7 @@ def stock_institution_holdings( ``as_dataframe=False``, raw JSON when ``raw=True``, or raw page payloads when multi-page fetching is used with ``raw=True``. """ - request_params = {'year': year, 'report_type': report_type, 'inst_type': inst_type} + request_params = {'year': year, 'report_type': report_type, 'institution_type': inst_type} request_params.update(kwargs) path = ENDPOINTS['stock_institution_holdings'].path return self.get_paginated( @@ -4265,7 +3184,7 @@ def stock_institution_holdings_detail( ``as_dataframe=False``, raw JSON when ``raw=True``, or raw page payloads when multi-page fetching is used with ``raw=True``. """ - request_params = {'stock_code': stock_code, 'year': year, 'report_type': report_type, 'inst_type': inst_type} + request_params = {'stock_code': stock_code, 'year': year, 'report_type': report_type, 'institution_type': inst_type} request_params.update(kwargs) path = ENDPOINTS['stock_institution_holdings_detail'].path return self.get_paginated( @@ -4284,73 +3203,26 @@ def stock_institution_holdings_detail( def stock_institution_share_holdings( self, institution_id: Any | None = None, - year: Any | None = None, - report_type: Any | None = None, - invest_type: Any | None = None, - *, - raw: bool = False, - fields: Sequence[str] | str | None = None, - as_dataframe: bool = True, - **kwargs: Any, - ) -> Any: - """机构股本持股. - - Endpoint: ``api/v1/market/data/institution/institution-share-holdings``. - Method: ``GET``. - Documented endpoint: ``get_stock_institution_share_holdings``. - - Args: - institution_id: 机构 ID (type: string; required: Y). - year: 年份 (type: int; required: Y). - report_type: 报告类型:q1 / q2 / q3 / annual / announcement (type: ReportType; required: Y). - invest_type: 持仓类型:all / stock / fund / bond / other (type: InvestType; required: Y). - raw: Return the decoded JSON payload without tabular extraction. - fields: Optional field list or comma-separated field string applied after extraction. - as_dataframe: Return a pandas ``DataFrame`` by default; set to ``False`` for Python rows. - **kwargs: Extra request parameters forwarded unchanged. Useful when the service adds parameters before the SDK is regenerated. - - Returns: - A pandas ``DataFrame`` by default, Python rows when - ``as_dataframe=False``, raw JSON when ``raw=True``, or raw page - payloads when multi-page fetching is used with ``raw=True``. - """ - request_params = {'institution_id': institution_id, 'year': year, 'report_type': report_type, 'invest_type': invest_type} - request_params.update(kwargs) - return self._call_endpoint( - 'stock_institution_share_holdings', - raw=raw, - fields=fields, - as_dataframe=as_dataframe, - **request_params, - ) - - def stock_intraday_auction_volume( - self, - trade_date: Any | None = None, - page: int | None = None, - page_size: int | None = None, - limit: int | None = None, - all_pages: bool = False, - max_pages: int | None = None, + year: Any | None = None, + report_type: Any | None = None, + invest_type: Any | None = None, *, raw: bool = False, fields: Sequence[str] | str | None = None, as_dataframe: bool = True, **kwargs: Any, ) -> Any: - """集合竞价成交量. + """机构股本持股. - Endpoint: ``api/v1/market/data/intraday-auction-volume``. + Endpoint: ``api/v1/market/data/institution/institution-share-holdings``. Method: ``GET``. - Documented endpoint: ``stock_intraday_auction_volume``. + Documented endpoint: ``get_stock_institution_share_holdings``. Args: - trade_date: 交易日期 YYYYMMDD;不传返回当日实时数据 (type: string; required: N). - page: Page number, starting from 1. If omitted, the server default is used unless ``limit`` or ``all_pages`` is set. - page_size: Rows per page. The SDK validates this against the endpoint-specific maximum. - limit: Maximum number of rows to return. The SDK may fetch multiple pages to satisfy this limit. - all_pages: Fetch and combine pages until the server reports the last page. - max_pages: Optional safety cap for ``all_pages``. + institution_id: 机构 ID (type: string; required: Y). + year: 年份 (type: int; required: Y). + report_type: 报告类型:q1 / q2 / q3 / annual / announcement (type: ReportType; required: Y). + invest_type: 持仓类型:all / stock / fund / bond / other (type: InvestType; required: Y). raw: Return the decoded JSON payload without tabular extraction. fields: Optional field list or comma-separated field string applied after extraction. as_dataframe: Return a pandas ``DataFrame`` by default; set to ``False`` for Python rows. @@ -4361,25 +3233,18 @@ def stock_intraday_auction_volume( ``as_dataframe=False``, raw JSON when ``raw=True``, or raw page payloads when multi-page fetching is used with ``raw=True``. """ - request_params = {'trade_date': trade_date} + request_params = {'institution_id': institution_id, 'year': year, 'report_type': report_type, 'invest_type': invest_type} request_params.update(kwargs) - path = ENDPOINTS['stock_intraday_auction_volume'].path - return self.get_paginated( - path, - page=page, - page_size=page_size, - limit=limit, - all_pages=all_pages, - max_pages=max_pages, + return self._call_endpoint( + 'stock_institution_share_holdings', raw=raw, fields=fields, as_dataframe=as_dataframe, **request_params, ) - def stock_intraday_auction_volume_symbol( + def stock_intraday_auction_volume( self, - symbol: Any | None = None, trade_date: Any | None = None, page: int | None = None, page_size: int | None = None, @@ -4392,14 +3257,13 @@ def stock_intraday_auction_volume_symbol( as_dataframe: bool = True, **kwargs: Any, ) -> Any: - """单标的集合竞价成交量. + """集合竞价成交量. - Endpoint: ``api/v1/market/data/intraday-auction-volume/symbol``. + Endpoint: ``api/v1/market/data/intraday-auction-volume``. Method: ``GET``. - Documented endpoint: ``stock_intraday_auction_volume_symbol``. + Documented endpoint: ``stock_intraday_auction_volume``. Args: - symbol: 标的代码,格式 code.suffix(XSHG/SH、XSHE/SZ、BJSE/BJ) (type: string; required: Y). trade_date: 交易日期 YYYYMMDD;不传返回当日实时数据 (type: string; required: N). page: Page number, starting from 1. If omitted, the server default is used unless ``limit`` or ``all_pages`` is set. page_size: Rows per page. The SDK validates this against the endpoint-specific maximum. @@ -4416,9 +3280,9 @@ def stock_intraday_auction_volume_symbol( ``as_dataframe=False``, raw JSON when ``raw=True``, or raw page payloads when multi-page fetching is used with ``raw=True``. """ - request_params = {'symbol': symbol, 'trade_date': trade_date} + request_params = {'trade_date': trade_date} request_params.update(kwargs) - path = ENDPOINTS['stock_intraday_auction_volume_symbol'].path + path = ENDPOINTS['stock_intraday_auction_volume'].path return self.get_paginated( path, page=page, @@ -4485,6 +3349,8 @@ def stock_ipos( def stock_list( self, + page: int | None = None, + page_size: int | None = None, *, raw: bool = False, fields: Sequence[str] | str | None = None, @@ -4498,17 +3364,14 @@ def stock_list( Documented endpoint: ``get_stock_list``. Args: + page: Page number, starting from 1. + page_size: Rows per page, up to the endpoint-specific maximum. raw: Return the decoded JSON payload without tabular extraction. fields: Optional field list or comma-separated field string applied after extraction. as_dataframe: Return a pandas ``DataFrame`` by default; set to ``False`` for Python rows. **kwargs: Extra request parameters forwarded unchanged. Useful when the service adds parameters before the SDK is regenerated. - - Returns: - A pandas ``DataFrame`` by default, Python rows when - ``as_dataframe=False``, raw JSON when ``raw=True``, or raw page - payloads when multi-page fetching is used with ``raw=True``. """ - request_params = {} + request_params = {'page': page, 'page_size': page_size} request_params.update(kwargs) return self._call_endpoint( 'stock_list', @@ -4667,7 +3530,6 @@ def stock_market( def stock_market_distribution_intraday( self, - scope: Any | None = None, *, raw: bool = False, fields: Sequence[str] | str | None = None, @@ -4676,24 +3538,20 @@ def stock_market_distribution_intraday( ) -> Any: """市场涨跌分布分时. - Endpoint: ``api/v1/market/data/daec/market/distribution-history``. + Endpoint: ``api/v2/market/data/market-distribution-intraday``. Method: ``GET``. Documented endpoint: ``stock_market_distribution_intraday``. Args: - scope: 市场范围:ChinaStock(默认) / Xshg / Xshe / Bjse (type: string; required: N). raw: Return the decoded JSON payload without tabular extraction. fields: Optional field list or comma-separated field string applied after extraction. as_dataframe: Return a pandas ``DataFrame`` by default; set to ``False`` for Python rows. - **kwargs: Extra request parameters forwarded unchanged. Useful when the service adds parameters before the SDK is regenerated. + **kwargs: Extra request parameters forwarded unchanged. Returns: - A pandas ``DataFrame`` by default, Python rows when - ``as_dataframe=False``, raw JSON when ``raw=True``, or raw page - payloads when multi-page fetching is used with ``raw=True``. + A pandas ``DataFrame`` by default, Python rows when ``as_dataframe=False``, or raw JSON when ``raw=True``. """ - request_params = {'scope': scope} - request_params.update(kwargs) + request_params = dict(kwargs) return self._call_endpoint( 'stock_market_distribution_intraday', raw=raw, @@ -4749,9 +3607,6 @@ def stock_intraday_prices( range: Any | None = None, days: Any | None = None, ts_ms: Any | None = None, - compat: Any | None = None, - since: Any | None = None, - since_ts_ms: Any | None = None, *, raw: bool = False, fields: Sequence[str] | str | None = None, @@ -4760,18 +3615,15 @@ def stock_intraday_prices( ) -> Any: """标的分时数据. - Endpoint: ``api/v1/market/data/daec/history/prices``. + Endpoint: ``api/v4/market/data/daec/history/prices``. Method: ``GET``. - Documented endpoint: ``stock_intraday_prices``. + Documented endpoint: ``daec_history_prices``. Args: symbol: 标的代码,如 600000.XSHG (type: string; required: Y). range: 预置时间区间:Today / FiveDays (type: string; required: N). days: 近 N 个交易日至今 (type: uint32; required: N). ts_ms: 起始毫秒时间戳 (type: int64; required: N). - compat: 兼容模式。传 v2 时启用旧 v2 响应结构 (type: string; required: N). - since: v2 兼容模式参数。可选 TODAY / FIVE_DAYS_AGO / TRADE_DAYS_AGO(n) (type: string; required: N). - since_ts_ms: v2 兼容模式参数。按起始毫秒时间戳取数,优先级高于 since (type: int64; required: N). raw: Return the decoded JSON payload without tabular extraction. fields: Optional field list or comma-separated field string applied after extraction. as_dataframe: Return a pandas ``DataFrame`` by default; set to ``False`` for Python rows. @@ -4779,47 +3631,15 @@ def stock_intraday_prices( Returns: A pandas ``DataFrame`` by default, Python rows when - ``as_dataframe=False``, raw JSON when ``raw=True``, or raw page - payloads when multi-page fetching is used with ``raw=True``. - - Raises: - ValueError: If original-mode and ``compat='v2'`` time controls are mixed. + ``as_dataframe=False``, or raw JSON when ``raw=True``. """ - if compat is not None and compat != 'v2': - raise ValueError("compat must be 'v2' when provided") - raw_time_params = _present_params({'range': range, 'days': days, 'ts_ms': ts_ms}) - v2_time_params = _present_params({'since': since, 'since_ts_ms': since_ts_ms}) - if compat == 'v2': - if raw_time_params: - raise ValueError( - "stock_intraday_prices compat='v2' cannot be combined with raw time parameters: " - + ', '.join(raw_time_params) - ) - if len(v2_time_params) > 1: - raise ValueError( - "stock_intraday_prices v2 time parameters are mutually exclusive: " - + ', '.join(v2_time_params) - ) - elif v2_time_params: - raise ValueError( - "stock_intraday_prices v2 time parameters require compat='v2': " - + ', '.join(v2_time_params) - ) - elif len(raw_time_params) > 1: - raise ValueError( - "stock_intraday_prices raw time parameters are mutually exclusive: " - + ', '.join(raw_time_params) - ) - - request_params = { - 'symbol': symbol, - 'range': range, - 'days': days, - 'ts_ms': ts_ms, - 'compat': compat, - 'since': since, - 'since_ts_ms': since_ts_ms, - } + request_params = {'symbol': symbol} + if ts_ms is not None: + request_params['ts_ms'] = ts_ms + elif days is not None: + request_params['days'] = days + elif range is not None: + request_params['range'] = range request_params.update(kwargs) return self._call_endpoint( 'stock_intraday_prices', @@ -4829,122 +3649,6 @@ def stock_intraday_prices( **request_params, ) - def stock_ohlcs( - self, - symbol: Any | None = None, - since: Any | None = None, - until: Any | None = None, - interval: Any | None = None, - adjust: Any | None = None, - compat: Any | None = None, - span: Any | None = None, - limit: Any | None = None, - until_ts_ms: Any | None = None, - *, - raw: bool = False, - fields: Sequence[str] | str | None = None, - as_dataframe: bool = True, - **kwargs: Any, - ) -> Any: - """标的K线数据. - - Endpoint: ``api/v1/market/data/daec/history/ohlcs``. - Method: ``GET``. - Documented endpoint: ``stock_ohlcs``. - - Args: - symbol: 标的代码,如 600000.XSHG (type: string; required: Y). - since: 起始日期,格式 YYYYMMDD;v2 兼容模式不传时会根据 limit 估算回溯窗口 (type: string; required: 原始模式 Y / v2 兼容模式 N). - until: 结束日期,格式 YYYYMMDD;v2 兼容模式不传时默认当天 (type: string; required: 原始模式 Y / v2 兼容模式 N). - interval: 原始模式参数。周期:Minute / Day / Week / Month,默认 Day (type: string; required: N). - adjust: 复权方式:None / Forward / Backward;v2 兼容模式默认 Forward (type: string; required: N). - compat: 兼容模式。传 v2 时启用旧 v2 响应结构 (type: string; required: N). - span: v2 兼容模式参数。周期:DAY1 / WEEK1 / MONTH1;不支持 YEAR1 (type: string; required: N). - limit: v2 兼容模式参数。返回最近 N 根 K 线 (type: int; required: N). - until_ts_ms: v2 兼容模式参数。旧 v2 风格结束毫秒时间戳,会按北京时间转换为 until 日期 (type: int64; required: N). - raw: Return the decoded JSON payload without tabular extraction. - fields: Optional field list or comma-separated field string applied after extraction. - as_dataframe: Return a pandas ``DataFrame`` by default; set to ``False`` for Python rows. - **kwargs: Extra request parameters forwarded unchanged. Useful when the service adds parameters before the SDK is regenerated. - - Returns: - A pandas ``DataFrame`` by default, Python rows when - ``as_dataframe=False``, raw JSON when ``raw=True``, or raw page - payloads when multi-page fetching is used with ``raw=True``. - - Raises: - ValueError: If original-mode and ``compat='v2'`` controls are mixed. - """ - if compat is not None and compat != 'v2': - raise ValueError("compat must be 'v2' when provided") - v2_params = _present_params({'span': span, 'limit': limit, 'until_ts_ms': until_ts_ms}) - if compat == 'v2': - if interval is not None: - raise ValueError("stock_ohlcs compat='v2' uses span instead of interval") - elif v2_params: - raise ValueError("stock_ohlcs v2 parameters require compat='v2': " + ', '.join(v2_params)) - - request_params = { - 'symbol': symbol, - 'since': since, - 'until': until, - 'interval': interval, - 'adjust': adjust, - 'compat': compat, - 'span': span, - 'limit': limit, - 'until_ts_ms': until_ts_ms, - } - request_params.update(kwargs) - return self._call_endpoint( - 'stock_ohlcs', - raw=raw, - fields=fields, - as_dataframe=as_dataframe, - **request_params, - ) - - def stock_rating_top5( - self, - date: Any | None = None, - variant: Any | None = None, - type: Any | None = None, - *, - raw: bool = False, - fields: Sequence[str] | str | None = None, - as_dataframe: bool = True, - **kwargs: Any, - ) -> Any: - """飞兔股票评级Top5. - - Endpoint: ``api/v1/market/data/feitu/stock-rating-top5``. - Method: ``GET``. - Documented endpoint: ``stock_rating_top5``. - - Args: - date: 日期 YYYYMMDD (type: string; required: Y). - variant: 档位,如 300001(30w01)、300000(30w),默认 300001 (type: string; required: N). - type: 市场:all / xshg / xshe / bjse,默认 all (type: StockRatingMarketFilter; required: N). - raw: Return the decoded JSON payload without tabular extraction. - fields: Optional field list or comma-separated field string applied after extraction. - as_dataframe: Return a pandas ``DataFrame`` by default; set to ``False`` for Python rows. - **kwargs: Extra request parameters forwarded unchanged. Useful when the service adds parameters before the SDK is regenerated. - - Returns: - A pandas ``DataFrame`` by default, Python rows when - ``as_dataframe=False``, raw JSON when ``raw=True``, or raw page - payloads when multi-page fetching is used with ``raw=True``. - """ - request_params = {'date': date, 'variant': variant, 'type': type} - request_params.update(kwargs) - return self._call_endpoint( - 'stock_rating_top5', - raw=raw, - fields=fields, - as_dataframe=as_dataframe, - **request_params, - ) - def stock_share( self, stock_code: Any | None = None, @@ -4984,62 +3688,11 @@ def stock_share( **request_params, ) - def stock_signal_latest_snapshot( - self, - signal_type: Any | None = None, - page: int | None = None, - page_size: int | None = None, - limit: int | None = None, - all_pages: bool = False, - max_pages: int | None = None, - *, - raw: bool = False, - fields: Sequence[str] | str | None = None, - as_dataframe: bool = True, - **kwargs: Any, - ) -> Any: - """信号最新快照. - - Endpoint: ``api/v1/market/data/stock-signal-latest-snapshot``. - Method: ``GET``. - Documented endpoint: ``stock_signal_latest_snapshot``. - - Args: - signal_type: 信号类型过滤,不传返回全部。可选值:`new_high_month`、`new_high_60d`、`new_high_120d`、`new_high_250d`、`new_low_month`、`new_low_60d`、`new_low_120d`、`new_low_250d`、`consecutive_up`、`consecutive_down`、`consecutive_vol_up`、`consecutive_vol_down`、`break_up_ma5`、`break_up_ma10`、`break_up_ma20`、`break_down_ma5`、`break_down_ma10`、`break_down_ma20`、`vol_price_rise`、`vol_price_fall` (type: string; required: N). - page: Page number, starting from 1. If omitted, the server default is used unless ``limit`` or ``all_pages`` is set. - page_size: Rows per page. The SDK validates this against the endpoint-specific maximum. - limit: Maximum number of rows to return. The SDK may fetch multiple pages to satisfy this limit. - all_pages: Fetch and combine pages until the server reports the last page. - max_pages: Optional safety cap for ``all_pages``. - raw: Return the decoded JSON payload without tabular extraction. - fields: Optional field list or comma-separated field string applied after extraction. - as_dataframe: Return a pandas ``DataFrame`` by default; set to ``False`` for Python rows. - **kwargs: Extra request parameters forwarded unchanged. Useful when the service adds parameters before the SDK is regenerated. - - Returns: - A pandas ``DataFrame`` by default, Python rows when - ``as_dataframe=False``, raw JSON when ``raw=True``, or raw page - payloads when multi-page fetching is used with ``raw=True``. - """ - request_params = {'signal_type': signal_type} - request_params.update(kwargs) - path = ENDPOINTS['stock_signal_latest_snapshot'].path - return self.get_paginated( - path, - page=page, - page_size=page_size, - limit=limit, - all_pages=all_pages, - max_pages=max_pages, - raw=raw, - fields=fields, - as_dataframe=as_dataframe, - **request_params, - ) - def stock_unlock( self, stock_code: Any | None = None, + start_date: Any | None = None, + end_date: Any | None = None, page: int | None = None, page_size: int | None = None, limit: int | None = None, @@ -5059,6 +3712,8 @@ def stock_unlock( Args: stock_code: 证券代码 (type: string; required: Y). + start_date: 解禁日期起始值 (type: string; required: N). + end_date: 解禁日期结束值 (type: string; required: N). page: Page number, starting from 1. If omitted, the server default is used unless ``limit`` or ``all_pages`` is set. page_size: Rows per page. The SDK validates this against the endpoint-specific maximum. limit: Maximum number of rows to return. The SDK may fetch multiple pages to satisfy this limit. @@ -5074,7 +3729,7 @@ def stock_unlock( ``as_dataframe=False``, raw JSON when ``raw=True``, or raw page payloads when multi-page fetching is used with ``raw=True``. """ - request_params = {'stock_code': stock_code} + request_params = {'stock_code': stock_code, 'start_date': start_date, 'end_date': end_date} request_params.update(kwargs) path = ENDPOINTS['stock_unlock'].path return self.get_paginated( @@ -5089,58 +3744,211 @@ def stock_unlock( as_dataframe=as_dataframe, **request_params, ) + def stock_description_all(self, page: int | None = None, page_size: int | None = None, *, raw: bool = False, fields: Sequence[str] | str | None = None, as_dataframe: bool = True, **kwargs: Any) -> Any: + """股票基础信息.""" + params = {'page': page, 'page_size': page_size} + params.update(kwargs) + return self._call_endpoint('stock_description_all', raw=raw, fields=fields, as_dataframe=as_dataframe, **params) + + + def tdx_board_index(self, ts_code: Any | None = None, idx_name: Any | None = None, idx_type: Any | None = None, idx_type_code: Any | None = None, market: Any | None = None, page: int | None = None, page_size: int | None = None, *, raw: bool = False, fields: Sequence[str] | str | None = None, as_dataframe: bool = True, **kwargs: Any) -> Any: + """通达信板块指数最新快照.""" + params = {'ts_code': ts_code, 'idx_name': idx_name, 'idx_type': idx_type, 'idx_type_code': idx_type_code, 'market': market, 'page': page, 'page_size': page_size} + params.update(kwargs) + return self._call_endpoint('tdx_board_index', raw=raw, fields=fields, as_dataframe=as_dataframe, **params) + - def stock_unlock_by_date( + def tdx_board_daily(self, start_date: Any | None = None, end_date: Any | None = None, ts_code: Any | None = None, idx_name: Any | None = None, idx_type: Any | None = None, idx_type_code: Any | None = None, market: Any | None = None, page: int | None = None, page_size: int | None = None, *, raw: bool = False, fields: Sequence[str] | str | None = None, as_dataframe: bool = True, **kwargs: Any) -> Any: + """通达信板块日线.""" + params = {'start_date': start_date, 'end_date': end_date, 'ts_code': ts_code, 'idx_name': idx_name, 'idx_type': idx_type, 'idx_type_code': idx_type_code, 'market': market, 'page': page, 'page_size': page_size} + params.update(kwargs) + return self._call_endpoint('tdx_board_daily', raw=raw, fields=fields, as_dataframe=as_dataframe, **params) + + + def tdx_board_members(self, ts_code: Any | None = None, idx_name: Any | None = None, idx_type: Any | None = None, idx_type_code: Any | None = None, market: Any | None = None, con_code: Any | None = None, con_name: Any | None = None, page: Any | None = None, page_size: Any | None = None, limit: int | None = None, all_pages: bool = False, max_pages: int | None = None, *, raw: bool = False, fields: Sequence[str] | str | None = None, as_dataframe: bool = True, **kwargs: Any) -> Any: + """通达信板块成分股最新快照.""" + params = {'ts_code': ts_code, 'idx_name': idx_name, 'idx_type': idx_type, 'idx_type_code': idx_type_code, 'market': market, 'con_code': con_code, 'con_name': con_name} + params.update(kwargs) + path = ENDPOINTS['tdx_board_members'].path + return self.get_paginated(path, page=page, page_size=page_size, limit=limit, all_pages=all_pages, max_pages=max_pages, raw=raw, fields=fields, as_dataframe=as_dataframe, **params) + + + def stock_dividends( self, - start_date: Any | None = None, - end_date: Any | None = None, + symbol: Any | None = None, + since_date: Any | None = None, + until_date: Any | None = None, page: int | None = None, page_size: int | None = None, - limit: int | None = None, - all_pages: bool = False, - max_pages: int | None = None, *, raw: bool = False, fields: Sequence[str] | str | None = None, as_dataframe: bool = True, **kwargs: Any, ) -> Any: - """限售解禁按日期. + """股票分红记录.""" + params = {'symbol': symbol, 'since_date': since_date, 'until_date': until_date, 'page': page, 'page_size': page_size} + params.update(kwargs) + return self._call_endpoint('stock_dividends', raw=raw, fields=fields, as_dataframe=as_dataframe, **params) - Endpoint: ``api/v1/market/data/unlock/stock-unlock-by-date``. - Method: ``GET``. - Documented endpoint: ``stock_unlock_by_date_handler``. - Args: - start_date: 起始日期(YYYY-MM-DD) (type: string; required: Y). - end_date: 结束日期(YYYY-MM-DD) (type: string; required: Y). - page: Page number, starting from 1. If omitted, the server default is used unless ``limit`` or ``all_pages`` is set. - page_size: Rows per page. The SDK validates this against the endpoint-specific maximum. - limit: Maximum number of rows to return. The SDK may fetch multiple pages to satisfy this limit. - all_pages: Fetch and combine pages until the server reports the last page. - max_pages: Optional safety cap for ``all_pages``. - raw: Return the decoded JSON payload without tabular extraction. - fields: Optional field list or comma-separated field string applied after extraction. - as_dataframe: Return a pandas ``DataFrame`` by default; set to ``False`` for Python rows. - **kwargs: Extra request parameters forwarded unchanged. Useful when the service adds parameters before the SDK is regenerated. + def stock_history_list(self, trade_date: Any | None = None, code: Any | None = None, page: int | None = None, page_size: int | None = None, *, raw: bool = False, fields: Sequence[str] | str | None = None, as_dataframe: bool = True, **kwargs: Any) -> Any: + """股票历史列表.""" + params = {'trade_date': trade_date, 'code': code, 'page': page, 'page_size': page_size} + params.update(kwargs) + return self._call_endpoint('stock_history_list', raw=raw, fields=fields, as_dataframe=as_dataframe, **params) - Returns: - A pandas ``DataFrame`` by default, Python rows when - ``as_dataframe=False``, raw JSON when ``raw=True``, or raw page - payloads when multi-page fetching is used with ``raw=True``. - """ - request_params = {'start_date': start_date, 'end_date': end_date} - request_params.update(kwargs) - path = ENDPOINTS['stock_unlock_by_date'].path - return self.get_paginated( - path, - page=page, - page_size=page_size, - limit=limit, - all_pages=all_pages, - max_pages=max_pages, - raw=raw, - fields=fields, - as_dataframe=as_dataframe, - **request_params, - ) + + def stock_connect_members(self, direction: Any | None = None, channel: Any | None = None, page: int | None = None, page_size: int | None = None, *, raw: bool = False, fields: Sequence[str] | str | None = None, as_dataframe: bool = True, **kwargs: Any) -> Any: + """互联互通成份.""" + params = {'direction': direction, 'channel': channel, 'page': page, 'page_size': page_size} + params.update(kwargs) + return self._call_endpoint('stock_connect_members', raw=raw, fields=fields, as_dataframe=as_dataframe, **params) + + + def limit_list(self, limit_type: Any | None = None, trade_date: Any | None = None, *, raw: bool = False, fields: Sequence[str] | str | None = None, as_dataframe: bool = True, **kwargs: Any) -> Any: + """涨跌停池.""" + params = {'limit_type': limit_type, 'trade_date': trade_date} + params.update(kwargs) + return self._call_endpoint('limit_list', raw=raw, fields=fields, as_dataframe=as_dataframe, **params) + + + def stk_surv(self, ts_code: Any | None = None, trade_date: Any | None = None, start_date: Any | None = None, end_date: Any | None = None, page: Any | None = None, page_size: Any | None = None, limit: int | None = None, all_pages: bool = False, max_pages: int | None = None, *, raw: bool = False, fields: Sequence[str] | str | None = None, as_dataframe: bool = True, **kwargs: Any) -> Any: + """个股严重异常波动.""" + params = {'ts_code': ts_code, 'trade_date': trade_date, 'start_date': start_date, 'end_date': end_date} + params.update(kwargs) + path = ENDPOINTS['stk_surv'].path + return self.get_paginated(path, page=page, page_size=page_size, limit=limit, all_pages=all_pages, max_pages=max_pages, raw=raw, fields=fields, as_dataframe=as_dataframe, **params) + + + def stk_shock(self, ts_code: Any | None = None, trade_date: Any | None = None, start_date: Any | None = None, end_date: Any | None = None, page: Any | None = None, page_size: Any | None = None, limit: int | None = None, all_pages: bool = False, max_pages: int | None = None, *, raw: bool = False, fields: Sequence[str] | str | None = None, as_dataframe: bool = True, **kwargs: Any) -> Any: + """个股异常波动.""" + params = {'ts_code': ts_code, 'trade_date': trade_date, 'start_date': start_date, 'end_date': end_date} + params.update(kwargs) + path = ENDPOINTS['stk_shock'].path + return self.get_paginated(path, page=page, page_size=page_size, limit=limit, all_pages=all_pages, max_pages=max_pages, raw=raw, fields=fields, as_dataframe=as_dataframe, **params) + + + def stk_alert_broker(self, ts_code: Any | None = None, start_date: Any | None = None, end_date: Any | None = None, page: Any | None = None, page_size: Any | None = None, limit: int | None = None, all_pages: bool = False, max_pages: int | None = None, *, raw: bool = False, fields: Sequence[str] | str | None = None, as_dataframe: bool = True, **kwargs: Any) -> Any: + """交易所重点提示证券.""" + params = {'ts_code': ts_code, 'start_date': start_date, 'end_date': end_date} + params.update(kwargs) + path = ENDPOINTS['stk_alert_broker'].path + return self.get_paginated(path, page=page, page_size=page_size, limit=limit, all_pages=all_pages, max_pages=max_pages, raw=raw, fields=fields, as_dataframe=as_dataframe, **params) + + + def limit_up_public_report(self, date: Any | None = None, security_code: Any | None = None, *, raw: bool = False, fields: Sequence[str] | str | None = None, as_dataframe: bool = True, **kwargs: Any) -> Any: + """涨停对外归因报告.""" + params = {'date': date, 'security_code': security_code} + params.update(kwargs) + return self._call_endpoint('limit_up_public_report', raw=raw, fields=fields, as_dataframe=as_dataframe, **params) + + + def limit_up_briefs(self, date: Any | None = None, *, raw: bool = False, fields: Sequence[str] | str | None = None, as_dataframe: bool = True, **kwargs: Any) -> Any: + """涨停简报.""" + params = {'date': date} + params.update(kwargs) + return self._call_endpoint('limit_up_briefs', raw=raw, fields=fields, as_dataframe=as_dataframe, **params) + + + def ths_hot_list(self, list_type: Any | None = None, trade_date: Any | None = None, page: Any | None = None, page_size: Any | None = None, limit: int | None = None, all_pages: bool = False, max_pages: int | None = None, *, raw: bool = False, fields: Sequence[str] | str | None = None, as_dataframe: bool = True, **kwargs: Any) -> Any: + """同花顺热榜.""" + params = {'list_type': list_type, 'trade_date': trade_date} + params.update(kwargs) + path = ENDPOINTS['ths_hot_list'].path + return self.get_paginated(path, page=page, page_size=page_size, limit=limit, all_pages=all_pages, max_pages=max_pages, raw=raw, fields=fields, as_dataframe=as_dataframe, **params) + + + def ashare_news_sentiment_factors(self, trade_code: Any | None = None, start_date: Any | None = None, end_date: Any | None = None, page: Any | None = None, page_size: Any | None = None, limit: int | None = None, all_pages: bool = False, max_pages: int | None = None, *, raw: bool = False, fields: Sequence[str] | str | None = None, as_dataframe: bool = True, **kwargs: Any) -> Any: + """A股新闻情绪因子.""" + params = {'trade_code': trade_code, 'start_date': start_date, 'end_date': end_date} + params.update(kwargs) + path = ENDPOINTS['ashare_news_sentiment_factors'].path + return self.get_paginated(path, page=page, page_size=page_size, limit=limit, all_pages=all_pages, max_pages=max_pages, raw=raw, fields=fields, as_dataframe=as_dataframe, **params) + + + def kline_pattern_annotations(self, date: Any | None = None, symbol: Any | None = None, pattern: Any | None = None, page: Any | None = None, page_size: Any | None = None, limit: int | None = None, all_pages: bool = False, max_pages: int | None = None, *, raw: bool = False, fields: Sequence[str] | str | None = None, as_dataframe: bool = True, **kwargs: Any) -> Any: + """K线形态标注.""" + params = {'date': date, 'symbol': symbol, 'pattern': pattern} + params.update(kwargs) + path = ENDPOINTS['kline_pattern_annotations'].path + return self.get_paginated(path, page=page, page_size=page_size, limit=limit, all_pages=all_pages, max_pages=max_pages, raw=raw, fields=fields, as_dataframe=as_dataframe, **params) + + + def ashare_interactions(self, start_date: Any | None = None, end_date: Any | None = None, trade_code: Any | None = None, company_name: Any | None = None, industry_code: Any | None = None, industry_name: Any | None = None, data_source: Any | None = None, page: Any | None = None, page_size: Any | None = None, limit: int | None = None, all_pages: bool = False, max_pages: int | None = None, *, raw: bool = False, fields: Sequence[str] | str | None = None, as_dataframe: bool = True, **kwargs: Any) -> Any: + """e互动.""" + params = {'start_date': start_date, 'end_date': end_date, 'trade_code': trade_code, 'company_name': company_name, 'industry_code': industry_code, 'industry_name': industry_name, 'data_source': data_source} + params.update(kwargs) + path = ENDPOINTS['ashare_interactions'].path + return self.get_paginated(path, page=page, page_size=page_size, limit=limit, all_pages=all_pages, max_pages=max_pages, raw=raw, fields=fields, as_dataframe=as_dataframe, **params) + + + def supply_chain_subindustry_supply_chain(self, industry_name: Any | None = None, direction: Any | None = None, *, raw: bool = False, fields: Sequence[str] | str | None = None, as_dataframe: bool = True, **kwargs: Any) -> Any: + """供应链一跳关系.""" + params = {'industry_name': industry_name, 'direction': direction} + params.update(kwargs) + return self._call_endpoint('supply_chain_subindustry_supply_chain', raw=raw, fields=fields, as_dataframe=as_dataframe, **params) + + + def supply_chain_company_supply_chain_companies(self, trade_code: Any | None = None, direction: Any | None = None, page: Any | None = None, page_size: Any | None = None, limit: int | None = None, all_pages: bool = False, max_pages: int | None = None, *, raw: bool = False, fields: Sequence[str] | str | None = None, as_dataframe: bool = True, **kwargs: Any) -> Any: + """供应链公司候选.""" + params = {'trade_code': trade_code, 'direction': direction} + params.update(kwargs) + path = ENDPOINTS['supply_chain_company_supply_chain_companies'].path + return self.get_paginated(path, page=page, page_size=page_size, limit=limit, all_pages=all_pages, max_pages=max_pages, raw=raw, fields=fields, as_dataframe=as_dataframe, **params) + + + def supply_chain_subsubindustry_companies(self, subindustry_name: Any | None = None, *, raw: bool = False, fields: Sequence[str] | str | None = None, as_dataframe: bool = True, **kwargs: Any) -> Any: + """供应链子子行业公司映射.""" + params = {'subindustry_name': subindustry_name} + params.update(kwargs) + return self._call_endpoint('supply_chain_subsubindustry_companies', raw=raw, fields=fields, as_dataframe=as_dataframe, **params) + + + def supply_chain_subsubindustry_parent_subindustries(self, subindustry_name: Any | None = None, *, raw: bool = False, fields: Sequence[str] | str | None = None, as_dataframe: bool = True, **kwargs: Any) -> Any: + """供应链子子行业父行业反查.""" + params = {'subindustry_name': subindustry_name} + params.update(kwargs) + return self._call_endpoint('supply_chain_subsubindustry_parent_subindustries', raw=raw, fields=fields, as_dataframe=as_dataframe, **params) + + + def supply_chain_subindustry_subsubindustries(self, industry_name: Any | None = None, *, raw: bool = False, fields: Sequence[str] | str | None = None, as_dataframe: bool = True, **kwargs: Any) -> Any: + """供应链子行业层级展开.""" + params = {'industry_name': industry_name} + params.update(kwargs) + return self._call_endpoint('supply_chain_subindustry_subsubindustries', raw=raw, fields=fields, as_dataframe=as_dataframe, **params) + + + def exchange_margin_summaries(self, start_date: Any | None = None, end_date: Any | None = None, exchange: Any | None = None, page: int | None = None, page_size: int | None = None, *, raw: bool = False, fields: Sequence[str] | str | None = None, as_dataframe: bool = True, **kwargs: Any) -> Any: + """交易所融资融券汇总日度.""" + params = {'start_date': start_date, 'end_date': end_date, 'exchange': exchange, 'page': page, 'page_size': page_size} + params.update(kwargs) + return self._call_endpoint('exchange_margin_summaries', raw=raw, fields=fields, as_dataframe=as_dataframe, **params) + + + def ashare_rating_factor_snapshot(self, trade_code: Any | None = None, date: Any | None = None, top_k: Any | None = None, *, raw: bool = False, fields: Sequence[str] | str | None = None, as_dataframe: bool = True, **kwargs: Any) -> Any: + """A股相关性 Top-K.""" + params = {'trade_code': trade_code, 'date': date, 'top_k': top_k} + params.update(kwargs) + return self._call_endpoint('ashare_rating_factor_snapshot', raw=raw, fields=fields, as_dataframe=as_dataframe, **params) + + + def stock_minutes(self, symbol: Any | None = None, interval_value: Any | None = None, adjust_kind: Any | None = None, since_ts_millis: Any | None = None, until_ts_millis: Any | None = None, limit: Any | None = None, *, raw: bool = False, fields: Sequence[str] | str | None = None, as_dataframe: bool = True, **kwargs: Any) -> Any: + """股票历史分钟行情.""" + params = {'symbol': symbol, 'interval_value': interval_value, 'adjust_kind': adjust_kind, 'since_ts_millis': since_ts_millis, 'until_ts_millis': until_ts_millis, 'limit': limit} + params.update(kwargs) + return self._call_endpoint('stock_minutes', raw=raw, fields=fields, as_dataframe=as_dataframe, **params) + + + def stock_realtime_minute_kline(self, symbols: Any | None = None, *, raw: bool = False, fields: Sequence[str] | str | None = None, as_dataframe: bool = True, **kwargs: Any) -> Any: + """股票实时分钟K线.""" + params = {'symbols': symbols} + params.update(kwargs) + return self._call_endpoint('stock_realtime_minute_kline', raw=raw, fields=fields, as_dataframe=as_dataframe, **params) + + + def stock_realtime_day_kline(self, symbols: Any | None = None, *, raw: bool = False, fields: Sequence[str] | str | None = None, as_dataframe: bool = True, **kwargs: Any) -> Any: + """股票实时日K线.""" + params = {'symbols': symbols} + params.update(kwargs) + return self._call_endpoint('stock_realtime_day_kline', raw=raw, fields=fields, as_dataframe=as_dataframe, **params) diff --git a/src/ftshare/apis/unpublished.py b/src/ftshare/apis/unpublished.py deleted file mode 100644 index aa17b3c..0000000 --- a/src/ftshare/apis/unpublished.py +++ /dev/null @@ -1,192 +0,0 @@ -"""Unpublished API methods kept for compatibility.""" - -from __future__ import annotations - -from collections.abc import Sequence -from typing import Any - -from ..endpoints import ENDPOINTS - - -class UnpublishedApiMixin: - """Endpoint methods for the unpublished ftshare-doc topic.""" - - def stock_dividends_paginated( - self, - page: int | None = None, - page_size: int | None = None, - limit: int | None = None, - all_pages: bool = False, - max_pages: int | None = None, - *, - raw: bool = False, - fields: Sequence[str] | str | None = None, - as_dataframe: bool = True, - **kwargs: Any, - ) -> Any: - """股票分红记录分页. - - Endpoint: ``api/v1/market/data/dividends``. - Method: ``GET``. - Documented endpoint: ``stock_dividends_paginated``. - - Args: - page: Page number, starting from 1. If omitted, the server default is used unless ``limit`` or ``all_pages`` is set. - page_size: Rows per page. The SDK validates this against the endpoint-specific maximum. - limit: Maximum number of rows to return. The SDK may fetch multiple pages to satisfy this limit. - all_pages: Fetch and combine pages until the server reports the last page. - max_pages: Optional safety cap for ``all_pages``. - raw: Return the decoded JSON payload without tabular extraction. - fields: Optional field list or comma-separated field string applied after extraction. - as_dataframe: Return a pandas ``DataFrame`` by default; set to ``False`` for Python rows. - **kwargs: Extra request parameters forwarded unchanged. Useful when the service adds parameters before the SDK is regenerated. - - Returns: - A pandas ``DataFrame`` by default, Python rows when - ``as_dataframe=False``, raw JSON when ``raw=True``, or raw page - payloads when multi-page fetching is used with ``raw=True``. - """ - request_params = {} - request_params.update(kwargs) - path = ENDPOINTS['stock_dividends_paginated'].path - return self.get_paginated( - path, - page=page, - page_size=page_size, - limit=limit, - all_pages=all_pages, - max_pages=max_pages, - raw=raw, - fields=fields, - as_dataframe=as_dataframe, - **request_params, - ) - - def stock_intraday( - self, - symbol: Any | None = None, - *, - raw: bool = False, - fields: Sequence[str] | str | None = None, - as_dataframe: bool = True, - **kwargs: Any, - ) -> Any: - """股票日内分时. - - Endpoint: ``api/v1/market/security/{symbol}/intraday``. - Method: ``GET``. - Documented endpoint: ``stock_intraday``. - - Args: - symbol: 标的代码 (type: SymbolKey; required: Y). - raw: Return the decoded JSON payload without tabular extraction. - fields: Optional field list or comma-separated field string applied after extraction. - as_dataframe: Return a pandas ``DataFrame`` by default; set to ``False`` for Python rows. - **kwargs: Extra request parameters forwarded unchanged. Useful when the service adds parameters before the SDK is regenerated. - - Returns: - A pandas ``DataFrame`` by default, Python rows when - ``as_dataframe=False``, raw JSON when ``raw=True``, or raw page - payloads when multi-page fetching is used with ``raw=True``. - """ - request_params = {} - request_params.update(kwargs) - return self._call_endpoint( - 'stock_intraday', - path_params={'symbol': symbol}, - raw=raw, - fields=fields, - as_dataframe=as_dataframe, - **request_params, - ) - - def stock_ipos_paginated( - self, - page: int | None = None, - page_size: int | None = None, - limit: int | None = None, - all_pages: bool = False, - max_pages: int | None = None, - *, - raw: bool = False, - fields: Sequence[str] | str | None = None, - as_dataframe: bool = True, - **kwargs: Any, - ) -> Any: - """股票IPO分页. - - Endpoint: ``api/v1/market/data/stock-ipos``. - Method: ``GET``. - Documented endpoint: ``stock_ipos_paginated``. - - Args: - page: Page number, starting from 1. If omitted, the server default is used unless ``limit`` or ``all_pages`` is set. - page_size: Rows per page. The SDK validates this against the endpoint-specific maximum. - limit: Maximum number of rows to return. The SDK may fetch multiple pages to satisfy this limit. - all_pages: Fetch and combine pages until the server reports the last page. - max_pages: Optional safety cap for ``all_pages``. - raw: Return the decoded JSON payload without tabular extraction. - fields: Optional field list or comma-separated field string applied after extraction. - as_dataframe: Return a pandas ``DataFrame`` by default; set to ``False`` for Python rows. - **kwargs: Extra request parameters forwarded unchanged. Useful when the service adds parameters before the SDK is regenerated. - - Returns: - A pandas ``DataFrame`` by default, Python rows when - ``as_dataframe=False``, raw JSON when ``raw=True``, or raw page - payloads when multi-page fetching is used with ``raw=True``. - """ - request_params = {} - request_params.update(kwargs) - path = ENDPOINTS['stock_ipos_paginated'].path - return self.get_paginated( - path, - page=page, - page_size=page_size, - limit=limit, - all_pages=all_pages, - max_pages=max_pages, - raw=raw, - fields=fields, - as_dataframe=as_dataframe, - **request_params, - ) - - def stock_related( - self, - symbol: Any | None = None, - limit: Any | None = None, - *, - raw: bool = False, - fields: Sequence[str] | str | None = None, - as_dataframe: bool = True, - **kwargs: Any, - ) -> Any: - """相关股票. - - Endpoint: ``api/v1/market/security/{symbol}/related``. - Method: ``GET``. - Documented endpoint: ``stock_related``. - - Args: - symbol: 标的代码 (type: SymbolKey; required: Y). - limit: 返回数量上限,服务端默认 3 (type: int; required: N). - raw: Return the decoded JSON payload without tabular extraction. - fields: Optional field list or comma-separated field string applied after extraction. - as_dataframe: Return a pandas ``DataFrame`` by default; set to ``False`` for Python rows. - **kwargs: Extra request parameters forwarded unchanged. Useful when the service adds parameters before the SDK is regenerated. - - Returns: - A pandas ``DataFrame`` by default, Python rows when - ``as_dataframe=False``, raw JSON when ``raw=True``, or raw page - payloads when multi-page fetching is used with ``raw=True``. - """ - request_params = {'limit': limit} - request_params.update(kwargs) - return self._call_endpoint( - 'stock_related', - path_params={'symbol': symbol}, - raw=raw, - fields=fields, - as_dataframe=as_dataframe, - **request_params, - ) diff --git a/src/ftshare/apis/us.py b/src/ftshare/apis/us.py index 9e27c20..5bc73e1 100644 --- a/src/ftshare/apis/us.py +++ b/src/ftshare/apis/us.py @@ -11,63 +11,6 @@ class UsApiMixin: """Endpoint methods for the us ftshare-doc topic.""" - def eastmoney_us_stock_daily_kline( - self, - stock_code: Any | None = None, - start_date: Any | None = None, - end_date: Any | None = None, - page: int | None = None, - page_size: int | None = None, - limit: int | None = None, - all_pages: bool = False, - max_pages: int | None = None, - *, - raw: bool = False, - fields: Sequence[str] | str | None = None, - as_dataframe: bool = True, - **kwargs: Any, - ) -> Any: - """东方财富美股日OHLC. - - Endpoint: ``api/v1/market/data/eastmoney-us-stock-daily-ohlc``. - Method: ``GET``. - Documented endpoint: ``eastmoney_us_stock_daily_kline``. - - Args: - stock_code: 股票代码,如 AAPL (type: string; required: Y). - start_date: 起始日期(含),YYYY-MM-DD 或 YYYYMMDD;不传从最早开始 (type: string; required: N). - end_date: 截止日期(含),YYYY-MM-DD 或 YYYYMMDD;不传到最晚 (type: string; required: N). - page: Page number, starting from 1. If omitted, the server default is used unless ``limit`` or ``all_pages`` is set. - page_size: Rows per page. The SDK validates this against the endpoint-specific maximum. - limit: Maximum number of rows to return. The SDK may fetch multiple pages to satisfy this limit. - all_pages: Fetch and combine pages until the server reports the last page. - max_pages: Optional safety cap for ``all_pages``. - raw: Return the decoded JSON payload without tabular extraction. - fields: Optional field list or comma-separated field string applied after extraction. - as_dataframe: Return a pandas ``DataFrame`` by default; set to ``False`` for Python rows. - **kwargs: Extra request parameters forwarded unchanged. Useful when the service adds parameters before the SDK is regenerated. - - Returns: - A pandas ``DataFrame`` by default, Python rows when - ``as_dataframe=False``, raw JSON when ``raw=True``, or raw page - payloads when multi-page fetching is used with ``raw=True``. - """ - request_params = {'stock_code': stock_code, 'start_date': start_date, 'end_date': end_date} - request_params.update(kwargs) - path = ENDPOINTS['eastmoney_us_stock_daily_kline'].path - return self.get_paginated( - path, - page=page, - page_size=page_size, - limit=limit, - all_pages=all_pages, - max_pages=max_pages, - raw=raw, - fields=fields, - as_dataframe=as_dataframe, - **request_params, - ) - def eastmoney_us_stock_daily_ohlc( self, stock_code: Any | None = None, @@ -124,402 +67,3 @@ def eastmoney_us_stock_daily_ohlc( as_dataframe=as_dataframe, **request_params, ) - - def eastmoney_us_stock_latest_kline( - self, - stock_code: Any | None = None, - page: int | None = None, - page_size: int | None = None, - limit: int | None = None, - all_pages: bool = False, - max_pages: int | None = None, - *, - raw: bool = False, - fields: Sequence[str] | str | None = None, - as_dataframe: bool = True, - **kwargs: Any, - ) -> Any: - """东方财富美股最新OHLC. - - Endpoint: ``api/v1/market/data/eastmoney-us-stock-latest-ohlc``. - Method: ``GET``. - Documented endpoint: ``eastmoney_us_stock_latest_kline``. - - Args: - stock_code: 股票代码,如 ADV;不传返回全部美股最新 K 线 (type: string; required: N). - page: Page number, starting from 1. If omitted, the server default is used unless ``limit`` or ``all_pages`` is set. - page_size: Rows per page. The SDK validates this against the endpoint-specific maximum. - limit: Maximum number of rows to return. The SDK may fetch multiple pages to satisfy this limit. - all_pages: Fetch and combine pages until the server reports the last page. - max_pages: Optional safety cap for ``all_pages``. - raw: Return the decoded JSON payload without tabular extraction. - fields: Optional field list or comma-separated field string applied after extraction. - as_dataframe: Return a pandas ``DataFrame`` by default; set to ``False`` for Python rows. - **kwargs: Extra request parameters forwarded unchanged. Useful when the service adds parameters before the SDK is regenerated. - - Returns: - A pandas ``DataFrame`` by default, Python rows when - ``as_dataframe=False``, raw JSON when ``raw=True``, or raw page - payloads when multi-page fetching is used with ``raw=True``. - """ - request_params = {'stock_code': stock_code} - request_params.update(kwargs) - path = ENDPOINTS['eastmoney_us_stock_latest_kline'].path - return self.get_paginated( - path, - page=page, - page_size=page_size, - limit=limit, - all_pages=all_pages, - max_pages=max_pages, - raw=raw, - fields=fields, - as_dataframe=as_dataframe, - **request_params, - ) - - def eastmoney_us_stock_latest_ohlc( - self, - stock_code: Any | None = None, - page: int | None = None, - page_size: int | None = None, - limit: int | None = None, - all_pages: bool = False, - max_pages: int | None = None, - *, - raw: bool = False, - fields: Sequence[str] | str | None = None, - as_dataframe: bool = True, - **kwargs: Any, - ) -> Any: - """东方财富美股最新OHLC. - - Endpoint: ``api/v1/market/data/eastmoney-us-stock-latest-ohlc``. - Method: ``GET``. - Documented endpoint: ``eastmoney_us_stock_latest_kline``. - - Args: - stock_code: 股票代码,如 ADV;不传返回全部美股最新 K 线 (type: string; required: N). - page: Page number, starting from 1. If omitted, the server default is used unless ``limit`` or ``all_pages`` is set. - page_size: Rows per page. The SDK validates this against the endpoint-specific maximum. - limit: Maximum number of rows to return. The SDK may fetch multiple pages to satisfy this limit. - all_pages: Fetch and combine pages until the server reports the last page. - max_pages: Optional safety cap for ``all_pages``. - raw: Return the decoded JSON payload without tabular extraction. - fields: Optional field list or comma-separated field string applied after extraction. - as_dataframe: Return a pandas ``DataFrame`` by default; set to ``False`` for Python rows. - **kwargs: Extra request parameters forwarded unchanged. Useful when the service adds parameters before the SDK is regenerated. - - Returns: - A pandas ``DataFrame`` by default, Python rows when - ``as_dataframe=False``, raw JSON when ``raw=True``, or raw page - payloads when multi-page fetching is used with ``raw=True``. - """ - request_params = {'stock_code': stock_code} - request_params.update(kwargs) - path = ENDPOINTS['eastmoney_us_stock_latest_ohlc'].path - return self.get_paginated( - path, - page=page, - page_size=page_size, - limit=limit, - all_pages=all_pages, - max_pages=max_pages, - raw=raw, - fields=fields, - as_dataframe=as_dataframe, - **request_params, - ) - - def eastmoney_us_stock_list( - self, - refresh: Any | None = None, - page: int | None = None, - page_size: int | None = None, - limit: int | None = None, - all_pages: bool = False, - max_pages: int | None = None, - *, - raw: bool = False, - fields: Sequence[str] | str | None = None, - as_dataframe: bool = True, - **kwargs: Any, - ) -> Any: - """东方财富美股列表. - - Endpoint: ``api/v1/market/data/eastmoney-us-stock-list``. - Method: ``GET``. - Documented endpoint: ``eastmoney_us_stock_list``. - - Args: - refresh: 为 true 时强制从 CSV 重新加载列表缓存 (type: bool; required: N). - page: Page number, starting from 1. If omitted, the server default is used unless ``limit`` or ``all_pages`` is set. - page_size: Rows per page. The SDK validates this against the endpoint-specific maximum. - limit: Maximum number of rows to return. The SDK may fetch multiple pages to satisfy this limit. - all_pages: Fetch and combine pages until the server reports the last page. - max_pages: Optional safety cap for ``all_pages``. - raw: Return the decoded JSON payload without tabular extraction. - fields: Optional field list or comma-separated field string applied after extraction. - as_dataframe: Return a pandas ``DataFrame`` by default; set to ``False`` for Python rows. - **kwargs: Extra request parameters forwarded unchanged. Useful when the service adds parameters before the SDK is regenerated. - - Returns: - A pandas ``DataFrame`` by default, Python rows when - ``as_dataframe=False``, raw JSON when ``raw=True``, or raw page - payloads when multi-page fetching is used with ``raw=True``. - """ - request_params = {'refresh': refresh} - request_params.update(kwargs) - path = ENDPOINTS['eastmoney_us_stock_list'].path - return self.get_paginated( - path, - page=page, - page_size=page_size, - limit=limit, - all_pages=all_pages, - max_pages=max_pages, - raw=raw, - fields=fields, - as_dataframe=as_dataframe, - **request_params, - ) - - def us_balance( - self, - stock_code: Any | None = None, - period: Any | None = None, - report_type: Any | None = None, - start_date: Any | None = None, - end_date: Any | None = None, - page: int | None = None, - page_size: int | None = None, - limit: int | None = None, - all_pages: bool = False, - max_pages: int | None = None, - *, - raw: bool = False, - fields: Sequence[str] | str | None = None, - as_dataframe: bool = True, - **kwargs: Any, - ) -> Any: - """美股资产负债表. - - Endpoint: ``api/v1/market/data/us/us-balance``. - Method: ``GET``. - Documented endpoint: ``us_balance``. - - Args: - stock_code: 美股代码,纯代码不带后缀,如 NVDA (type: string; required: Y). - period: 财年(如 2024),匹配 stmt_year,非自然年 (type: int; required: N). - report_type: 报告期类型:Q1 / Q2 / Q3 / Q4 / H1 (type: string; required: N). - start_date: 报告期下界 YYYYMMDD(含),过滤 end_date (type: int; required: N). - end_date: 报告期上界 YYYYMMDD(含),过滤 end_date (type: int; required: N). - page: Page number, starting from 1. If omitted, the server default is used unless ``limit`` or ``all_pages`` is set. - page_size: Rows per page. The SDK validates this against the endpoint-specific maximum. - limit: Maximum number of rows to return. The SDK may fetch multiple pages to satisfy this limit. - all_pages: Fetch and combine pages until the server reports the last page. - max_pages: Optional safety cap for ``all_pages``. - raw: Return the decoded JSON payload without tabular extraction. - fields: Optional field list or comma-separated field string applied after extraction. - as_dataframe: Return a pandas ``DataFrame`` by default; set to ``False`` for Python rows. - **kwargs: Extra request parameters forwarded unchanged. Useful when the service adds parameters before the SDK is regenerated. - - Returns: - A pandas ``DataFrame`` by default, Python rows when - ``as_dataframe=False``, raw JSON when ``raw=True``, or raw page - payloads when multi-page fetching is used with ``raw=True``. - """ - request_params = {'stock_code': stock_code, 'period': period, 'report_type': report_type, 'start_date': start_date, 'end_date': end_date} - request_params.update(kwargs) - path = ENDPOINTS['us_balance'].path - return self.get_paginated( - path, - page=page, - page_size=page_size, - limit=limit, - all_pages=all_pages, - max_pages=max_pages, - max_page_size=500, - raw=raw, - fields=fields, - as_dataframe=as_dataframe, - **request_params, - ) - - def us_basic( - self, - stock_code: Any | None = None, - page: int | None = None, - page_size: int | None = None, - limit: int | None = None, - all_pages: bool = False, - max_pages: int | None = None, - *, - raw: bool = False, - fields: Sequence[str] | str | None = None, - as_dataframe: bool = True, - **kwargs: Any, - ) -> Any: - """美股基础信息. - - Endpoint: ``api/v1/market/data/us/us-basic``. - Method: ``GET``. - Documented endpoint: ``us_basic``. - - Args: - stock_code: 美股代码(可选),纯代码如 NVDA;不传则分页返回全部 (type: string; required: N). - page: Page number, starting from 1. If omitted, the server default is used unless ``limit`` or ``all_pages`` is set. - page_size: Rows per page. The SDK validates this against the endpoint-specific maximum. - limit: Maximum number of rows to return. The SDK may fetch multiple pages to satisfy this limit. - all_pages: Fetch and combine pages until the server reports the last page. - max_pages: Optional safety cap for ``all_pages``. - raw: Return the decoded JSON payload without tabular extraction. - fields: Optional field list or comma-separated field string applied after extraction. - as_dataframe: Return a pandas ``DataFrame`` by default; set to ``False`` for Python rows. - **kwargs: Extra request parameters forwarded unchanged. Useful when the service adds parameters before the SDK is regenerated. - - Returns: - A pandas ``DataFrame`` by default, Python rows when - ``as_dataframe=False``, raw JSON when ``raw=True``, or raw page - payloads when multi-page fetching is used with ``raw=True``. - """ - request_params = {'stock_code': stock_code} - request_params.update(kwargs) - path = ENDPOINTS['us_basic'].path - return self.get_paginated( - path, - page=page, - page_size=page_size, - limit=limit, - all_pages=all_pages, - max_pages=max_pages, - max_page_size=500, - raw=raw, - fields=fields, - as_dataframe=as_dataframe, - **request_params, - ) - - def us_cashflow( - self, - stock_code: Any | None = None, - period: Any | None = None, - report_type: Any | None = None, - start_date: Any | None = None, - end_date: Any | None = None, - page: int | None = None, - page_size: int | None = None, - limit: int | None = None, - all_pages: bool = False, - max_pages: int | None = None, - *, - raw: bool = False, - fields: Sequence[str] | str | None = None, - as_dataframe: bool = True, - **kwargs: Any, - ) -> Any: - """美股现金流. - - Endpoint: ``api/v1/market/data/us/us-cashflow``. - Method: ``GET``. - Documented endpoint: ``us_cashflow``. - - Args: - stock_code: 美股代码,纯代码不带后缀,如 NVDA (type: string; required: Y). - period: 财年(如 2024),匹配 stmt_year,非自然年 (type: int; required: N). - report_type: 报告期类型:Q1 / Q2 / Q3 / Q4 / H1 (type: string; required: N). - start_date: 报告期下界 YYYYMMDD(含),过滤 end_date (type: int; required: N). - end_date: 报告期上界 YYYYMMDD(含),过滤 end_date (type: int; required: N). - page: Page number, starting from 1. If omitted, the server default is used unless ``limit`` or ``all_pages`` is set. - page_size: Rows per page. The SDK validates this against the endpoint-specific maximum. - limit: Maximum number of rows to return. The SDK may fetch multiple pages to satisfy this limit. - all_pages: Fetch and combine pages until the server reports the last page. - max_pages: Optional safety cap for ``all_pages``. - raw: Return the decoded JSON payload without tabular extraction. - fields: Optional field list or comma-separated field string applied after extraction. - as_dataframe: Return a pandas ``DataFrame`` by default; set to ``False`` for Python rows. - **kwargs: Extra request parameters forwarded unchanged. Useful when the service adds parameters before the SDK is regenerated. - - Returns: - A pandas ``DataFrame`` by default, Python rows when - ``as_dataframe=False``, raw JSON when ``raw=True``, or raw page - payloads when multi-page fetching is used with ``raw=True``. - """ - request_params = {'stock_code': stock_code, 'period': period, 'report_type': report_type, 'start_date': start_date, 'end_date': end_date} - request_params.update(kwargs) - path = ENDPOINTS['us_cashflow'].path - return self.get_paginated( - path, - page=page, - page_size=page_size, - limit=limit, - all_pages=all_pages, - max_pages=max_pages, - max_page_size=500, - raw=raw, - fields=fields, - as_dataframe=as_dataframe, - **request_params, - ) - - def us_income( - self, - stock_code: Any | None = None, - period: Any | None = None, - report_type: Any | None = None, - start_date: Any | None = None, - end_date: Any | None = None, - page: int | None = None, - page_size: int | None = None, - limit: int | None = None, - all_pages: bool = False, - max_pages: int | None = None, - *, - raw: bool = False, - fields: Sequence[str] | str | None = None, - as_dataframe: bool = True, - **kwargs: Any, - ) -> Any: - """美股利润表. - - Endpoint: ``api/v1/market/data/us/us-income``. - Method: ``GET``. - Documented endpoint: ``us_income``. - - Args: - stock_code: 美股代码,纯代码不带后缀,如 NVDA (type: string; required: Y). - period: 财年(如 2024),匹配 stmt_year,非自然年 (type: int; required: N). - report_type: 报告期类型:Q1 / Q2 / Q3 / Q4 / H1 (type: string; required: N). - start_date: 报告期下界 YYYYMMDD(含),过滤 end_date (type: int; required: N). - end_date: 报告期上界 YYYYMMDD(含),过滤 end_date (type: int; required: N). - page: Page number, starting from 1. If omitted, the server default is used unless ``limit`` or ``all_pages`` is set. - page_size: Rows per page. The SDK validates this against the endpoint-specific maximum. - limit: Maximum number of rows to return. The SDK may fetch multiple pages to satisfy this limit. - all_pages: Fetch and combine pages until the server reports the last page. - max_pages: Optional safety cap for ``all_pages``. - raw: Return the decoded JSON payload without tabular extraction. - fields: Optional field list or comma-separated field string applied after extraction. - as_dataframe: Return a pandas ``DataFrame`` by default; set to ``False`` for Python rows. - **kwargs: Extra request parameters forwarded unchanged. Useful when the service adds parameters before the SDK is regenerated. - - Returns: - A pandas ``DataFrame`` by default, Python rows when - ``as_dataframe=False``, raw JSON when ``raw=True``, or raw page - payloads when multi-page fetching is used with ``raw=True``. - """ - request_params = {'stock_code': stock_code, 'period': period, 'report_type': report_type, 'start_date': start_date, 'end_date': end_date} - request_params.update(kwargs) - path = ENDPOINTS['us_income'].path - return self.get_paginated( - path, - page=page, - page_size=page_size, - limit=limit, - all_pages=all_pages, - max_pages=max_pages, - max_page_size=500, - raw=raw, - fields=fields, - as_dataframe=as_dataframe, - **request_params, - ) diff --git a/src/ftshare/base.py b/src/ftshare/base.py index f9ddbda..ed70e23 100644 --- a/src/ftshare/base.py +++ b/src/ftshare/base.py @@ -2,6 +2,7 @@ from __future__ import annotations +import os import re from collections.abc import Mapping, Sequence from typing import Any @@ -25,6 +26,8 @@ class BaseClient: base_url: API base URL. Defaults to ``DEFAULT_BASE_URL``. timeout: Request timeout in seconds. headers: Optional headers sent with every request. + api_key: Optional FTShare API key. Defaults to the ``FTSHARE_API_KEY`` + environment variable. session: Optional ``requests.Session``. Primarily useful for tests or for callers that need custom adapters. """ @@ -34,12 +37,17 @@ def __init__( base_url: str | None = None, timeout: float = 10, headers: Mapping[str, str] | None = None, + api_key: str | None = None, session: requests.Session | None = None, ) -> None: self.base_url = normalize_base_url(base_url or get_base_url()) self.timeout = timeout self.session = session or requests.Session() self.headers = dict(headers or {}) + if api_key is None: + api_key = os.environ.get("FTSHARE_API_KEY") + if api_key is not None: + self.headers["FTSHARE_API_KEY"] = api_key def close(self) -> None: """Close the underlying HTTP session.""" @@ -103,21 +111,8 @@ def post( as_dataframe: bool = True, **params: Any, ) -> Any: - """Send a POST request with a JSON body and normalize the response. - - Args: - path: Endpoint path relative to ``base_url``. - raw: When ``True``, return the decoded JSON payload. - fields: Optional field list or comma-separated field string. - as_dataframe: Return a pandas ``DataFrame`` by default. - **params: JSON body parameters. Values set to ``None`` are omitted. - - Returns: - A pandas ``DataFrame`` by default, Python rows when - ``as_dataframe=False``, or raw JSON when ``raw=True``. - """ - return self._request( - "POST", + """Send a compatibility request using GET and normalize the response.""" + return self.get( path, raw=raw, fields=fields, @@ -139,24 +134,18 @@ def _request( url = self._url_for(path) clean_params = {key: value for key, value in params.items() if value is not None} request_method = method.upper() - if request_method == "POST": - response = self.session.post( - url, - json=clean_params, - timeout=self.timeout, - headers=self.headers or None, - ) - else: - query_params = { - key: str(value).lower() if isinstance(value, bool) else value - for key, value in clean_params.items() - } - response = self.session.get( - url, - params=query_params, - timeout=self.timeout, - headers=self.headers or None, - ) + if request_method != "GET": + raise ValueError(f"Unsupported HTTP method: {method}") + query_params = { + key: str(value).lower() if isinstance(value, bool) else value + for key, value in clean_params.items() + } + response = self.session.get( + url, + params=query_params, + timeout=self.timeout, + headers=self.headers or None, + ) if not 200 <= response.status_code < 300: raise FtshareHTTPError(response.status_code, url, response.text) @@ -189,8 +178,8 @@ def _call_endpoint( """Call an endpoint by registry name using its documented HTTP method.""" endpoint = ENDPOINTS[endpoint_name] path = self._format_path(endpoint.path, path_params or {}) - if endpoint.method == "POST": - return self.post(path, raw=raw, fields=fields, as_dataframe=as_dataframe, **params) + if endpoint.method != "GET": + raise ValueError(f"Unsupported HTTP method for endpoint: {endpoint.method}") return self.get(path, raw=raw, fields=fields, as_dataframe=as_dataframe, **params) def get_paginated( diff --git a/src/ftshare/client.py b/src/ftshare/client.py index 723b8ac..3c97e31 100644 --- a/src/ftshare/client.py +++ b/src/ftshare/client.py @@ -16,7 +16,6 @@ LlmCorpusApiMixin, SpotApiMixin, StockApiMixin, - UnpublishedApiMixin, UsApiMixin, ) from .base import DEFAULT_BASE_URL, BaseClient, get_base_url, set_base_url @@ -35,7 +34,6 @@ class FtshareClient( LlmCorpusApiMixin, SpotApiMixin, ForexApiMixin, - UnpublishedApiMixin, BaseClient, ): """Synchronous client for all documented FTShare data endpoints. @@ -49,6 +47,7 @@ def market_api( base_url: str | None = None, timeout: float = 10, headers: Mapping[str, str] | None = None, + api_key: str | None = None, ) -> FtshareClient: """Create a synchronous FTShare market data API client. @@ -57,11 +56,13 @@ def market_api( base URL. timeout: Request timeout in seconds. headers: Optional headers sent with every request. + api_key: Optional FTShare API key. Defaults to the ``FTSHARE_API_KEY`` + environment variable. Returns: A configured ``FtshareClient`` instance. """ - return FtshareClient(base_url=base_url, timeout=timeout, headers=headers) + return FtshareClient(base_url=base_url, timeout=timeout, headers=headers, api_key=api_key) __all__ = [ diff --git a/src/ftshare/endpoints/__init__.py b/src/ftshare/endpoints/__init__.py index 9b2ff27..c02134c 100644 --- a/src/ftshare/endpoints/__init__.py +++ b/src/ftshare/endpoints/__init__.py @@ -15,7 +15,6 @@ from .llm_corpus import ENDPOINTS as LLM_CORPUS_ENDPOINTS from .spot import ENDPOINTS as SPOT_ENDPOINTS from .forex import ENDPOINTS as FOREX_ENDPOINTS -from .unpublished import ENDPOINTS as UNPUBLISHED_ENDPOINTS ENDPOINTS: dict[str, Endpoint] = {} @@ -31,7 +30,6 @@ ENDPOINTS.update(LLM_CORPUS_ENDPOINTS) ENDPOINTS.update(SPOT_ENDPOINTS) ENDPOINTS.update(FOREX_ENDPOINTS) -ENDPOINTS.update(UNPUBLISHED_ENDPOINTS) __all__ = ["ENDPOINTS", "Endpoint"] diff --git a/src/ftshare/endpoints/bond.py b/src/ftshare/endpoints/bond.py index b3ad339..bb6d923 100644 --- a/src/ftshare/endpoints/bond.py +++ b/src/ftshare/endpoints/bond.py @@ -6,33 +6,44 @@ ENDPOINTS: dict[str, Endpoint] = build_endpoints({ - 'cb_base_data': { - 'path': 'api/v1/market/data/cb/cb-base-data', - 'title': '可转债基础数据', - 'doc_file': '可转债基础数据.md', - 'original_api': 'get_cb_base_data_handler', - 'params': ('symbol_code',), - }, - 'cb_lists': { - 'path': 'api/v1/market/data/cb/cb-lists', - 'title': '可转债列表', - 'doc_file': '可转债列表.md', - 'original_api': 'get_cb_lists_handler', - }, 'convertible_bond_candlesticks': { 'path': 'api/v1/market/data/convertible-bond-candlesticks', 'title': '可转债K线', 'doc_file': '可转债K线.md', 'original_api': 'convertible_bond_candlesticks', - 'method': 'POST', + 'method': 'GET', 'params': ('symbol', 'interval_unit', 'interval_value', 'adjust_kind', 'since_ts_millis', 'until_ts_millis', 'limit'), }, - 'convertible_bond_candlesticks_batch': { - 'path': 'api/v1/market/data/convertible-bond-candlesticks/batch', - 'title': '批量可转债K线', - 'doc_file': '批量可转债K线.md', - 'original_api': 'convertible_bond_candlesticks_batch', - 'method': 'POST', - 'params': ('symbols', 'interval_unit', 'interval_value', 'adjust_kind', 'since_ts_millis', 'until_ts_millis', 'limit'), + 'szse_convertible_bond_matching_trades': { + 'path': 'api/v1/market/data/convertible-bond/szse/matching-trades', + 'title': '深交所可转债匹配成交', + 'doc_file': '深交所可转债匹配成交.md', + 'original_api': 'szse_convertible_bond_matching_trades', + 'params': ('security_code', 'trade_date', 'start_date', 'end_date', 'page', 'page_size'), }, + + 'szse_convertible_bond_negotiated_trades': { + 'path': 'api/v1/market/data/convertible-bond/szse/negotiated-trades', + 'title': '深交所可转债协议成交', + 'doc_file': '深交所可转债协议成交.md', + 'original_api': 'szse_convertible_bond_negotiated_trades', + 'params': ('security_code', 'trade_date', 'start_date', 'end_date', 'page', 'page_size'), + }, + + 'szse_convertible_bond_directed_trades': { + 'path': 'api/v1/market/data/convertible-bond/szse/directed-trades', + 'title': '深交所可转债定向成交', + 'doc_file': '深交所可转债定向成交.md', + 'original_api': 'szse_convertible_bond_directed_trades', + 'params': ('security_code', 'trade_date', 'start_date', 'end_date', 'page', 'page_size'), + }, + + 'szse_convertible_bond_declaration_snapshots': { + 'path': 'api/v1/market/data/convertible-bond/szse/declaration-snapshots', + 'title': '深交所可转债申报快照', + 'doc_file': '深交所可转债申报快照.md', + 'original_api': 'szse_convertible_bond_declaration_snapshots', + 'params': ('security_code', 'trade_date', 'start_date', 'end_date', 'page', 'page_size'), + }, + }) diff --git a/src/ftshare/endpoints/economic.py b/src/ftshare/endpoints/economic.py index 1202800..2387621 100644 --- a/src/ftshare/endpoints/economic.py +++ b/src/ftshare/endpoints/economic.py @@ -18,6 +18,8 @@ 'title': '社融信贷', 'doc_file': '社融信贷.md', 'original_api': 'consumer_credit_monthly', + 'params': ('page', 'page_size'), + 'max_page_size': 200, }, 'consumer_customs_trade_monthly': { 'path': 'api/v1/market/data/economic/china-customs-trade', @@ -54,24 +56,32 @@ 'title': '货币供应', 'doc_file': '货币供应.md', 'original_api': 'consumer_money_supply_monthly', + 'params': ('page', 'page_size'), + 'max_page_size': 200, }, 'consumer_pmi_monthly': { 'path': 'api/v1/market/data/economic/china-pmi', 'title': 'PMI', 'doc_file': 'PMI.md', 'original_api': 'consumer_pmi_monthly', + 'params': ('page', 'page_size'), + 'max_page_size': 200, }, 'consumer_ppi_monthly': { 'path': 'api/v1/market/data/economic/china-ppi', 'title': 'PPI', 'doc_file': 'PPI.md', 'original_api': 'consumer_ppi_monthly', + 'params': ('page', 'page_size'), + 'max_page_size': 200, }, 'consumer_price_index_monthly': { 'path': 'api/v1/market/data/economic/china-cpi', 'title': 'CPI', 'doc_file': 'CPI.md', 'original_api': 'consumer_price_index_monthly', + 'params': ('page', 'page_size'), + 'max_page_size': 200, }, 'consumer_retail_sales_monthly': { 'path': 'api/v1/market/data/economic/china-retail-sales', @@ -111,4 +121,52 @@ 'original_api': 'wallstreetcn_financial_calendar', 'params': ('start_date', 'end_date', 'page', 'page_size'), }, + 'hibor_daily': { + 'path': 'api/v1/market/data/hibor-daily', + 'title': 'HIBOR日度利率', + 'doc_file': 'HIBOR日度利率.md', + 'original_api': 'hibor_daily', + 'params': ('start_date', 'end_date', 'page', 'page_size'), + }, + + 'shibor_quote_daily': { + 'path': 'api/v1/market/data/shibor-quote-daily', + 'title': 'SHIBOR报价日度', + 'doc_file': 'SHIBOR报价日度.md', + 'original_api': 'shibor_quote_daily', + 'params': ('start_date', 'end_date', 'bank', 'page', 'page_size'), + }, + + 'shibor_daily': { + 'path': 'api/v1/market/data/shibor-daily', + 'title': 'SHIBOR日度利率', + 'doc_file': 'SHIBOR日度利率.md', + 'original_api': 'shibor_daily', + 'params': ('start_date', 'end_date', 'page', 'page_size'), + }, + + 'chinabond_yield_daily': { + 'path': 'api/v1/market/data/chinabond-yield-daily', + 'title': '中债收益率曲线日度', + 'doc_file': '中债收益率曲线日度.md', + 'original_api': 'chinabond_yield_daily', + 'params': ('start_date', 'end_date', 'curve_name', 'page', 'page_size'), + }, + + 'libor_daily': { + 'path': 'api/v1/market/data/libor-daily', + 'title': '国际基准利率日度', + 'doc_file': '国际基准利率日度.md', + 'original_api': 'libor_daily', + 'params': ('start_date', 'end_date', 'currency', 'tenor', 'page', 'page_size'), + }, + + 'wz_index_daily': { + 'path': 'api/v1/market/data/wz-index-daily', + 'title': '温州民间融资综合利率指数日度', + 'doc_file': '温州民间融资综合利率指数日度.md', + 'original_api': 'wz_index_daily', + 'params': ('start_date', 'end_date', 'page', 'page_size'), + }, + }) diff --git a/src/ftshare/endpoints/etf.py b/src/ftshare/endpoints/etf.py index 3f1f92d..9dfd813 100644 --- a/src/ftshare/endpoints/etf.py +++ b/src/ftshare/endpoints/etf.py @@ -11,52 +11,31 @@ 'title': 'ETF复权因子', 'doc_file': 'ETF复权因子.md', 'original_api': 'etf_adjust_factor', - 'params': ('symbol', 'trade_date', 'start_date', 'end_date', 'offset', 'limit'), + 'params': ('symbol', 'trade_date', 'start_date', 'end_date', 'page', 'page_size'), }, 'etf_candlesticks': { 'path': 'api/v1/market/data/etf-candlesticks', 'title': 'ETFK线', 'doc_file': 'ETFK线.md', 'original_api': 'etf_candlesticks', - 'method': 'POST', + 'method': 'GET', 'params': ('symbol', 'interval_unit', 'interval_value', 'adjust_kind', 'since_ts_millis', 'until_ts_millis', 'limit'), }, - 'etf_candlesticks_batch': { - 'path': 'api/v1/market/data/etf-candlesticks/batch', - 'title': '批量ETFK线', - 'doc_file': '批量ETFK线.md', - 'original_api': 'etf_candlesticks_batch', - 'method': 'POST', - 'params': ('symbols', 'interval_unit', 'interval_value', 'adjust_kind', 'since_ts_millis', 'until_ts_millis', 'limit'), - }, - 'etf_components': { - 'path': 'api/v1/market/data/etf-component', - 'title': 'ETF成份股', - 'doc_file': 'ETF成份股.md', - 'original_api': 'get_etf_components_handler', - 'params': ('symbol',), - }, 'etf_components_all': { - 'path': 'api/v1/market/data/etf-components-all', + 'path': 'api/v2/market/data/etf-components-all', 'title': 'ETF成份列表', 'doc_file': 'ETF成份列表.md', 'original_api': 'etf_components_all', + 'params': ('symbol',), }, 'etf_description_all': { - 'path': 'api/v1/market/data/etf-description-all', + 'path': 'api/v2/market/data/etf-description-all', 'title': 'ETF基础信息', 'doc_file': 'ETF基础信息.md', 'original_api': 'etf_description_all', }, - 'etf_fund_export': { - 'path': 'api/v1/market/data/etf/zhitou-etf', - 'title': '指数ETF基金导出', - 'doc_file': '指数ETF基金导出.md', - 'original_api': 'etf_fund_export', - 'params': ('request_id', 'page', 'page_size'), - }, 'etf_pcf_list': { - 'path': 'api/v1/market/data/etf-pcf/etf-pcfs', + 'path': 'api/v2/market/data/etf-pcf/etf-pcfs', 'title': 'ETF-PCF清单列表', 'doc_file': 'ETF-PCF清单列表.md', 'original_api': 'etf_pcf_list_handler', @@ -64,17 +43,41 @@ 'max_page_size': 100, }, 'etf_pre': { - 'path': 'api/v1/market/data/etf-pre-data', + 'path': 'api/v2/market/data/etf-pre-data', 'title': 'ETF盘前数据', 'doc_file': 'ETF盘前数据.md', 'original_api': 'get_etf_pre', 'params': ('date',), }, 'etf_pre_single': { - 'path': 'api/v1/market/data/etf-pre-single', + 'path': 'api/v2/market/data/etf-pre-single', 'title': '单只ETF盘前数据', 'doc_file': '单只ETF盘前数据.md', 'original_api': 'get_etf_pre_single_handler', 'params': ('symbol', 'date'), }, + 'etf_minutes': { + 'path': 'api/v3/market/data/etf_minutes', + 'title': 'ETF历史分钟行情', + 'doc_file': 'ETF历史分钟行情.md', + 'original_api': 'etf_minutes', + 'params': ('symbol', 'interval_value', 'adjust_kind', 'since_ts_millis', 'until_ts_millis', 'limit'), + }, + + 'etf_realtime_minute_kline': { + 'path': 'api/v4/market/data/etf-realtime-minute-kline', + 'title': 'ETF实时分钟K线', + 'doc_file': 'ETF实时分钟K线.md', + 'original_api': 'etf_realtime_minute_kline', + 'params': ('symbols',), + }, + + 'etf_realtime_day_kline': { + 'path': 'api/v4/market/data/etf-realtime-day-kline', + 'title': 'ETF实时日K线', + 'doc_file': 'ETF实时日K线.md', + 'original_api': 'etf_realtime_day_kline', + 'params': ('symbols',), + }, + }) diff --git a/src/ftshare/endpoints/forex.py b/src/ftshare/endpoints/forex.py index 1c18242..a268776 100644 --- a/src/ftshare/endpoints/forex.py +++ b/src/ftshare/endpoints/forex.py @@ -6,10 +6,4 @@ ENDPOINTS: dict[str, Endpoint] = build_endpoints({ - 'consumer_forex_gold_monthly': { - 'path': 'api/v1/market/data/economic/china-forex-gold', - 'title': '外汇黄金', - 'doc_file': '外汇黄金.md', - 'original_api': 'consumer_forex_gold_monthly', - }, }) diff --git a/src/ftshare/endpoints/fund.py b/src/ftshare/endpoints/fund.py index 132e7e1..d77a3a1 100644 --- a/src/ftshare/endpoints/fund.py +++ b/src/ftshare/endpoints/fund.py @@ -20,13 +20,6 @@ 'original_api': 'get_fund_cal_return', 'params': ('institution_code', 'cal-type'), }, - 'fund_nav': { - 'path': 'api/v1/market/data/fund/fund-nav', - 'title': '基金净值', - 'doc_file': '基金净值.md', - 'original_api': 'get_fund_nav', - 'params': ('institution_code', 'page', 'page_size'), - }, 'fund_overview': { 'path': 'api/v1/market/data/fund/fund-overview', 'title': '基金总览', @@ -111,13 +104,6 @@ 'original_api': 'get_fund_manager', 'params': ('fund_code', 'fund_manager', 'is_inoffice', 'page', 'page_size'), }, - 'fund_daily': { - 'path': 'api/v1/market/data/fund/fund-daily', - 'title': '基金行情日线', - 'doc_file': '基金行情日线.md', - 'original_api': 'get_fund_daily', - 'params': ('fund_code', 'trade_date', 'start_date', 'end_date', 'page', 'page_size'), - }, 'fund_fee': { 'path': 'api/v1/market/data/fund/fund-fee', 'title': '基金费率', @@ -140,7 +126,7 @@ 'params': ('fund_code', 'history'), }, 'fund_index_fund': { - 'path': 'api/v1/market/data/fund/index-fund', + 'path': 'api/v2/market/data/fund/index-fund', 'title': '指数跟踪基金', 'doc_file': '指数跟踪基金.md', 'original_api': 'get_fund_index_fund', diff --git a/src/ftshare/endpoints/futures.py b/src/ftshare/endpoints/futures.py index 06a072c..2a2ad05 100644 --- a/src/ftshare/endpoints/futures.py +++ b/src/ftshare/endpoints/futures.py @@ -27,48 +27,26 @@ 'original_api': 'get_eastmoney_futures_position', 'params': ('exchange', 'variety_code', 'contract_code', 'trade_date', 'start_date', 'end_date', 'member_name_abbr', 'page', 'page_size'), }, - 'eastmoney_futures_strange': { - 'path': 'api/v1/market/data/eastmoney-futures-strange', - 'title': '东方财富期货龙虎榜', - 'doc_file': '东方财富期货龙虎榜.md', - 'original_api': 'eastmoney_futures_strange', - 'params': ('exchange', 'variety', 'contract', 'trade_date'), - }, - 'futures_contract_kline': { - 'path': 'api/v1/market/data/futures/kline', - 'title': '期货合约K线', - 'doc_file': '期货合约K线.md', - 'original_api': 'futures_contract_kline', + 'futures_minutes': { + 'path': 'api/v3/market/data/futures_minutes', + 'title': '期货历史分钟行情', + 'doc_file': '期货历史分钟行情.md', + 'original_api': 'futures_minutes', 'params': ('symbol', 'interval', 'start', 'end', 'limit'), }, - 'futures_kline': { + 'futures_contract_kline': { 'path': 'api/v1/market/data/futures/kline', - 'title': '期货合约K线', - 'doc_file': '期货合约K线.md', + 'title': '期货行情', + 'doc_file': '期货行情.md', 'original_api': 'futures_contract_kline', 'params': ('symbol', 'interval', 'start', 'end', 'limit'), }, - 'futures_kline_intraday': { - 'path': 'api/v1/market/data/futures/kline/intraday', - 'title': '期货日内K线', - 'doc_file': '期货日内K线.md', - 'original_api': 'futures_kline_intraday', - 'params': ('symbol', 'interval', 'start', 'end', 'limit'), - }, - 'futures_kline_latest': { - 'path': 'api/v1/market/data/futures/kline/latest', - 'title': '期货最新K线', - 'doc_file': '期货最新K线.md', - 'original_api': 'futures_kline_latest', - 'params': ('symbol', 'interval'), - }, - 'futures_eod_price': { - 'path': 'api/v1/market/data/futures/eod-price', - 'title': '期货日终行情', - 'doc_file': '期货日终行情.md', - 'original_api': 'futures_eod_price', - 'params': ('exchange', 'symbol', 'trade_date', 'start_date', 'end_date', 'page', 'page_size'), - 'max_page_size': 200, + 'futures_minutes_realtime': { + 'path': 'api/v4/market/data/futures_minutes/realtime', + 'title': '期货实时分钟K线', + 'doc_file': '期货实时分钟K线.md', + 'original_api': 'futures_minutes_realtime', + 'params': ('symbols',), }, 'major_contract': { 'path': 'api/v1/market/data/corporate/contract', @@ -92,20 +70,44 @@ 'original_api': 'major_contract_summary', 'params': ('page', 'page_size'), }, - 'member_build_process': { - 'path': 'api/v1/market/data/member-build-process', - 'title': '会员建仓过程', - 'doc_file': '会员建仓过程.md', - 'original_api': 'member_build_process', - 'params': ('exchange', 'member_name', 'instrument_id', 'start_date', 'end_date', 'contract_multiplier', 'page', 'page_size'), - 'max_page_size': 200, + 'fut_wsr': { + 'path': 'api/v1/market/data/futures/fut-wsr', + 'title': '期货仓单日报', + 'doc_file': '期货仓单日报.md', + 'original_api': 'fut_wsr', + 'params': ('trade_date', 'start_date', 'end_date', 'symbol', 'exchange', 'page', 'page_size'), }, - 'member_position_ranking': { - 'path': 'api/v1/market/data/member-position-ranking', - 'title': '会员持仓排名', - 'doc_file': '会员持仓排名.md', - 'original_api': 'member_position_ranking', - 'params': ('exchange', 'instrument_id', 'trade_date', 'direction', 'page', 'page_size'), - 'max_page_size': 200, + + 'fut_weekly_detail': { + 'path': 'api/v1/market/data/futures/fut-weekly-detail', + 'title': '期货主要品种交易周报', + 'doc_file': '期货主要品种交易周报.md', + 'original_api': 'fut_weekly_detail', + 'params': ('week', 'prd', 'start_week', 'end_week', 'exchange', 'page', 'page_size'), + }, + + 'fut_settle': { + 'path': 'api/v1/market/data/futures/fut-settle', + 'title': '期货每日结算参数', + 'doc_file': '期货每日结算参数.md', + 'original_api': 'fut_settle', + 'params': ('ts_code', 'trade_date', 'start_date', 'end_date', 'exchange', 'page', 'page_size'), + }, + + 'ft_limit': { + 'path': 'api/v1/market/data/futures/ft-limit', + 'title': '期货合约涨跌停价', + 'doc_file': '期货合约涨跌停价.md', + 'original_api': 'ft_limit', + 'params': ('ts_code', 'trade_date', 'start_date', 'end_date', 'cont', 'exchange', 'page', 'page_size'), + }, + + 'futures_nanhua_index_kline': { + 'path': 'api/v1/market/data/futures/nanhua-index-kline', + 'title': '南华期货指数日K线', + 'doc_file': '南华期货指数日K线.md', + 'original_api': 'futures_nanhua_index_kline', + 'params': ('code', 'trade_date', 'start_date', 'end_date', 'page', 'page_size'), }, + }) diff --git a/src/ftshare/endpoints/hk.py b/src/ftshare/endpoints/hk.py index 70ae452..43068c9 100644 --- a/src/ftshare/endpoints/hk.py +++ b/src/ftshare/endpoints/hk.py @@ -6,110 +6,18 @@ ENDPOINTS: dict[str, Endpoint] = build_endpoints({ - 'company_hk': { - 'path': 'api/v1/market/data/hk/company-hk', - 'title': '港股公司信息', - 'doc_file': '港股公司信息.md', - 'original_api': 'get_company_hk', - 'params': ('trade_code',), - }, - 'eastmoney_hk_index_daily_kline': { - 'path': 'api/v1/market/data/eastmoney-hk-index-daily-kline', - 'title': '东方财富港股指数日K', - 'doc_file': '东方财富港股指数日K.md', - 'original_api': 'get_eastmoney_hk_index_daily_kline', - 'params': ('index_code', 'trade_date', 'start_date', 'end_date', 'page', 'page_size'), - }, - 'hk_balance_bank': { - 'path': 'api/v1/market/data/hk/hk-balance-bank', - 'title': '港股资产负债表', - 'doc_file': '港股资产负债表.md', - 'original_api': 'hk_balance_bank', - 'params': ('trade_code', 'year', 'report_type', 'start_date', 'end_date', 'page', 'page_size'), - }, - 'hk_balance_gene': { - 'path': 'api/v1/market/data/hk/hk-balance-gene', - 'title': '港股资产负债表', - 'doc_file': '港股资产负债表.md', - 'original_api': 'hk_balance_gene', - 'params': ('trade_code', 'year', 'report_type', 'start_date', 'end_date', 'page', 'page_size'), - }, - 'hk_balance_insur': { - 'path': 'api/v1/market/data/hk/hk-balance-insur', - 'title': '港股资产负债表', - 'doc_file': '港股资产负债表.md', - 'original_api': 'hk_balance_insur', - 'params': ('trade_code', 'year', 'report_type', 'start_date', 'end_date', 'page', 'page_size'), - }, - 'hk_basinfo_get': { - 'path': 'api/v1/market/data/hk/hk-view', - 'title': '港股个股信息', - 'doc_file': '港股个股信息.md', - 'original_api': 'get_hk_basinfo_get', - 'params': ('hk_code',), - }, - 'hk_basinfo_post': { - 'path': 'api/v1/market/data/hk/hk-view', - 'title': '港股个股信息', - 'doc_file': '港股个股信息.md', - 'original_api': 'get_hk_basinfo_post', - 'params': ('hk_code',), - }, 'hk_candlesticks': { - 'path': 'api/v1/market/data/hk/hk-candlesticks', + 'path': 'api/v3/market/data/hk/hk-candlesticks', 'title': '港股K线', 'doc_file': '港股K线.md', 'original_api': 'get_hk_candlesticks', 'params': ('trade_code', 'interval_unit', 'until_date', 'since_date', 'interval_value', 'limit', 'adjust_kind'), }, - 'hk_cashflow': { - 'path': 'api/v1/market/data/hk/hk-cashflow', - 'title': '港股现金流量表', - 'doc_file': '港股现金流量表.md', - 'original_api': 'hk_cashflow', - 'params': ('stock_code', 'year', 'report_type', 'start_date', 'end_date', 'page', 'page_size'), - }, - 'hk_income_bank': { - 'path': 'api/v1/market/data/hk/hk-income-bank', - 'title': '港股利润表', - 'doc_file': '港股利润表.md', - 'original_api': 'hk_income_bank', - 'params': ('trade_code', 'year', 'report_type', 'start_date', 'end_date', 'page', 'page_size'), - }, - 'hk_income_gene': { - 'path': 'api/v1/market/data/hk/hk-income-gene', - 'title': '港股利润表', - 'doc_file': '港股利润表.md', - 'original_api': 'hk_income_gene', - 'params': ('trade_code', 'year', 'report_type', 'start_date', 'end_date', 'page', 'page_size'), - }, - 'hk_income_insur': { - 'path': 'api/v1/market/data/hk/hk-income-insur', - 'title': '港股利润表', - 'doc_file': '港股利润表.md', - 'original_api': 'hk_income_insur', - 'params': ('trade_code', 'year', 'report_type', 'start_date', 'end_date', 'page', 'page_size'), - }, - 'hk_valuatnanalyd': { - 'path': 'api/v1/market/data/hk/hk-valuatnanalyd', - 'title': '港股估值分析', - 'doc_file': '港股估值分析.md', - 'original_api': 'get_hk_valuatnanalyd', - 'params': ('trade_code', 'page', 'page_size'), - }, - 'hsi_daily_weight': { - 'path': 'api/v1/market/data/hk/hsi-daily-weight', - 'title': '恒生指数每日权重', - 'doc_file': '恒生指数每日权重.md', - 'original_api': 'hsi_daily_weight', - 'params': ('trade_date', 'start_date', 'end_date', 'index_slug', 'stock_code', 'page', 'page_size'), - 'max_page_size': 200, - }, - 'market_cap_hk': { - 'path': 'api/v1/market/data/hk/market-cap-hk', - 'title': '港股市值', - 'doc_file': '港股市值.md', - 'original_api': 'get_market_cap_hk', - 'params': ('trade_code',), + 'hk_stock_info_all': { + 'path': 'api/v4/market/data/hk-stock-info-all', + 'title': '港股实时行情', + 'doc_file': '港股实时行情.md', + 'original_api': 'hk_stock_info_all', + 'params': (), }, }) diff --git a/src/ftshare/endpoints/index.py b/src/ftshare/endpoints/index.py index c06a02c..93be1c9 100644 --- a/src/ftshare/endpoints/index.py +++ b/src/ftshare/endpoints/index.py @@ -7,33 +7,26 @@ ENDPOINTS: dict[str, Endpoint] = build_endpoints({ 'global_index_daily_kline': { - 'path': 'api/v1/market/data/global-index/daily-kline', + 'path': 'api/v2/market/data/global-index/daily-kline', 'title': '全球指数日K线', 'doc_file': '全球指数日K线.md', 'original_api': 'global_index_daily_kline', - 'params': ('secid', 'start_date', 'end_date'), + 'params': ('secid', 'start_date', 'end_date', 'limit'), }, 'index_candlesticks': { 'path': 'api/v1/market/data/index-candlesticks', 'title': '指数K线', 'doc_file': '指数K线.md', 'original_api': 'index_candlesticks', - 'method': 'POST', + 'method': 'GET', 'params': ('symbol', 'interval_unit', 'interval_value', 'adjust_kind', 'since_ts_millis', 'until_ts_millis', 'limit'), }, - 'index_candlesticks_batch': { - 'path': 'api/v1/market/data/index-candlesticks/batch', - 'title': '批量指数K线', - 'doc_file': '批量指数K线.md', - 'original_api': 'index_candlesticks_batch', - 'method': 'POST', - 'params': ('symbols', 'interval_unit', 'interval_value', 'adjust_kind', 'since_ts_millis', 'until_ts_millis', 'limit'), - }, 'index_description_all': { 'path': 'api/v1/market/data/index-description-all', 'title': '指数基础信息', 'doc_file': '指数基础信息.md', 'original_api': 'index_description_all', + 'params': ('page', 'page_size'), }, 'index_description_list': { 'path': 'api/v1/market/data/index/index_description', @@ -80,4 +73,28 @@ 'original_api': 'sw_industry_overview', 'params': ('date', 'level', 'page', 'page_size'), }, + 'index_minutes': { + 'path': 'api/v3/market/data/index_minutes', + 'title': '指数历史分钟行情', + 'doc_file': '指数历史分钟行情.md', + 'original_api': 'index_minutes', + 'params': ('symbol', 'interval_value', 'since_ts_millis', 'until_ts_millis', 'limit'), + }, + + 'index_realtime_minute_kline': { + 'path': 'api/v4/market/data/index-realtime-minute-kline', + 'title': '指数实时分钟K线', + 'doc_file': '指数实时分钟K线.md', + 'original_api': 'index_realtime_minute_kline', + 'params': ('symbols',), + }, + + 'index_realtime_day_kline': { + 'path': 'api/v4/market/data/index-realtime-day-kline', + 'title': '指数实时日K线', + 'doc_file': '指数实时日K线.md', + 'original_api': 'index_realtime_day_kline', + 'params': ('symbols',), + }, + }) diff --git a/src/ftshare/endpoints/llm_corpus.py b/src/ftshare/endpoints/llm_corpus.py index e43ec9e..987d166 100644 --- a/src/ftshare/endpoints/llm_corpus.py +++ b/src/ftshare/endpoints/llm_corpus.py @@ -7,7 +7,7 @@ ENDPOINTS: dict[str, Endpoint] = build_endpoints({ 'semantic_search_news': { - 'path': 'api/v1/market/data/semantic-search-news', + 'path': 'api/v3/market/data/semantic-search-news', 'title': '新闻语义搜索', 'doc_file': '新闻语义搜索.md', 'original_api': 'semantic_search_news_handler', @@ -21,24 +21,17 @@ 'params': ('page', 'page_size'), }, 'stock_announcements': { - 'path': 'api/v1/market/data/announcements/stock-announcements', + 'path': 'api/v3/market/data/announcements/stock-announcements', 'title': '公告列表', 'doc_file': '公告列表.md', 'original_api': 'stock_announcements', 'params': ('stock_code', 'start_date', 'end_date', 'type', 'page', 'page_size'), }, 'stock_reports': { - 'path': 'api/v1/market/data/report/stock-reports', + 'path': 'api/v3/market/data/report/stock-reports', 'title': '研报列表', 'doc_file': '研报列表.md', 'original_api': 'stock_reports', 'params': ('stock_code', 'start_date', 'end_date', 'type', 'page', 'page_size'), }, - 'type_reports': { - 'path': 'api/v1/market/data/report/type-reports', - 'title': '研报分类', - 'doc_file': '研报分类.md', - 'original_api': 'type_reports', - 'params': ('rept_type', 'start_date', 'end_date', 'page', 'page_size'), - }, }) diff --git a/src/ftshare/endpoints/spot.py b/src/ftshare/endpoints/spot.py index e481e18..56f2cf6 100644 --- a/src/ftshare/endpoints/spot.py +++ b/src/ftshare/endpoints/spot.py @@ -13,10 +13,4 @@ 'original_api': 'get_bullion_price', 'params': ('symbol', 'start_date', 'end_date', 'page', 'page_size'), }, - 'bullion_support_symbol': { - 'path': 'api/v1/market/data/bullion/support-symbol', - 'title': '贵金属支持标的', - 'doc_file': '贵金属支持标的.md', - 'original_api': 'get_bullion_support_symbol', - }, }) diff --git a/src/ftshare/endpoints/stock.py b/src/ftshare/endpoints/stock.py index 5eadbe7..7a95b9b 100644 --- a/src/ftshare/endpoints/stock.py +++ b/src/ftshare/endpoints/stock.py @@ -11,17 +11,17 @@ 'title': '龙虎榜明细', 'doc_file': '龙虎榜明细.md', 'original_api': 'abnormal_trading_details', - 'params': ('date',), + 'params': ('date', 'page', 'page_size'), }, 'abnormal_trading_overview': { 'path': 'api/v1/market/data/abnormal-trading-overview', 'title': '龙虎榜总览', 'doc_file': '龙虎榜总览.md', 'original_api': 'abnormal_trading_overview', - 'params': ('date',), + 'params': ('date', 'page', 'page_size'), }, 'auction_results': { - 'path': 'api/v1/market/data/auction-results', + 'path': 'api/v2/market/data/auction-results', 'title': '集合竞价结果', 'doc_file': '集合竞价结果.md', 'original_api': 'auction_results', @@ -40,7 +40,7 @@ 'title': '大宗交易', 'doc_file': '大宗交易.md', 'original_api': 'block_trades', - 'params': ('date',), + 'params': ('date', 'page', 'page_size'), }, 'bse_mapping': { 'path': 'api/v1/market/data/bse-mapping', @@ -57,15 +57,8 @@ 'params': ('stock_code', 'year', 'report_type', 'page', 'page_size'), 'max_page_size': 500, }, - 'daec_ohlcs': { - 'path': 'api/v1/market/data/daec/history/ohlcs', - 'title': 'DAEC历史OHLC', - 'doc_file': 'DAEC历史OHLC.md', - 'original_api': 'daec_ohlcs', - 'params': ('symbol', 'since', 'until', 'interval', 'adjust', 'compat', 'span', 'limit', 'until_ts_ms'), - }, 'cashflow_stock_code': { - 'path': 'api/v1/market/data/finance/cashflow-stock-code', + 'path': 'api/v2/market/data/finance/cashflow-stock-code', 'title': '现金流支持股票代码', 'doc_file': '现金流支持股票代码.md', 'original_api': 'get_cashflow_stock_code', @@ -86,42 +79,27 @@ 'max_page_size': 500, }, 'eastmoney_board_constituents': { - 'path': 'api/v1/market/data/eastmoney-board-constituents', + 'path': 'api/v2/market/data/eastmoney-board-constituents', 'title': '东方财富板块成份股', 'doc_file': '东方财富板块成份股.md', 'original_api': 'eastmoney_board_constituents', 'params': ('board_code',), }, - 'eastmoney_all_board_daily_kline': { - 'path': 'api/v1/market/data/eastmoney-all-board-daily-ohlc', - 'title': '东方财富全板块日线OHLC', - 'doc_file': '东方财富全板块日线OHLC.md', - 'original_api': 'eastmoney_all_board_daily_kline', - 'params': ('start_date', 'end_date', 'page', 'page_size'), - 'max_page_size': 200, - }, 'eastmoney_board_daily_kline': { - 'path': 'api/v1/market/data/eastmoney-board-daily-ohlc', + 'path': 'api/v2/market/data/eastmoney-board-daily-ohlc', 'title': '东方财富板块日线OHLC', 'doc_file': '东方财富板块日线OHLC.md', 'original_api': 'eastmoney_board_daily_kline', 'params': ('board_code', 'start_date', 'end_date', 'page', 'page_size'), }, - 'eastmoney_board_latest_kline': { - 'path': 'api/v1/market/data/eastmoney-board-latest-ohlc', - 'title': '东方财富板块最新OHLC', - 'doc_file': '东方财富板块最新OHLC.md', - 'original_api': 'eastmoney_board_latest_kline', - 'params': ('board_code', 'page', 'page_size'), - }, 'eastmoney_concept_boards': { - 'path': 'api/v1/market/data/eastmoney-concept-boards', + 'path': 'api/v2/market/data/eastmoney-concept-boards', 'title': '东方财富概念板块', 'doc_file': '东方财富概念板块.md', 'original_api': 'eastmoney_concept_boards', }, 'eastmoney_dapan_flow': { - 'path': 'api/v1/market/data/eastmoney-dapan-flow', + 'path': 'api/v2/market/data/eastmoney-dapan-flow', 'title': '东方财富大盘资金流', 'doc_file': '东方财富大盘资金流.md', 'original_api': 'get_eastmoney_dapan_flow', @@ -135,14 +113,14 @@ 'params': ('market_code', 'trade_date', 'start_date', 'end_date', 'page', 'page_size'), }, 'eastmoney_rank': { - 'path': 'api/v1/market/data/eastmoney-rank', + 'path': 'api/v2/market/data/eastmoney-rank', 'title': '东方财富股票排名', 'doc_file': '东方财富股票排名.md', 'original_api': 'eastmoney_rank', 'params': ('rank_group', 'market', 'trade_date'), }, 'eastmoney_sector_flow': { - 'path': 'api/v1/market/data/eastmoney-sector-flow', + 'path': 'api/v2/market/data/eastmoney-sector-flow', 'title': '东方财富板块资金流', 'doc_file': '东方财富板块资金流.md', 'original_api': 'get_eastmoney_sector_flow', @@ -196,18 +174,6 @@ 'original_api': 'goodwill_stock_impairment', 'params': ('date', 'page', 'page_size'), }, - 'hk_sh_stock_connect_members': { - 'path': 'api/v1/market/data/hk-sh-stock-connect-members', - 'title': '沪港通成份', - 'doc_file': '沪港通成份.md', - 'original_api': 'hk_sh_stock_connect_members', - }, - 'hk_sz_stock_connect_members': { - 'path': 'api/v1/market/data/hk-sz-stock-connect-members', - 'title': '深港通成份', - 'doc_file': '深港通成份.md', - 'original_api': 'hk_sz_stock_connect_members', - }, 'income': { 'path': 'api/v1/market/data/finance/income', 'title': 'A股利润表', @@ -216,39 +182,19 @@ 'params': ('stock_code', 'year', 'report_type', 'page', 'page_size'), 'max_page_size': 500, }, - 'limit_down_pool': { - 'path': 'api/v1/market/data/limit-down-pool', - 'title': '跌停池', - 'doc_file': '跌停池.md', - 'original_api': 'limit_down_pool', - 'params': ('trade_date',), - }, 'limit_event_timeline_3s': { - 'path': 'api/v1/market/data/limit-event-timeline-3s', + 'path': 'api/v2/market/data/limit-event-timeline-3s', 'title': '涨跌停事件时间线', 'doc_file': '涨跌停事件时间线.md', 'original_api': 'limit_event_timeline_3s', 'params': ('symbol', 'trade_date'), }, - 'limit_up_break_pool': { - 'path': 'api/v1/market/data/limit-up-break-pool', - 'title': '炸板池', - 'doc_file': '炸板池.md', - 'original_api': 'limit_up_break_pool', - 'params': ('trade_date',), - }, - 'limit_up_pool': { - 'path': 'api/v1/market/data/limit-up-pool', - 'title': '涨停池', - 'doc_file': '涨停池.md', - 'original_api': 'limit_up_pool', - 'params': ('trade_date',), - }, - 'limit_up_pool_yesterday': { - 'path': 'api/v1/market/data/limit-up-pool-yesterday', - 'title': '昨日涨停池', - 'doc_file': '昨日涨停池.md', - 'original_api': 'limit_up_pool_yesterday', + 'limit_up_briefs': { + 'path': 'api/v3/market/data/limit-up-reports/briefs', + 'title': '涨停简报', + 'doc_file': '涨停简报.md', + 'original_api': 'limit_up_briefs', + 'params': ('date',), }, 'margin_trading_details': { 'path': 'api/v1/market/data/margin-trading-details', @@ -257,13 +203,6 @@ 'original_api': 'margin_trading_details', 'params': ('date', 'page', 'page_size'), }, - 'margin_trading_details_paginated': { - 'path': 'api/v1/market/data/margin-trading-details', - 'title': '融资融券明细分页', - 'doc_file': '融资融券明细分页.md', - 'original_api': 'margin_trading_details_paginated', - 'params': ('date', 'page', 'page_size'), - }, 'northbound': { 'path': 'api/v1/market/data/northbound', 'title': '北向资金交易', @@ -278,13 +217,6 @@ 'original_api': 'get_namechange', 'params': ('trade_code', 'start_date', 'end_date'), }, - 'nth_trade_date': { - 'path': 'api/v1/market/data/time/get-nth-trade-date', - 'title': '第N个交易日', - 'doc_file': '第N个交易日.md', - 'original_api': 'get_nth_trade_date', - 'params': ('n',), - }, 'trading_calendar': { 'path': 'api/v1/market/data/time/trading-calendar', 'title': '交易日历', @@ -301,14 +233,14 @@ 'max_page_size': 500, }, 'price_change': { - 'path': 'api/v1/market/data/price/get-price-change', + 'path': 'api/v2/market/data/price/get-price-change', 'title': '价格变动', 'doc_file': '价格变动.md', 'original_api': 'get_price_change', 'params': ('stock_code', 'base_date', 'n', 'direction'), }, 'risk_warning_stock_quotes': { - 'path': 'api/v1/market/data/risk-warning-stocks/quotes', + 'path': 'api/v2/market/data/risk-warning-stocks/quotes', 'title': '风险警示股行情', 'doc_file': '风险警示股行情.md', 'original_api': 'risk_warning_stock_quotes', @@ -319,36 +251,15 @@ 'title': '风险警示股', 'doc_file': '风险警示股.md', 'original_api': 'risk_warning_stocks', - 'params': ('date',), - }, - 'report_announcement_list': { - 'path': 'api/v1/market/data/report-announcements/list', - 'title': '报告公告列表', - 'doc_file': '报告公告列表.md', - 'original_api': 'report_announcement_list', - 'params': ('date', 'sec_code', 'page', 'page_size'), - 'max_page_size': 200, - }, - 'report_announcement_summary': { - 'path': 'api/v1/market/data/report-announcements/summary', - 'title': '报告公告摘要', - 'doc_file': '报告公告摘要.md', - 'original_api': 'report_announcement_summary', - 'params': ('announcement_id',), + 'params': ('date', 'page', 'page_size'), }, 'search': { - 'path': 'api/v1/market/security/search', + 'path': 'api/v2/market/security/search/', 'title': '标的搜索', 'doc_file': '标的搜索.md', 'original_api': 'search', 'params': ('query', 'limit'), }, - 'sh_hk_stock_connect_members': { - 'path': 'api/v1/market/data/sh-hk-stock-connect-members', - 'title': '沪股通成份', - 'doc_file': '沪股通成份.md', - 'original_api': 'sh_hk_stock_connect_members', - }, 'southbound': { 'path': 'api/v1/market/data/southbound', 'title': '南向资金交易', @@ -356,21 +267,6 @@ 'original_api': 'southbound', 'params': ('date',), }, - 'stk_ah_comparison': { - 'path': 'api/v1/market/data/hk/stk-ah-comparison', - 'title': 'AH股对比', - 'doc_file': 'AH股对比.md', - 'original_api': 'get_stk_ah_comparison', - 'params': ('hk_code', 'ts_code', 'trade_date', 'start_date', 'end_date', 'page', 'page_size'), - 'max_page_size': 1000, - }, - 'stk_code_change': { - 'path': 'api/v1/market/data/stk-code-change', - 'title': 'A股代码变更', - 'doc_file': 'A股代码变更.md', - 'original_api': 'get_stk_code_change', - 'params': ('trade_code', 'start_date', 'end_date'), - }, 'stk_limit': { 'path': 'api/v1/market/data/stk-limit', 'title': '涨跌停价', @@ -401,49 +297,34 @@ 'params': ('trade_code', 'candi_date', 'begin_date', 'end_date'), }, 'stk_premarket': { - 'path': 'api/v1/market/data/stk-premarket', + 'path': 'api/v2/market/data/stk-premarket', 'title': '盘前数据', 'doc_file': '盘前数据.md', 'original_api': 'stk_premarket', 'params': ('ts_code', 'trade_date', 'start_date', 'end_date', 'page', 'page_size'), 'max_page_size': 500, }, - 'stk_status_change': { - 'path': 'api/v1/market/data/stk-status-change', - 'title': 'A股状态变更', - 'doc_file': 'A股状态变更.md', - 'original_api': 'get_stk_status_change', - 'params': ('trade_code', 'change_date', 'change_type'), - }, 'stock_adjust_factor': { 'path': 'api/v1/market/data/stock-adjust-factor', 'title': '股票复权因子', 'doc_file': '股票复权因子.md', 'original_api': 'stock_adjust_factor', - 'params': ('symbol', 'trade_date', 'start_date', 'end_date', 'offset', 'limit'), + 'params': ('symbol', 'trade_date', 'start_date', 'end_date', 'page', 'page_size'), }, 'stock_candlesticks': { 'path': 'api/v1/market/data/stock-candlesticks', 'title': '股票K线', 'doc_file': '股票K线.md', 'original_api': 'stock_candlesticks', - 'method': 'POST', + 'method': 'GET', 'params': ('symbol', 'interval_unit', 'interval_value', 'adjust_kind', 'since_ts_millis', 'until_ts_millis', 'limit'), }, - 'stock_candlesticks_batch': { - 'path': 'api/v1/market/data/stock-candlesticks/batch', - 'title': '批量股票K线', - 'doc_file': '批量股票K线.md', - 'original_api': 'stock_candlesticks_batch', - 'method': 'POST', - 'params': ('symbols', 'interval_unit', 'interval_value', 'adjust_kind', 'since_ts_millis', 'until_ts_millis', 'limit'), - }, - 'stock_capital_flows_paginated': { + 'stock_capital_flows': { 'path': 'api/v1/market/data/stock-capital-flows', 'title': '股票资金流向', 'doc_file': '股票资金流向.md', 'original_api': 'stock_capital_flows_paginated', - 'params': ('date', 'page', 'page_size'), + 'params': ('date', 'time', 'symbol', 'page', 'page_size'), }, 'stock_comment_desire_em': { 'path': 'api/v1/market/data/stock-comment/desire', @@ -481,7 +362,7 @@ 'params': ('symbol',), }, 'stock_filter': { - 'path': 'api/v1/market/data/stock-list/filter', + 'path': 'api/v2/market/data/stock-list/filter', 'title': '股票筛选', 'doc_file': '股票筛选.md', 'original_api': 'get_stock_filter', @@ -494,29 +375,15 @@ 'original_api': 'get_stock_holder_float_top10', 'params': ('stock_code', 'is_last', 'page', 'page_size'), }, - 'stock_ggcg_em': { - 'path': 'api/v1/market/data/holder/stock-ggcg-em', - 'title': '东方财富股东增减持', - 'doc_file': '东方财富股东增减持.md', - 'original_api': 'stock_ggcg_em_handler', - 'params': ('symbol', 'page', 'page_size'), - }, - 'stock_ggmx': { - 'path': 'api/v1/market/data/holder/stock-ggmx', - 'title': '董监高持股变动', - 'doc_file': '董监高持股变动.md', - 'original_api': 'stock_ggmx_handler', - 'params': ('stock_code', 'change_direction', 'start_date', 'end_date', 'page', 'page_size'), - }, 'stock_ggmx_buy_ranking': { - 'path': 'api/v1/market/data/holder/stock-ggmx-buy-ranking', + 'path': 'api/v3/market/data/holder/stock-ggmx-buy-ranking', 'title': '董监高增持排名', 'doc_file': '董监高增持排名.md', 'original_api': 'stock_ggmx_buy_ranking_handler', 'params': ('time_range', 'page', 'page_size'), }, 'stock_ggmx_sell_ranking': { - 'path': 'api/v1/market/data/holder/stock-ggmx-sell-ranking', + 'path': 'api/v3/market/data/holder/stock-ggmx-sell-ranking', 'title': '董监高减持排名', 'doc_file': '董监高减持排名.md', 'original_api': 'stock_ggmx_sell_ranking_handler', @@ -537,40 +404,33 @@ 'params': ('stock_code', 'is_last', 'page', 'page_size'), }, 'stock_institution_holdings': { - 'path': 'api/v1/market/data/share/stock-institution-holdings', + 'path': 'api/v3/market/data/share/stock-institution-holdings', 'title': '机构持股', 'doc_file': '机构持股.md', 'original_api': 'get_stock_institution_holdings', - 'params': ('year', 'report_type', 'inst_type', 'page', 'page_size'), + 'params': ('year', 'report_type', 'institution_type', 'page', 'page_size'), }, 'stock_institution_holdings_detail': { - 'path': 'api/v1/market/data/share/stock-institution-holdings-detail', + 'path': 'api/v3/market/data/share/stock-institution-holdings-detail', 'title': '机构持股明细', 'doc_file': '机构持股明细.md', 'original_api': 'get_stock_institution_holdings_detail', - 'params': ('stock_code', 'year', 'report_type', 'inst_type', 'page', 'page_size'), + 'params': ('stock_code', 'year', 'report_type', 'institution_type', 'page', 'page_size'), }, 'stock_institution_share_holdings': { - 'path': 'api/v1/market/data/institution/institution-share-holdings', + 'path': 'api/v3/market/data/institution/institution-share-holdings', 'title': '机构股本持股', 'doc_file': '机构股本持股.md', 'original_api': 'get_stock_institution_share_holdings', 'params': ('institution_id', 'year', 'report_type', 'invest_type'), }, 'stock_intraday_auction_volume': { - 'path': 'api/v1/market/data/intraday-auction-volume', - 'title': '集合竞价成交量', - 'doc_file': '集合竞价成交量.md', + 'path': 'api/v2/market/data/intraday-auction-volume', + 'title': '连续竞价成交量', + 'doc_file': '连续竞价成交量.md', 'original_api': 'stock_intraday_auction_volume', 'params': ('trade_date', 'page', 'page_size'), }, - 'stock_intraday_auction_volume_symbol': { - 'path': 'api/v1/market/data/intraday-auction-volume/symbol', - 'title': '单标的集合竞价成交量', - 'doc_file': '单标的集合竞价成交量.md', - 'original_api': 'stock_intraday_auction_volume_symbol', - 'params': ('symbol', 'trade_date', 'page', 'page_size'), - }, 'stock_ipos': { 'path': 'api/v1/market/data/stock-ipos', 'title': '股票IPO', @@ -583,6 +443,7 @@ 'title': '股票列表', 'doc_file': '股票列表.md', 'original_api': 'get_stock_list', + 'params': ('page', 'page_size'), }, 'stock_market': { 'path': 'api/v1/market/data/daec/market/snapshot', @@ -592,11 +453,11 @@ 'params': ('scope',), }, 'stock_market_distribution_intraday': { - 'path': 'api/v1/market/data/daec/market/distribution-history', - 'title': '日内涨跌停分布历史', - 'doc_file': '日内涨跌停分布历史.md', + 'path': 'api/v2/market/data/market-distribution-intraday', + 'title': '市场涨跌分布分时', + 'doc_file': '市场涨跌分布分时.md', 'original_api': 'stock_market_distribution_intraday', - 'params': ('scope',), + 'params': (), }, 'stock_daec_stocks': { 'path': 'api/v1/market/data/daec/stocks/{board}', @@ -621,7 +482,7 @@ 'original_api': 'stock_pledge_detail', 'params': ('stock_code', 'is_last', 'page', 'page_size'), }, - 'stock_pledge_summary': { + 'pledge_summary': { 'path': 'api/v1/market/data/pledge/pledge-summary', 'title': '股权质押汇总', 'doc_file': '股权质押汇总.md', @@ -636,28 +497,14 @@ 'params': ('symbol', 'since', 'until'), }, 'stock_intraday_prices': { - 'path': 'api/v1/market/data/daec/history/prices', + 'path': 'api/v4/market/data/daec/history/prices', 'title': '标的分时数据', - 'doc_file': '标得分时数据.md', - 'original_api': 'stock_intraday_prices', - 'params': ('symbol', 'range', 'days', 'ts_ms', 'compat', 'since', 'since_ts_ms'), - }, - 'stock_ohlcs': { - 'path': 'api/v1/market/data/daec/history/ohlcs', - 'title': '标的K线数据', - 'doc_file': '标的K线数据.md', - 'original_api': 'stock_ohlcs', - 'params': ('symbol', 'since', 'until', 'interval', 'adjust', 'compat', 'span', 'limit', 'until_ts_ms'), - }, - 'stock_rating_top5': { - 'path': 'api/v1/market/data/feitu/stock-rating-top5', - 'title': '飞兔股票评级Top5', - 'doc_file': '飞兔股票评级Top5.md', - 'original_api': 'stock_rating_top5', - 'params': ('date', 'variant', 'type'), + 'doc_file': '标的分时数据.md', + 'original_api': 'daec_history_prices', + 'params': ('symbol', 'range', 'days', 'ts_ms'), }, 'stock_share': { - 'path': 'api/v1/market/data/share/get-stock-share', + 'path': 'api/v2/market/data/share/get-stock-share', 'title': '股本', 'doc_file': '股本.md', 'original_api': 'get_stock_share', @@ -670,26 +517,12 @@ 'original_api': 'get_stock_share_chg', 'params': ('stock_code', 'is_last', 'page', 'page_size'), }, - 'stock_signal_latest_snapshot': { - 'path': 'api/v1/market/data/stock-signal-latest-snapshot', - 'title': '信号最新快照', - 'doc_file': '信号最新快照.md', - 'original_api': 'stock_signal_latest_snapshot', - 'params': ('signal_type', 'page', 'page_size'), - }, 'stock_unlock': { - 'path': 'api/v1/market/data/unlock/stock-unlock', + 'path': 'api/v1/market/data/unlock/stock_unlock', 'title': '限售解禁', 'doc_file': '限售解禁.md', 'original_api': 'stock_unlock_handler', - 'params': ('stock_code', 'page', 'page_size'), - }, - 'stock_unlock_by_date': { - 'path': 'api/v1/market/data/unlock/stock-unlock-by-date', - 'title': '限售解禁按日期', - 'doc_file': '限售解禁按日期.md', - 'original_api': 'stock_unlock_by_date_handler', - 'params': ('start_date', 'end_date', 'page', 'page_size'), + 'params': ('stock_code', 'start_date', 'end_date', 'page', 'page_size'), }, 'suspension_list': { 'path': 'api/v1/market/data/suspension-list', @@ -698,34 +531,15 @@ 'original_api': 'suspension_list', 'params': ('trade_date', 'page', 'page_size'), }, - 'sz_hk_stock_connect_members': { - 'path': 'api/v1/market/data/sz-hk-stock-connect-members', - 'title': '深股通成份', - 'doc_file': '深股通成份.md', - 'original_api': 'sz_hk_stock_connect_members', - }, - 'ths_all_board_kline': { - 'path': 'api/v1/market/data/ths-all-board-kline', - 'title': '同花顺全板块K线', - 'doc_file': '同花顺全板块K线.md', - 'original_api': 'ths_all_board_kline', - 'params': ('start_date', 'end_date', 'page', 'page_size'), - }, 'ths_board_kline': { - 'path': 'api/v1/market/data/ths-board-kline', + 'path': 'api/v2/market/data/ths-board-kline', 'title': '同花顺板块K线', 'doc_file': '同花顺板块K线.md', 'original_api': 'ths_board_kline', 'params': ('board_code', 'page', 'page_size'), }, - 'ths_board_list': { - 'path': 'api/v1/market/data/ths-board-list', - 'title': '同花顺板块列表', - 'doc_file': '同花顺板块列表.md', - 'original_api': 'ths_board_list', - }, 'xueqiu_rank': { - 'path': 'api/v1/market/data/xueqiu-rank', + 'path': 'api/v2/market/data/xueqiu-rank', 'title': '雪球股票排名', 'doc_file': '雪球股票排名.md', 'original_api': 'xueqiu_rank', @@ -734,23 +548,225 @@ }, 'yzxdr_detail': { 'path': 'api/v1/market/data/yzxdr-detail', - 'title': '除权除息明细', - 'doc_file': '除权除息明细.md', + 'title': '一致行动人明细', + 'doc_file': '一致行动人明细.md', 'original_api': 'get_yzxdr_detail', 'params': ('year', 'quarter', 'stock_code', 'page', 'page_size'), }, - 'pledge_summary': { - 'path': 'api/v1/market/data/pledge/pledge-summary', - 'title': '股权质押汇总', - 'doc_file': '股权质押汇总.md', - 'original_api': 'stock_pledge_summary', - 'params': ('page', 'page_size'), + 'stock_description_all': { + 'path': 'api/v1/market/data/stock-description-all', + 'title': '股票基础信息', + 'doc_file': '股票基础信息.md', + 'original_api': 'stock_description_all', }, - 'stock_capital_flows': { - 'path': 'api/v1/market/data/stock-capital-flows', - 'title': '股票资金流向', - 'doc_file': '股票资金流向.md', - 'original_api': 'stock_capital_flows_paginated', - 'params': ('date', 'page', 'page_size'), + + 'tdx_board_index': { + 'path': 'api/v1/market/data/tdx-board-index', + 'title': '通达信板块指数最新快照', + 'doc_file': '通达信板块指数最新快照.md', + 'original_api': 'tdx_board_index', + 'params': ('ts_code', 'idx_name', 'idx_type', 'idx_type_code', 'market', 'page', 'page_size'), }, + + 'tdx_board_daily': { + 'path': 'api/v1/market/data/tdx-board-daily', + 'title': '通达信板块日线', + 'doc_file': '通达信板块日线.md', + 'original_api': 'tdx_board_daily', + 'params': ('start_date', 'end_date', 'ts_code', 'idx_name', 'idx_type', 'idx_type_code', 'market', 'page', 'page_size'), + }, + + 'tdx_board_members': { + 'path': 'api/v2/market/data/tdx-board-members', + 'title': '通达信板块成分股最新快照', + 'doc_file': '通达信板块成分股最新快照.md', + 'original_api': 'tdx_board_members', + 'params': ('ts_code', 'idx_name', 'idx_type', 'idx_type_code', 'market', 'con_code', 'con_name', 'page', 'page_size'), + }, + + 'stock_dividends': { + 'path': 'api/v1/market/data/stock-dividends', + 'title': '股票分红记录', + 'doc_file': '股票分红记录.md', + 'original_api': 'stock_dividends', + 'params': ('symbol', 'since_date', 'until_date', 'page', 'page_size'), + }, + + 'stock_history_list': { + 'path': 'api/v1/market/data/stock-history-list', + 'title': '股票历史列表', + 'doc_file': '股票历史列表.md', + 'original_api': 'stock_history_list', + 'params': ('trade_date', 'code', 'page', 'page_size'), + }, + + 'stock_connect_members': { + 'path': 'api/v1/market/data/stock-connect-members', + 'title': '互联互通成份', + 'doc_file': '互联互通成份.md', + 'original_api': 'stock_connect_members', + 'params': ('direction', 'channel', 'page', 'page_size'), + }, + + 'limit_list': { + 'path': 'api/v1/market/data/limit-list', + 'title': '涨跌停池', + 'doc_file': '涨跌停池.md', + 'original_api': 'limit_list', + 'params': ('limit_type', 'trade_date'), + }, + + 'stk_surv': { + 'path': 'api/v2/market/data/stk-surv', + 'title': '个股严重异常波动', + 'doc_file': '个股严重异常波动.md', + 'original_api': 'stk_surv', + 'params': ('ts_code', 'trade_date', 'start_date', 'end_date', 'page', 'page_size'), + }, + + 'stk_shock': { + 'path': 'api/v2/market/data/stk-shock', + 'title': '个股异常波动', + 'doc_file': '个股异常波动.md', + 'original_api': 'stk_shock', + 'params': ('ts_code', 'trade_date', 'start_date', 'end_date', 'page', 'page_size'), + }, + + 'stk_alert_broker': { + 'path': 'api/v2/market/data/stk-alert-broker', + 'title': '交易所重点提示证券', + 'doc_file': '交易所重点提示证券.md', + 'original_api': 'stk_alert_broker', + 'params': ('ts_code', 'start_date', 'end_date', 'page', 'page_size'), + }, + + 'limit_up_public_report': { + 'path': 'api/v3/market/data/limit-up-reports/public-report', + 'title': '涨停对外归因报告', + 'doc_file': '涨停对外归因报告.md', + 'original_api': 'limit_up_public_report', + 'params': ('date', 'security_code'), + }, + + 'limit_up_briefs': { + 'path': 'api/v3/market/data/limit-up-reports/briefs', + 'title': '涨停简报', + 'doc_file': '涨停简报.md', + 'original_api': 'limit_up_briefs', + 'params': ('date',), + }, + + 'ths_hot_list': { + 'path': 'api/v2/market/data/ths-hot-list', + 'title': '同花顺热榜', + 'doc_file': '同花顺热榜.md', + 'original_api': 'ths_hot_list', + 'params': ('list_type', 'trade_date', 'page', 'page_size'), + }, + + 'ashare_news_sentiment_factors': { + 'path': 'api/v3/market/data/ashare-news-sentiment-factors', + 'title': 'A股新闻情绪因子', + 'doc_file': 'A股新闻情绪因子.md', + 'original_api': 'ashare_news_sentiment_factors', + 'params': ('trade_code', 'start_date', 'end_date', 'page', 'page_size'), + }, + + 'kline_pattern_annotations': { + 'path': 'api/v3/market/data/kline-pattern-annotations', + 'title': 'K线形态标注', + 'doc_file': 'K线形态标注.md', + 'original_api': 'kline_pattern_annotations', + 'params': ('date', 'symbol', 'pattern', 'page', 'page_size'), + }, + + 'ashare_interactions': { + 'path': 'api/v3/market/data/ashare-interactions', + 'title': 'e互动', + 'doc_file': 'e互动.md', + 'original_api': 'ashare_interactions', + 'params': ('start_date', 'end_date', 'trade_code', 'company_name', 'industry_code', 'industry_name', 'data_source', 'page', 'page_size'), + }, + + 'supply_chain_subindustry_supply_chain': { + 'path': 'api/v3/market/data/supply-chain/subindustry-supply-chain', + 'title': '供应链一跳关系', + 'doc_file': '供应链一跳关系.md', + 'original_api': 'supply_chain_subindustry_supply_chain', + 'params': ('industry_name', 'direction'), + }, + + 'supply_chain_company_supply_chain_companies': { + 'path': 'api/v3/market/data/supply-chain/company-supply-chain-companies', + 'title': '供应链公司候选', + 'doc_file': '供应链公司候选.md', + 'original_api': 'supply_chain_company_supply_chain_companies', + 'params': ('trade_code', 'direction', 'page', 'page_size'), + }, + + 'supply_chain_subsubindustry_companies': { + 'path': 'api/v3/market/data/supply-chain/subsubindustry-companies', + 'title': '供应链子子行业公司映射', + 'doc_file': '供应链子子行业公司映射.md', + 'original_api': 'supply_chain_subsubindustry_companies', + 'params': ('subindustry_name',), + }, + + 'supply_chain_subsubindustry_parent_subindustries': { + 'path': 'api/v3/market/data/supply-chain/subsubindustry-parent-subindustries', + 'title': '供应链子子行业父行业反查', + 'doc_file': '供应链子子行业父行业反查.md', + 'original_api': 'supply_chain_subsubindustry_parent_subindustries', + 'params': ('subindustry_name',), + }, + + 'supply_chain_subindustry_subsubindustries': { + 'path': 'api/v3/market/data/supply-chain/subindustry-subsubindustries', + 'title': '供应链子行业层级展开', + 'doc_file': '供应链子行业层级展开.md', + 'original_api': 'supply_chain_subindustry_subsubindustries', + 'params': ('industry_name',), + }, + + 'exchange_margin_summaries': { + 'path': 'api/v1/market/data/exchange-margin-summaries', + 'title': '交易所融资融券汇总日度', + 'doc_file': '交易所融资融券汇总日度.md', + 'original_api': 'exchange_margin_summaries', + 'params': ('start_date', 'end_date', 'exchange', 'page', 'page_size'), + 'max_page_size': 1000, + }, + + 'ashare_rating_factor_snapshot': { + 'path': 'api/v3/market/data/ashare-rating-factor-snapshot', + 'title': 'A股相关性 Top-K', + 'doc_file': 'A股相关性Top-K.md', + 'original_api': 'ashare_rating_factor_snapshot', + 'params': ('trade_code', 'date', 'top_k'), + }, + + 'stock_minutes': { + 'path': 'api/v3/market/data/stock_minutes', + 'title': '股票历史分钟行情', + 'doc_file': '股票历史分钟行情.md', + 'original_api': 'stock_minutes', + 'params': ('symbol', 'interval_value', 'adjust_kind', 'since_ts_millis', 'until_ts_millis', 'limit'), + }, + + 'stock_realtime_minute_kline': { + 'path': 'api/v4/market/data/stock-realtime-minute-kline', + 'title': '股票实时分钟K线', + 'doc_file': '股票实时分钟K线.md', + 'original_api': 'stock_realtime_minute_kline', + 'params': ('symbols',), + }, + + 'stock_realtime_day_kline': { + 'path': 'api/v4/market/data/stock-realtime-day-kline', + 'title': '股票实时日K线', + 'doc_file': '股票实时日K线.md', + 'original_api': 'stock_realtime_day_kline', + 'params': ('symbols',), + }, + }) diff --git a/src/ftshare/endpoints/unpublished.py b/src/ftshare/endpoints/unpublished.py deleted file mode 100644 index 4de727f..0000000 --- a/src/ftshare/endpoints/unpublished.py +++ /dev/null @@ -1,39 +0,0 @@ -"""Unpublished endpoints that still have SDK coverage.""" - -from __future__ import annotations - -from .types import Endpoint, build_endpoints - - -ENDPOINTS: dict[str, Endpoint] = build_endpoints({ - 'stock_dividends_paginated': { - 'path': 'api/v1/market/data/dividends', - 'title': '股票分红记录分页', - 'doc_file': '股票分红记录分页.md', - 'original_api': 'stock_dividends_paginated', - 'params': ('page', 'page_size'), - }, - 'stock_intraday': { - 'path': 'api/v1/market/security/{symbol}/intraday', - 'title': '股票日内分时', - 'doc_file': '股票日内分时.md', - 'original_api': 'stock_intraday', - 'params': ('symbol',), - 'path_params': ('symbol',), - }, - 'stock_ipos_paginated': { - 'path': 'api/v1/market/data/stock-ipos', - 'title': '股票IPO分页', - 'doc_file': '股票IPO分页.md', - 'original_api': 'stock_ipos_paginated', - 'params': ('page', 'page_size'), - }, - 'stock_related': { - 'path': 'api/v1/market/security/{symbol}/related', - 'title': '相关股票', - 'doc_file': '相关股票.md', - 'original_api': 'stock_related', - 'params': ('symbol', 'limit'), - 'path_params': ('symbol',), - }, -}) diff --git a/src/ftshare/endpoints/us.py b/src/ftshare/endpoints/us.py index d563ecb..53effcb 100644 --- a/src/ftshare/endpoints/us.py +++ b/src/ftshare/endpoints/us.py @@ -6,59 +6,6 @@ ENDPOINTS: dict[str, Endpoint] = build_endpoints({ - 'eastmoney_us_stock_daily_kline': { - 'path': 'api/v1/market/data/eastmoney-us-stock-daily-ohlc', - 'title': '东方财富美股日OHLC', - 'doc_file': '东方财富美股日OHLC.md', - 'original_api': 'eastmoney_us_stock_daily_kline', - 'params': ('stock_code', 'start_date', 'end_date', 'page', 'page_size'), - }, - 'eastmoney_us_stock_latest_kline': { - 'path': 'api/v1/market/data/eastmoney-us-stock-latest-ohlc', - 'title': '东方财富美股最新OHLC', - 'doc_file': '东方财富美股最新OHLC.md', - 'original_api': 'eastmoney_us_stock_latest_kline', - 'params': ('stock_code', 'page', 'page_size'), - }, - 'eastmoney_us_stock_list': { - 'path': 'api/v1/market/data/eastmoney-us-stock-list', - 'title': '东方财富美股列表', - 'doc_file': '东方财富美股列表.md', - 'original_api': 'eastmoney_us_stock_list', - 'params': ('refresh', 'page', 'page_size'), - }, - 'us_balance': { - 'path': 'api/v1/market/data/us/us-balance', - 'title': '美股资产负债表', - 'doc_file': '美股资产负债表.md', - 'original_api': 'us_balance', - 'params': ('stock_code', 'period', 'report_type', 'start_date', 'end_date', 'page', 'page_size'), - 'max_page_size': 500, - }, - 'us_basic': { - 'path': 'api/v1/market/data/us/us-basic', - 'title': '美股基础信息', - 'doc_file': '美股基础信息.md', - 'original_api': 'us_basic', - 'params': ('stock_code', 'page', 'page_size'), - 'max_page_size': 500, - }, - 'us_cashflow': { - 'path': 'api/v1/market/data/us/us-cashflow', - 'title': '美股现金流', - 'doc_file': '美股现金流.md', - 'original_api': 'us_cashflow', - 'params': ('stock_code', 'period', 'report_type', 'start_date', 'end_date', 'page', 'page_size'), - 'max_page_size': 500, - }, - 'us_income': { - 'path': 'api/v1/market/data/us/us-income', - 'title': '美股利润表', - 'doc_file': '美股利润表.md', - 'original_api': 'us_income', - 'params': ('stock_code', 'period', 'report_type', 'start_date', 'end_date', 'page', 'page_size'), - 'max_page_size': 500, - }, 'eastmoney_us_stock_daily_ohlc': { 'path': 'api/v1/market/data/eastmoney-us-stock-daily-ohlc', 'title': '东方财富美股日OHLC', @@ -66,11 +13,4 @@ 'original_api': 'eastmoney_us_stock_daily_kline', 'params': ('stock_code', 'start_date', 'end_date', 'page', 'page_size'), }, - 'eastmoney_us_stock_latest_ohlc': { - 'path': 'api/v1/market/data/eastmoney-us-stock-latest-ohlc', - 'title': '东方财富美股最新OHLC', - 'doc_file': '东方财富美股最新OHLC.md', - 'original_api': 'eastmoney_us_stock_latest_kline', - 'params': ('stock_code', 'page', 'page_size'), - }, }) diff --git a/tests/endpoint_cases.py b/tests/endpoint_cases.py index a2d51f6..bc8d798 100644 --- a/tests/endpoint_cases.py +++ b/tests/endpoint_cases.py @@ -5,30 +5,41 @@ SAMPLE_VALUES: dict[str, Any] = { "adjust": "Forward", - "adjust_kind": "Forward", + "adjust_kind": "forward", "announcement_id": "announcement-1", - "base_date": "2026-07-17", + "base_date": "20260717", + "bank": "Bank of China", "begin_date": "20260101", "board": "all", - "board_code": "BK001", + "board_code": "BK1024", "cal-type": "1Y", "candi_date": "20260101", - "category": "经济", + "category": "economic", + "channel": "沪股通", "change_date": "20260101", "change_direction": "increase", "change_type": "上市", "charge_type": "日常申购费", "classify_std": "证监会行业分类", "client_type": "一般", + "code": "000001.SZ", "compat": "v2", + "con_code": "000001", + "con_name": "平安银行", + "cont": "1", + "company_name": "平安银行", "contract": "A2609.DCE", "contract_code": "A2609.DCE", "contract_multiplier": 10, + "currency": "USD", + "curve_name": "中债国债收益率曲线", + "data_source": "上市公司互动易", "date": "20260717", "days": 5, - "direction": "northbound", + "direction": "forward", "end": "20260717", "end_date": "20260717", + "end_week": "202630", "end_time": "15:00:00", "exchange": "DCE", "filter": "close > 10", @@ -38,28 +49,35 @@ "fund_type": "股票型", "history": True, "hk_code": "00700.HK", + "idx_name": "煤炭开采", + "idx_type": "HY", + "idx_type_code": 0, "index_code": "000300", "index_slug": "HSI", "industry_code": "801010", - "inst_type": "基金", + "inst_type": "all_inst", "institution_code": "000001", "institution_id": "1001", + "industry_name": "银行", "instrument_id": "A2609", "instrument_type": "stock", "interval": "Day", - "interval_unit": "Day", + "interval_unit": "day", "interval_value": 1, - "invest_type": "机构", + "invest_type": "all", "is_inoffice": "1", "is_last": True, "level": "1", + "list_type": "热股", "limit": 5, + "limit_type": "up", "listing_date_since": "20260101", - "market": "CN", + "market": "cn", "market_code": "000300", - "market_id": "XSHG", + "market_id": 1, "member_name": "永安期货", "member_name_abbr": "永安期货", + "name": "平安银行", "n": 5, "n_code": "000001.SZ", "nav_date": 20260717, @@ -68,7 +86,10 @@ "order_by": "change_rate desc", "page": 1, "page_size": 5, - "period": "7d", + "pattern": "双重顶", + "period": "2024", + "prd": "螺纹钢", + "prediction_date": "20260717", "publish_date": "20260717", "quarter": 2, "query": "人工智能", @@ -81,8 +102,10 @@ "request_id": "request-1", "scope": "ChinaStock", "sec_code": "000001", + "security_code": "113000.SZ", + "sector_name": "人工智能", "secid": "1.600000", - "sector_code": "BK001", + "sector_code": "BK1024", "sector_type": "concept", "signal_type": "new-high", "since": "20260701", @@ -92,61 +115,111 @@ "span": "DAY1", "start": "20260701", "start_date": "20260701", + "start_week": "202628", "start_time": "09:30:00", "stat_date": "20260717", "stati_perd": "日", "stock_code": "000001.SZ", "stock_name": "平安银行", - "symbol": "600000.XSHG", + "subindustry_name": "动力电池", + "symbol": "600000.SH", "symbol_code": "110070.SH", "symbol_id": "600000", - "symbols": ["600000.XSHG", "000001.XSHE"], - "time_range": "1Y", - "trade_code": "00700.HK", + "symbols": '["600519.SH"]', + "tenor": "3M", + "time": "1530", + "time_range": "1y", + "top_k": 5, + "trade_code": "000001", "trade_date": "20260717", "ts_code": "000001.SZ", "ts_ms": 1784048400000, "type": "ism-manufacturing", "until": "20260717", "until_date": "20260717", - "until_ts_millis": 1784307600000, + "until_ts_millis": 1784050200000, "until_ts_ms": 1784307600000, "variant": "300001", "variety": "A", "variety_code": "A", + "week": "202629", + "week_end": "202630", + "week_start": "202628", "year": 2024, } SPECIAL_CALLS: dict[str, dict[str, Any]] = { "search": {"query": "人工智能", "limit": 5}, - "stock_daec_stocks": { - "board": "all", - "page": 1, - "page_size": 5, - "filter": "close > 10", - "order_by": "change_rate desc", - }, + "stock_list": {"page": 1, "page_size": 5}, + "stock_daec_stocks": {"board": "all", "page": 1, "page_size": 5, "filter": "close > 10", "order_by": "change_rate desc"}, "stock_realtime_list": {"board": "chi-next", "page": 1, "page_size": 5}, - "stock_intraday_prices": { - "symbol": "600000.XSHG", - "range": "Today", - "days": None, - "ts_ms": None, - "compat": None, - "since": None, - "since_ts_ms": None, - }, - "stock_ohlcs": { - "symbol": "600000.XSHG", - "since": "20260701", - "until": "20260717", - "interval": "Day", - "adjust": "Forward", - "compat": None, - "span": None, - "limit": None, - "until_ts_ms": None, - }, + "stock_intraday_prices": {"symbol": "600000.SH", "range": None, "days": None, "ts_ms": 1784048400000}, + "ashare_news_sentiment_factors": {"trade_code": "000001.SZ", "start_date": "20260715", "end_date": "20260717", "page": 1, "page_size": 5}, + "ashare_rating_factor_snapshot": {"trade_code": "000001.SZ", "date": "20260717", "top_k": 5}, + "baidu_financial_calendar": {"category": "economic", "start_date": "20260715", "end_date": "20260717", "page": 1, "page_size": 5}, + "eastmoney_board_daily_kline": {"board_code": "BK1024", "start_date": "20260818", "end_date": "20260820", "page": 1, "page_size": 5}, + "eastmoney_us_stock_daily_ohlc": {"stock_code": "AAPL", "start_date": "20260818", "end_date": "20260820", "page": 1, "page_size": 10}, + "convertible_bond_candlesticks": {"symbol": "113027.SH", "interval_unit": "Day", "interval_value": 1, "adjust_kind": "forward", "since_ts_millis": 1716000000000, "until_ts_millis": 1718000000000, "limit": 5}, + "etf_candlesticks": {"symbol": "510300.SH", "interval_unit": "day", "interval_value": 1, "adjust_kind": "forward", "since_ts_millis": 1716000000000, "until_ts_millis": 1718000000000, "limit": 5}, + "etf_components_all": {"symbol": "510300.SH"}, + "etf_minutes": {"symbol": "510300.SH", "interval_value": 1, "adjust_kind": "none", "since_ts_millis": 1784048400000, "until_ts_millis": 1784050200000, "limit": 5}, + "etf_realtime_day_kline": {"symbols": '["510300.SH"]'}, + "etf_realtime_minute_kline": {"symbols": '["510300.SH"]'}, + "ft_limit": {"ts_code": "A2609.DCE", "trade_date": "20260717", "start_date": None, "end_date": None, "cont": "A", "exchange": "DCE", "page": 1, "page_size": 5}, + "fund_index_fund": {"index_code": "000300", "scope": "all"}, + "fund_asset_allocation": {"fund_code": "000001", "report_date": 20260331, "publish_date": None, "start_date": None, "end_date": None, "page": 1, "page_size": 5}, + "fund_holder_structure": {"fund_code": "000001", "report_type": "年度报告", "start_date": None, "end_date": None}, + "fund_manager": {"fund_code": "000001", "fund_manager": None, "is_inoffice": "1", "page": 1, "page_size": 5}, + "fund_net_value": {"fund_code": "000001", "nav_date": 20260717, "start_date": None, "end_date": None, "page": 1, "page_size": 5}, + "fund_net_value_performance": {"fund_code": "000001", "stat_date": "20260717", "start_date": None, "end_date": None, "page": 1, "page_size": 5}, + "fund_portfolio": {"fund_code": "000001", "report_date": 20260331, "publish_date": None, "start_date": None, "end_date": None, "page": 1, "page_size": 5}, + "fut_settle": {"ts_code": "A2609.DCE", "trade_date": "20260717", "start_date": None, "end_date": None, "exchange": "DCE", "page": 1, "page_size": 5}, + "fut_weekly_detail": {"week": "202629", "prd": "CU,AL", "start_week": None, "end_week": None, "exchange": "DCE", "page": 1, "page_size": 5}, + "fut_wsr": {"trade_date": "20260717", "start_date": None, "end_date": None, "symbol": "CU", "exchange": "DCE", "page": 1, "page_size": 5}, + "futures_contract_kline": {"symbol": "A2609.DCE", "interval": "daily", "start": 1784048400000, "end": 1784050200000, "limit": 5}, + "futures_minutes": {"symbol": "A2609.DCE", "interval": "1min", "start": 1784048400000, "end": 1784050200000, "limit": 5}, + "futures_minutes_realtime": {"symbols": "A2609.DCE"}, + "hk_candlesticks": {"trade_code": "00700.HK", "interval_unit": "day", "until_date": "20260717", "since_date": "20260715", "interval_value": 1, "limit": 5, "adjust_kind": "forward"}, + "index_candlesticks": {"symbol": "000300.SH", "interval_unit": "day", "interval_value": 1, "adjust_kind": "forward", "since_ts_millis": 1784048400000, "until_ts_millis": 1784050200000, "limit": 5}, + "index_minutes": {"symbol": "000300.SH", "interval_value": 1, "since_ts_millis": 1784048400000, "until_ts_millis": 1784050200000, "limit": 5}, + "index_realtime_day_kline": {"symbols": '["000300.SH"]'}, + "index_realtime_minute_kline": {"symbols": '["000300.SH"]'}, + "kline_pattern_annotations": {"date": "20260817", "symbol": "000001", "pattern": "双重顶", "page": 1, "page_size": 5}, + "limit_list": {"limit_type": "up", "trade_date": "20260717"}, + "limit_up_public_report": {"date": "20260717", "security_code": "000001.SZ"}, + "major_contract": {"start_date": "20260715", "end_date": "20260717"}, + "price_change": {"stock_code": "000001.SZ", "base_date": "20260717", "n": 5, "direction": "forward"}, + "semantic_search_news": {"query": "人工智能", "limit": 3, "year": 2026, "start_time": None, "end_time": None}, + "stk_limit": {"instrument_type": "stock", "symbol": "600000.SH", "symbol_id": "600000", "market_id": 1, "trade_date": "20260717", "start_date": None, "end_date": None, "page": 1, "page_size": 5}, + "stk_premarket": {"ts_code": "000001.SZ", "trade_date": "20260717", "start_date": None, "end_date": None, "page": 1, "page_size": 5}, + "stk_shock": {"ts_code": "000001.SZ", "trade_date": "20260717", "start_date": None, "end_date": None, "page": 1, "page_size": 5}, + "stk_surv": {"ts_code": "000001.SZ", "trade_date": "20260717", "start_date": None, "end_date": None, "page": 1, "page_size": 5}, + "stock_announcements": {"stock_code": "000001.SZ", "start_date": None, "end_date": None, "type": "stock", "page": 1, "page_size": 5}, + "stock_reports": {"stock_code": "000001.SZ", "start_date": None, "end_date": None, "type": "StockReport", "page": 1, "page_size": 5}, + "stock_candlesticks": {"symbol": "600519.SH", "interval_unit": "day", "interval_value": 1, "adjust_kind": "forward", "since_ts_millis": 1784048400000, "until_ts_millis": 1784050200000, "limit": 5}, + "stock_connect_members": {"direction": "north", "channel": "SH", "page": 1, "page_size": 5}, + "stock_dividends": {"symbol": "600519.SH", "since_date": "2026-07-01", "until_date": "2026-07-17", "page": 1, "page_size": 5}, + "stock_ggmx_buy_ranking": {"time_range": "1y", "page": 1, "page_size": 5}, + "stock_ggmx_sell_ranking": {"time_range": "1y", "page": 1, "page_size": 5}, + "stock_institution_holdings": {"year": 2024, "report_type": "annual", "institution_type": "all_inst", "page": 1, "page_size": 5}, + "stock_institution_holdings_detail": {"stock_code": "000001", "year": 2024, "report_type": "annual", "institution_type": "all_inst", "page": 1, "page_size": 5}, + "stock_institution_share_holdings": {"institution_id": "1001", "year": 2024, "report_type": "annual", "invest_type": "all"}, + "stock_minutes": {"symbol": "600519.SH", "interval_value": 1, "adjust_kind": "none", "since_ts_millis": 1784048400000, "until_ts_millis": 1784050200000, "limit": 5}, + "stock_realtime_day_kline": {"symbols": '["600519.SH"]'}, + "stock_realtime_minute_kline": {"symbols": '["600519.SH"]'}, + "stock_unlock": {"stock_code": None, "start_date": "20260701", "end_date": "20260717", "page": 1, "page_size": 5}, + "szse_convertible_bond_declaration_snapshots": {"security_code": "113000.SZ", "trade_date": "20260717", "start_date": None, "end_date": None, "page": 1, "page_size": 5}, + "szse_convertible_bond_directed_trades": {"security_code": "113000.SZ", "trade_date": "20260717", "start_date": None, "end_date": None, "page": 1, "page_size": 5}, + "szse_convertible_bond_matching_trades": {"security_code": "113000.SZ", "trade_date": "20260717", "start_date": None, "end_date": None, "page": 1, "page_size": 5}, + "szse_convertible_bond_negotiated_trades": {"security_code": "113000.SZ", "trade_date": "20260717", "start_date": None, "end_date": None, "page": 1, "page_size": 5}, + "supply_chain_company_supply_chain_companies": {"trade_code": "000001.SZ", "direction": "upstream", "page": 1, "page_size": 5}, + "supply_chain_subindustry_supply_chain": {"industry_name": "银行", "direction": "upstream"}, + "tdx_board_daily": {"start_date": "20260715", "end_date": "20260717", "ts_code": "881002", "idx_name": "煤炭开采", "idx_type": "HY", "idx_type_code": 0, "market": 1, "page": 1, "page_size": 5}, + "tdx_board_index": {"ts_code": "881002", "idx_name": "煤炭开采", "idx_type": "HY", "idx_type_code": 0, "market": 1, "page": 1, "page_size": 5}, + "tdx_board_members": {"ts_code": "881002", "idx_name": "煤炭开采", "idx_type": "HY", "idx_type_code": 0, "market": 1, "con_code": "000552", "con_name": "甘肃能化", "page": 1, "page_size": 5}, + "ths_board_kline": {"board_code": "886056", "page": 1, "page_size": 5}, + "ths_hot_list": {"list_type": "stock_day", "trade_date": "20260717", "page": 1, "page_size": 5}, + "wallstreetcn_financial_calendar": {"start_date": "20260715", "end_date": "20260717", "page": 1, "page_size": 5}, } WIRE_ALIASES: dict[str, dict[str, str]] = { diff --git a/tests/test_client.py b/tests/test_client.py index ba65803..f07f59f 100644 --- a/tests/test_client.py +++ b/tests/test_client.py @@ -64,13 +64,41 @@ def paginated_records(records, page=1, pages=1): } -def test_default_base_url_and_set_base_url(): - assert ft.BASE_URL == "https://market.ft.tech/gateway/" - assert ft.set_base_url("https://example.com/gateway") == "https://example.com/gateway/" - assert ft.BASE_URL == "https://example.com/gateway/" - client = ft.market_api() - assert client.base_url == "https://example.com/gateway/" - ft.set_base_url("https://market.ft.tech/gateway/") +def test_api_key_is_sent_as_header_and_not_query_param(monkeypatch): + monkeypatch.delenv("FTSHARE_API_KEY", raising=False) + session = FakeSession([FakeResponse(payload={})]) + client = FtshareClient( + session=session, + api_key="explicit-key", + headers={"User-Agent": "test"}, + ) + + client.get("api/v1/market/data/demo", symbol="000001.SZ") + + assert session.calls[0]["headers"] == { + "User-Agent": "test", + "FTSHARE_API_KEY": "explicit-key", + } + assert session.calls[0]["params"] == {"symbol": "000001.SZ"} + + +def test_api_key_falls_back_to_environment(monkeypatch): + monkeypatch.setenv("FTSHARE_API_KEY", "environment-key") + session = FakeSession([FakeResponse(payload={})]) + + FtshareClient(session=session).get("api/v1/market/data/demo") + + assert session.calls[0]["headers"] == {"FTSHARE_API_KEY": "environment-key"} + + +def test_explicit_api_key_overrides_header_value(monkeypatch): + monkeypatch.setenv("FTSHARE_API_KEY", "environment-key") + session = FakeSession([FakeResponse(payload={})]) + client = FtshareClient(session=session, api_key="explicit-key", headers={"FTSHARE_API_KEY": "old-key"}) + + client.get("api/v1/market/data/demo") + + assert session.calls[0]["headers"]["FTSHARE_API_KEY"] == "explicit-key" def test_package_base_url_assignment_is_used_by_market_api(): @@ -140,17 +168,10 @@ def test_get_raw_true_returns_full_payload(): @pytest.mark.parametrize( ("method_name", "kwargs"), [ - ("stock_unlock_by_date", {"start_date": "2025-06-01", "end_date": "2025-06-30"}), ("stock_unlock", {"stock_code": "000001"}), ("yzxdr_detail", {"year": 2026, "quarter": 2}), - ( - "eastmoney_futures_strange", - {"exchange": "gfex", "variety": "多晶硅", "contract": "ps2609", "trade_date": "20260612"}, - ), - ("eastmoney_us_stock_list", {}), - ("eastmoney_us_stock_daily_ohlc", {"stock_code": "ADV"}), - ("eastmoney_us_stock_latest_ohlc", {}), - ("futures_kline", {"symbol": "A2605.DCE"}), + ("futures_minutes", {"symbol": "A2605.DCE", "interval": "1min", "limit": 5}), + ("futures_contract_kline", {"symbol": "A2605.DCE", "interval": "daily", "limit": 5}), ("company_list", {}), ("wallstreetcn_financial_calendar", {"start_date": "2026-05-01", "end_date": "2026-05-07"}), ("stk_limit", {}), @@ -159,7 +180,6 @@ def test_get_raw_true_returns_full_payload(): ("stock_capital_flows", {}), ("stock_ggmx_sell_ranking", {}), ("stock_ggmx_buy_ranking", {}), - ("stock_ggmx", {}), ("pledge_summary", {}), ("index_weight_summary", {"index_code": "000300"}), ], @@ -175,7 +195,7 @@ def test_endpoint_methods_map_to_expected_paths(method_name, kwargs): def test_all_documented_endpoints_are_available_as_client_methods(): client = FtshareClient(session=FakeSession([])) - assert len(ENDPOINTS) >= 200 + assert len(ENDPOINTS) >= 190 missing = [ name @@ -224,16 +244,6 @@ def test_api_error(): client.stk_limit() -def test_http_like_code_200_is_treated_as_success(): - session = FakeSession([FakeResponse(payload={"code": 200, "msg": "OK", "data": {"items": [{"id": 1}]}})]) - client = FtshareClient(session=session) - - df = client.etf_fund_export(request_id="demo-1") - - assert isinstance(df, pd.DataFrame) - assert df.to_dict("records") == [{"id": 1}] - - def test_search_uses_public_path_without_trailing_slash_and_q_param(): session = FakeSession([FakeResponse(payload=[{"symbol": "600519.SH"}])]) client = FtshareClient(session=session) @@ -241,130 +251,10 @@ def test_search_uses_public_path_without_trailing_slash_and_q_param(): rows = client.search(query="maotai", limit=1, as_dataframe=False) assert rows == [{"symbol": "600519.SH"}] - assert session.calls[0]["url"] == "https://market.ft.tech/gateway/api/v1/market/security/search" + assert session.calls[0]["url"] == "https://market.ft.tech/gateway/api/v2/market/security/search/" assert session.calls[0]["params"] == {"q": "maotai", "limit": 1} -def test_path_parameter_is_substituted_into_endpoint_url(): - session = FakeSession([FakeResponse(payload=[])]) - client = FtshareClient(session=session) - - rows = client.stock_intraday(symbol="600000.XSHG", as_dataframe=False) - - assert rows == [] - assert session.calls[0]["url"] == "https://market.ft.tech/gateway/api/v1/market/security/600000.XSHG/intraday" - assert session.calls[0]["params"] == {} - - -def test_path_parameter_and_query_parameters_are_separated(): - session = FakeSession([FakeResponse(payload=[])]) - client = FtshareClient(session=session) - - client.stock_related(symbol="000300.XSHG", limit=3) - - assert session.calls[0]["url"] == "https://market.ft.tech/gateway/api/v1/market/security/000300.XSHG/related" - assert session.calls[0]["params"] == {"limit": 3} - - -def test_missing_path_parameter_raises_value_error(): - client = FtshareClient(session=FakeSession([])) - - with pytest.raises(ValueError, match="symbol is required in endpoint path"): - client.stock_intraday() - - -def test_confirmed_todo_endpoints_map_to_public_server_paths(): - cases = [ - ( - "stock_prev_close", - {"symbol": "600000.XSHG", "since": "20240501", "until": "20240531"}, - "api/v1/market/data/daec/history/prev-closes", - {"symbol": "600000.XSHG", "since": "20240501", "until": "20240531"}, - ), - ( - "stock_market", - {"scope": "ChinaStock"}, - "api/v1/market/data/daec/market/snapshot", - {"scope": "ChinaStock"}, - ), - ( - "stock_market_distribution_intraday", - {"scope": "ChinaStock"}, - "api/v1/market/data/daec/market/distribution-history", - {"scope": "ChinaStock"}, - ), - ( - "stock_intraday_prices", - {"symbol": "600000.XSHG", "compat": "v2", "since": "TODAY"}, - "api/v1/market/data/daec/history/prices", - {"symbol": "600000.XSHG", "compat": "v2", "since": "TODAY"}, - ), - ( - "stock_ohlcs", - {"symbol": "600000.XSHG", "compat": "v2", "span": "DAY1", "limit": 5}, - "api/v1/market/data/daec/history/ohlcs", - {"symbol": "600000.XSHG", "compat": "v2", "span": "DAY1", "limit": 5}, - ), - ] - - for method_name, kwargs, path, expected_params in cases: - session = FakeSession([FakeResponse(payload=[])]) - client = FtshareClient(session=session) - - getattr(client, method_name)(**kwargs) - - assert session.calls[0]["url"] == "https://market.ft.tech/gateway/" + path - assert session.calls[0]["params"] == expected_params - - -@pytest.mark.parametrize( - ("kwargs", "message"), - [ - ( - {"symbol": "600000.XSHG", "compat": "v2", "range": "Today", "since": "TODAY"}, - "cannot be combined with raw time parameters", - ), - ( - {"symbol": "600000.XSHG", "since": "TODAY"}, - "require compat='v2'", - ), - ( - {"symbol": "600000.XSHG", "range": "Today", "days": 5}, - "raw time parameters are mutually exclusive", - ), - ( - {"symbol": "600000.XSHG", "compat": "v2", "since": "TODAY", "since_ts_ms": 1782696600000}, - "v2 time parameters are mutually exclusive", - ), - ], -) -def test_stock_intraday_prices_rejects_mixed_daec_time_modes(kwargs, message): - client = FtshareClient(session=FakeSession([])) - - with pytest.raises(ValueError, match=message): - client.stock_intraday_prices(**kwargs) - - -@pytest.mark.parametrize( - ("kwargs", "message"), - [ - ( - {"symbol": "600000.XSHG", "span": "DAY1", "limit": 5}, - "require compat='v2'", - ), - ( - {"symbol": "600000.XSHG", "compat": "v2", "span": "DAY1", "interval": "Day"}, - "uses span instead of interval", - ), - ], -) -def test_stock_ohlcs_rejects_mixed_daec_modes(kwargs, message): - client = FtshareClient(session=FakeSession([])) - - with pytest.raises(ValueError, match=message): - client.stock_ohlcs(**kwargs) - - def test_stock_market_list_families_format_board_path_parameters(): cases = [ ( @@ -391,24 +281,6 @@ def test_stock_market_list_families_format_board_path_parameters(): assert session.calls[0]["params"] == expected_params -def test_paginated_aliases_resolved_from_server_routes(): - session = FakeSession( - [ - FakeResponse(payload={"items": [], "total_pages": 0, "total_items": 0}), - FakeResponse(payload={"items": [], "total_pages": 0, "total_items": 0}), - ] - ) - client = FtshareClient(session=session) - - client.stock_ipos_paginated(page=1, page_size=50) - client.stock_dividends_paginated(page=1, page_size=50) - - assert session.calls[0]["url"] == "https://market.ft.tech/gateway/api/v1/market/data/stock-ipos" - assert session.calls[0]["params"] == {"page": 1, "page_size": 50} - assert session.calls[1]["url"] == "https://market.ft.tech/gateway/api/v1/market/data/dividends" - assert session.calls[1]["params"] == {"page": 1, "page_size": 50} - - def test_endpoint_default_returns_dataframe_from_records(): session = FakeSession([FakeResponse(payload=paginated_records([{"ts_code": "000001.SZ"}]))]) client = FtshareClient(session=session) @@ -672,16 +544,7 @@ def test_get_query_booleans_are_lowercase_strings(): assert session.calls[0]["params"] == {"enabled": "true", "disabled": "false"} -def test_post_json_booleans_remain_booleans(): - session = FakeSession([FakeResponse(payload=[])]) - client = FtshareClient(session=session) - - client.post("api/v1/market/data/demo", enabled=True, disabled=False, as_dataframe=False) - - assert session.calls[0]["json"] == {"enabled": True, "disabled": False} - - -def test_etf_candlesticks_posts_json_body_to_candlesticks_path(): +def test_etf_candlesticks_uses_get_query_params(): session = FakeSession([FakeResponse(payload=[{"close": "4.5"}])]) client = FtshareClient(session=session) @@ -694,7 +557,7 @@ def test_etf_candlesticks_posts_json_body_to_candlesticks_path(): ) assert session.calls[0]["url"] == "https://market.ft.tech/gateway/api/v1/market/data/etf-candlesticks" - assert session.calls[0]["json"] == { + assert session.calls[0]["params"] == { "symbol": "510300.XSHG", "interval_unit": "Day", "until_ts_millis": 1756791000000, @@ -702,26 +565,7 @@ def test_etf_candlesticks_posts_json_body_to_candlesticks_path(): } -def test_etf_candlesticks_batch_posts_symbols_array(): - session = FakeSession([FakeResponse(payload=[["510300.XSHG", []]])]) - client = FtshareClient(session=session) - - client.etf_candlesticks_batch( - symbols=["510300.XSHG", "159915.XSHE"], - interval_unit="Day", - until_ts_millis=1756791000000, - as_dataframe=False, - ) - - assert session.calls[0]["url"] == "https://market.ft.tech/gateway/api/v1/market/data/etf-candlesticks/batch" - assert session.calls[0]["json"] == { - "symbols": ["510300.XSHG", "159915.XSHE"], - "interval_unit": "Day", - "until_ts_millis": 1756791000000, - } - - -def test_convertible_bond_candlesticks_posts_json_body(): +def test_convertible_bond_candlesticks_uses_get_query_params(): session = FakeSession([FakeResponse(payload=[{"close": "200"}])]) client = FtshareClient(session=session) @@ -733,25 +577,14 @@ def test_convertible_bond_candlesticks_posts_json_body(): ) assert session.calls[0]["url"] == "https://market.ft.tech/gateway/api/v1/market/data/convertible-bond-candlesticks" - assert session.calls[0]["json"]["symbol"] == "113027.XSHG" - - -def test_convertible_bond_candlesticks_batch_posts_json_body(): - session = FakeSession([FakeResponse(payload=[[]])]) - client = FtshareClient(session=session) - - client.convertible_bond_candlesticks_batch( - symbols=["113027.XSHG", "128048.XSHE"], - interval_unit="Day", - until_ts_millis=1756791000000, - as_dataframe=False, - ) - - assert session.calls[0]["url"] == "https://market.ft.tech/gateway/api/v1/market/data/convertible-bond-candlesticks/batch" - assert session.calls[0]["json"]["symbols"] == ["113027.XSHG", "128048.XSHE"] + assert session.calls[0]["params"] == { + "symbol": "113027.XSHG", + "interval_unit": "Day", + "until_ts_millis": 1756791000000, + } -def test_index_candlesticks_posts_json_body(): +def test_index_candlesticks_uses_get_query_params(): session = FakeSession([FakeResponse(payload=[{"close": "4500"}])]) client = FtshareClient(session=session) @@ -763,52 +596,11 @@ def test_index_candlesticks_posts_json_body(): ) assert session.calls[0]["url"] == "https://market.ft.tech/gateway/api/v1/market/data/index-candlesticks" - assert session.calls[0]["json"]["symbol"] == "000300.XSHG" - - -def test_index_candlesticks_batch_posts_json_body(): - session = FakeSession([FakeResponse(payload=[[]])]) - client = FtshareClient(session=session) - - client.index_candlesticks_batch( - symbols=["000300.XSHG", "399001.XSHE"], - interval_unit="Day", - until_ts_millis=1756791000000, - as_dataframe=False, - ) - - assert session.calls[0]["url"] == "https://market.ft.tech/gateway/api/v1/market/data/index-candlesticks/batch" - assert session.calls[0]["json"]["symbols"] == ["000300.XSHG", "399001.XSHE"] - - -def test_limit_up_pool_forwards_trade_date_query_parameter(): - session = FakeSession([FakeResponse(payload=[])]) - client = FtshareClient(session=session) - - client.limit_up_pool(trade_date="20260713", as_dataframe=False) - - assert session.calls[0]["url"] == "https://market.ft.tech/gateway/api/v1/market/data/limit-up-pool" - assert session.calls[0]["params"] == {"trade_date": "20260713"} - - -def test_limit_up_break_pool_forwards_trade_date_query_parameter(): - session = FakeSession([FakeResponse(payload=[])]) - client = FtshareClient(session=session) - - client.limit_up_break_pool(trade_date="20260713", as_dataframe=False) - - assert session.calls[0]["url"] == "https://market.ft.tech/gateway/api/v1/market/data/limit-up-break-pool" - assert session.calls[0]["params"] == {"trade_date": "20260713"} - - -def test_limit_down_pool_forwards_trade_date_query_parameter(): - session = FakeSession([FakeResponse(payload=[])]) - client = FtshareClient(session=session) - - client.limit_down_pool(trade_date="20260713", as_dataframe=False) - - assert session.calls[0]["url"] == "https://market.ft.tech/gateway/api/v1/market/data/limit-down-pool" - assert session.calls[0]["params"] == {"trade_date": "20260713"} + assert session.calls[0]["params"] == { + "symbol": "000300.XSHG", + "interval_unit": "Day", + "until_ts_millis": 1756791000000, + } def test_limit_event_timeline_3s_forwards_symbol_and_trade_date(): @@ -817,7 +609,7 @@ def test_limit_event_timeline_3s_forwards_symbol_and_trade_date(): client.limit_event_timeline_3s(symbol="000504.XSHE", trade_date="20260713", as_dataframe=False) - assert session.calls[0]["url"] == "https://market.ft.tech/gateway/api/v1/market/data/limit-event-timeline-3s" + assert session.calls[0]["url"] == "https://market.ft.tech/gateway/api/v2/market/data/limit-event-timeline-3s" assert session.calls[0]["params"] == {"symbol": "000504.XSHE", "trade_date": "20260713"} @@ -827,7 +619,7 @@ def test_stock_filter_forwards_symbol_param(): client.stock_filter(symbol="600519.SH", page=1, page_size=5, as_dataframe=False) - assert session.calls[0]["url"] == "https://market.ft.tech/gateway/api/v1/market/data/stock-list/filter" + assert session.calls[0]["url"] == "https://market.ft.tech/gateway/api/v2/market/data/stock-list/filter" assert session.calls[0]["params"]["symbol"] == "600519.SH" assert "board" not in session.calls[0]["params"] assert "listing_date_since" not in session.calls[0]["params"] @@ -964,16 +756,6 @@ def test_fund_manager_paginated(): assert session.calls[0]["params"]["is_inoffice"] == "1" -def test_fund_daily_paginated(): - session = FakeSession([FakeResponse(payload={"items": [], "total_pages": 0, "total_items": 0})]) - client = FtshareClient(session=session) - - client.fund_daily(fund_code="510300", trade_date="20260717", page=1, page_size=50, as_dataframe=False) - - assert session.calls[0]["url"] == "https://market.ft.tech/gateway/api/v1/market/data/fund/fund-daily" - assert session.calls[0]["params"]["trade_date"] == "20260717" - - def test_fund_fee_paginated_filter(): session = FakeSession([FakeResponse(payload={"items": [], "total_pages": 0, "total_items": 0})]) client = FtshareClient(session=session) @@ -1012,7 +794,7 @@ def test_fund_index_fund_array_response(): client.fund_index_fund(index_code="000300", scope="etf", as_dataframe=False) - assert session.calls[0]["url"] == "https://market.ft.tech/gateway/api/v1/market/data/fund/index-fund" + assert session.calls[0]["url"] == "https://market.ft.tech/gateway/api/v2/market/data/fund/index-fund" assert session.calls[0]["params"] == {"index_code": "000300", "scope": "etf"} @@ -1025,18 +807,6 @@ def test_fund_index_fund_array_response(): "api/v1/market/data/namechange", {"trade_code": "600848.SH", "start_date": "20200101", "end_date": "20241231"}, ), - ( - "stk_code_change", - {"trade_code": "001872.SZ,601360.SH", "start_date": "20180101"}, - "api/v1/market/data/stk-code-change", - {"trade_code": "001872.SZ,601360.SH", "start_date": "20180101"}, - ), - ( - "stk_status_change", - {"trade_code": "600848.SH", "change_type": "上市"}, - "api/v1/market/data/stk-status-change", - {"trade_code": "600848.SH", "change_type": "上市"}, - ), ( "stk_managers", {"trade_code": "600848.SH,000001.SZ", "begin_date": "20200101", "end_date": "20241231"}, @@ -1067,23 +837,3 @@ def test_a_share_reference_endpoints_map_to_expected_paths( assert session.calls[0]["url"] == "https://market.ft.tech/gateway/" + expected_path assert session.calls[0]["params"] == expected_params - - -def test_a_share_reference_endpoints_raw_returns_full_payload(): - payload = [ - {"trade_code": "001872.SZ", "code": "1872", "name": "招商港口", "start_date": "20181226", "end_date": None}, - ] - session = FakeSession([FakeResponse(payload=payload)]) - client = FtshareClient(session=session) - - assert client.stk_code_change(trade_code="001872.SZ", raw=True) == payload - - -def test_a_share_status_change_omits_none_params(): - session = FakeSession([FakeResponse(payload={"items": []})]) - client = FtshareClient(session=session) - - client.stk_status_change() - - assert session.calls[0]["url"] == "https://market.ft.tech/gateway/api/v1/market/data/stk-status-change" - assert session.calls[0]["params"] == {} diff --git a/tests/test_endpoint_contracts.py b/tests/test_endpoint_contracts.py index a7878c6..79db350 100644 --- a/tests/test_endpoint_contracts.py +++ b/tests/test_endpoint_contracts.py @@ -1,6 +1,7 @@ from __future__ import annotations import inspect +from pathlib import Path from typing import Any import pytest @@ -12,13 +13,7 @@ from endpoint_cases import SAMPLE_VALUES, SPECIAL_CALLS, WIRE_ALIASES -NON_PUBLISHED_ENDPOINTS = { - "stock_dividends_paginated", - "stock_intraday", - "stock_ohlcs", - "stock_related", -} -PUBLIC_CONTRACTS = set(ENDPOINTS) - NON_PUBLISHED_ENDPOINTS +PUBLIC_CONTRACTS = set(ENDPOINTS) CONTROL_PARAMS = {"page", "page_size"} @@ -52,9 +47,27 @@ def _response_payload(name: str) -> Any: def test_contract_cases_cover_all_public_sdk_methods(): - assert len(PUBLIC_CONTRACTS) == 213 - assert PUBLIC_CONTRACTS | NON_PUBLISHED_ENDPOINTS == set(ENDPOINTS) - assert not (PUBLIC_CONTRACTS & NON_PUBLISHED_ENDPOINTS) + assert len(PUBLIC_CONTRACTS) == len(ENDPOINTS) + assert PUBLIC_CONTRACTS == set(ENDPOINTS) + + +def test_unpublished_topic_is_not_public(): + assert "unpublished" not in ENDPOINTS + assert not any(base.__name__ == "UnpublishedApiMixin" for base in FtshareClient.__mro__) + + +def test_endpoint_documents_come_from_valid_topics(): + docs_root = Path(__file__).parents[2] / "ftshare-doc" / "api-doc" + excluded = {"未发布", "已下线", "设计文档", "系统接口"} + assert docs_root.is_dir() + + matches = {} + for path in docs_root.rglob("*.md"): + matches.setdefault(path.name, []).append(path) + + for endpoint in ENDPOINTS.values(): + assert endpoint.doc_file in matches + assert any(not excluded.intersection(path.relative_to(docs_root).parts) for path in matches[endpoint.doc_file]) @pytest.mark.parametrize("method_name", sorted(PUBLIC_CONTRACTS)) @@ -82,16 +95,13 @@ def test_endpoint_forwards_every_documented_parameter(method_name): assert call["method"] == endpoint.method expected_wire = _wire_params(method_name, kwargs) - if endpoint.method == "POST": - assert call["json"] == expected_wire - assert "params" not in call - else: - expected_query = { - key: str(value).lower() if isinstance(value, bool) else value - for key, value in expected_wire.items() - } - assert call["params"] == expected_query - assert "json" not in call + expected_query = { + key: str(value).lower() if isinstance(value, bool) else value + for key, value in expected_wire.items() + } + assert endpoint.method == "GET" + assert call["params"] == expected_query + assert "json" not in call @pytest.mark.parametrize("method_name", sorted(PUBLIC_CONTRACTS)) From 8af17e31842550a5ad17985c30f4578607fb9d19 Mon Sep 17 00:00:00 2001 From: zhuhao Date: Tue, 1 Sep 2026 22:24:35 +0800 Subject: [PATCH 2/2] =?UTF-8?q?fix=EF=BC=9A=E4=BF=AE=E6=94=B9pytest?= =?UTF-8?q?=E5=A4=B1=E8=B4=A5=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- tests/test_endpoint_contracts.py | 16 ++++++---------- 1 file changed, 6 insertions(+), 10 deletions(-) diff --git a/tests/test_endpoint_contracts.py b/tests/test_endpoint_contracts.py index 79db350..bfb080c 100644 --- a/tests/test_endpoint_contracts.py +++ b/tests/test_endpoint_contracts.py @@ -56,18 +56,14 @@ def test_unpublished_topic_is_not_public(): assert not any(base.__name__ == "UnpublishedApiMixin" for base in FtshareClient.__mro__) -def test_endpoint_documents_come_from_valid_topics(): - docs_root = Path(__file__).parents[2] / "ftshare-doc" / "api-doc" - excluded = {"未发布", "已下线", "设计文档", "系统接口"} - assert docs_root.is_dir() - - matches = {} - for path in docs_root.rglob("*.md"): - matches.setdefault(path.name, []).append(path) +def test_endpoint_documents_are_referenced_in_api_reference(): + api_reference = Path(__file__).parents[1] / "docs" / "API_REFERENCE.md" + assert api_reference.is_file() + reference = api_reference.read_text(encoding="utf-8") for endpoint in ENDPOINTS.values(): - assert endpoint.doc_file in matches - assert any(not excluded.intersection(path.relative_to(docs_root).parts) for path in matches[endpoint.doc_file]) + assert endpoint.doc_file + assert f"`{endpoint.doc_file}`" in reference @pytest.mark.parametrize("method_name", sorted(PUBLIC_CONTRACTS))