financial

package module
v0.0.3 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jul 17, 2026 License: MIT Imports: 7 Imported by: 0

README

同花顺金融数据 Go SDK

本项目是社区维护的 Go 客户端库,用于调用同花顺金融数据 API。它不是官方 SDK;接口能力、数据范围、访问权限和 API Key 均以官方服务文档为准。

客户端默认连接 https://fuyao.aicubes.cn,每次请求自动携带 X-api-key 请求头,并将服务端统一的 ApiResponse 响应转换为 Go 类型和错误。创建客户端时必须显式传入 API Key。

安装

go get github.com/HiT-Community/hi_think_financial-go

快速开始

package main

import (
	"context"
	"fmt"
	"log"
	"os"

	financial "github.com/HiT-Community/hi_think_financial-go"
)

func main() {
	client, err := financial.NewClient(os.Getenv("FUYAO_API_KEY"))
	if err != nil {
		log.Fatal(err)
	}

	result, err := client.TickerSearch(context.Background(), &financial.TickerSearchRequest{
		Q:     "600519",
		Limit: 10,
	})
	if err != nil {
		log.Fatal(err)
	}

	fmt.Printf("%+v\n", result)
}

提供的接口

  • 标的检索与代码表
  • A 股行情快照与历史 K 线
  • 全市场日 K、近十日 K 线与复权因子数据导出
  • 除复权因子
  • 利润表、资产负债表、现金流量表与财务指标
  • A 股交易日历
  • 同花顺指数列表、指数成分股、指数行情快照与历史 K 线
  • 涨停池与连板梯队
  • 热度飙升榜、热股榜、历史热股榜与热榜排名走势
  • 个股异动原因列表与批量查询
  • 龙虎榜

文档

联系我

加入社区

扫码加入同花顺金融数据社区群:

同花顺金融数据社区群二维码

Documentation

Index

Constants

View Source
const (
	DefaultBaseURL = "https://fuyao.aicubes.cn"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type AdjustmentFactorData

type AdjustmentFactorData struct {
	// Ticker 为不含交易所后缀的展示代码。
	Ticker string `json:"ticker"`
	// ExDateMs 为除权除息日 Asia/Shanghai 零点的 Unix 毫秒时间戳。
	ExDateMs int64 `json:"ex_date_ms"`
	// DividendPerShare 为每股现金分红(税前),非现金事件为 0。
	DividendPerShare float64 `json:"dividend_per_share"`
	// PerShareBonus 为每股送股比例,例如 0.1 表示每 10 股送 1 股。
	PerShareBonus float64 `json:"per_share_bonus"`
}

AdjustmentFactorData 描述一个除权除息事件。

type AdjustmentFactorsRequest

type AdjustmentFactorsRequest struct {
	// THSCode 为带交易所后缀的单只 A 股代码,例如 600519.SH。
	THSCode string
	// From 为事件筛选起始日,格式为 YYYY-MM-DD。
	From string
	// To 为事件筛选截止日,格式为 YYYY-MM-DD。
	To string
}

AdjustmentFactorsRequest 定义复权因子事件流的筛选条件。

func (*AdjustmentFactorsRequest) URLQuery

func (r *AdjustmentFactorsRequest) URLQuery() (values url.Values, err error)

URLQuery 将 AdjustmentFactorsRequest 编码为 URL 查询参数。

type AdjustmentFactorsResponse

type AdjustmentFactorsResponse struct {
	// THSCode 为本次返回事件所属的完整同花顺代码。
	THSCode string `json:"thscode"`
	// Ticker 为不含交易所后缀的展示代码。
	Ticker string `json:"ticker"`
	// Item 为按除权除息日倒序排列的事件列表。
	Item []AdjustmentFactorData `json:"item"`
}

AdjustmentFactorsResponse 为复权因子事件流数据。

type AnomalyAnalysisData

type AnomalyAnalysisData struct {
	// StockName 为发生异动的股票名称。
	StockName string `json:"stock_name"`
	// AnalysisContent 为服务端给出的异动解读内容。
	AnalysisContent string `json:"analysis_content"`
	// KeywordList 为异动解读关联的关键词列表;没有关键词时为空数组。
	KeywordList []string `json:"keyword_list"`
	// THSCode 为带交易所后缀的股票完整代码。
	THSCode string `json:"thscode"`
	// TagName 为异动标签的展示名称,例如大涨。
	TagName string `json:"tag_name"`
}

AnomalyAnalysisData describes one stock anomaly reason.

type AnomalyAnalysisListRequest

type AnomalyAnalysisListRequest struct {
	// TagCodes 为异动标签过滤列表,多个标签按 OR 关系匹配;留空时返回全部当日记录。
	TagCodes []string
}

AnomalyAnalysisListRequest defines optional anomaly tag filters.

func (*AnomalyAnalysisListRequest) URLQuery

func (r *AnomalyAnalysisListRequest) URLQuery() (values url.Values, err error)

URLQuery encodes AnomalyAnalysisListRequest as URL query parameters.

type AnomalyAnalysisResponse

type AnomalyAnalysisResponse struct {
	// Timestamp 为异动数据快照时间,单位为 Unix 毫秒。
	Timestamp int64 `json:"timestamp"`
	// Item 为匹配条件的个股异动原因列表。
	Item []AnomalyAnalysisData `json:"item"`
}

AnomalyAnalysisResponse contains an anomaly-analysis snapshot.

type AnomalyAnalysisStockRequest

type AnomalyAnalysisStockRequest struct {
	// THSCodes 为待查询的股票完整代码列表,单次最多 50 个。
	THSCodes []string
}

AnomalyAnalysisStockRequest defines a batch anomaly lookup by stock code.

func (*AnomalyAnalysisStockRequest) URLQuery

func (r *AnomalyAnalysisStockRequest) URLQuery() (values url.Values, err error)

URLQuery encodes AnomalyAnalysisStockRequest as URL query parameters.

type ApiResponse

type ApiResponse[T any] struct {
	Code      int64  `json:"code"`
	Message   string `json:"message"`
	RequestId string `json:"request_id"`
	Data      T      `json:"data"`
}

ApiResponse 为接口统一响应信封。

type BalanceSheetData

type BalanceSheetData struct {
	// FinancialStatementData 为本条资产负债表记录共用的代码、报告期和币种元数据。
	FinancialStatementData
	// AssetsTotal 为资产总计,单位为原币元;未披露时为 nil。
	AssetsTotal *float64 `json:"assets_total"`
	// TotalCurrentAssets 为流动资产合计,单位为原币元;未披露时为 nil。
	TotalCurrentAssets *float64 `json:"total_current_assets"`
	// NonCurrentNetsTotal 为非流动资产合计,单位为原币元;未披露时为 nil。
	NonCurrentNetsTotal *float64 `json:"non_current_nets_total"`
	// Cash 为货币资金,单位为原币元;未披露时为 nil。
	Cash *float64 `json:"cash"`
	// AccountsReceivable 为应收账款,单位为原币元;未披露时为 nil。
	AccountsReceivable *float64 `json:"accounts_receivable"`
	// TotalDebt 为负债合计,单位为原币元;未披露时为 nil。
	TotalDebt *float64 `json:"total_debt"`
	// HolderEquityTotal 为所有者权益合计,单位为原币元;未披露时为 nil。
	HolderEquityTotal *float64 `json:"holder_equity_total"`
}

BalanceSheetData 描述一条合并资产负债表记录。

type BalanceSheetsResponse

type BalanceSheetsResponse struct {
	// Timestamp 为本次数据中最新报告期末的 Unix 毫秒时间戳。
	Timestamp int64 `json:"timestamp"`
	// Item 为按报告期末倒序排列的合并资产负债表记录。
	Item []BalanceSheetData `json:"item"`
}

BalanceSheetsResponse 为资产负债表数据。

type CalendarTradingDaysData

type CalendarTradingDaysData struct {
	// DateMs 为该交易日在 Asia/Shanghai 00:00:00 对应的 Unix 毫秒时间戳。
	DateMs int64 `json:"date_ms"`
	// Date 为同一交易日的 yyyyMMdd 格式日期,时区为 Asia/Shanghai。
	Date string `json:"date"`
}

CalendarTradingDaysData 描述单个交易日。

type CalendarTradingDaysResponse

type CalendarTradingDaysResponse struct {
	// Timestamp 为数据就绪时间,单位为 Unix 毫秒。
	Timestamp int64 `json:"timestamp"`
	// Item 为交易日列表,按时间升序排列。
	Item []CalendarTradingDaysData `json:"item"`
}

CalendarTradingDaysResponse 为 CalendarTradingDays 返回的交易日历数据。

type CashFlowStatementData

type CashFlowStatementData struct {
	// FinancialStatementData 为本条现金流量表记录共用的代码、报告期和币种元数据。
	FinancialStatementData
	// ActCashFlowNet 为经营活动产生的现金流量净额,单位为原币元;未披露时为 nil。
	ActCashFlowNet *float64 `json:"act_cash_flow_net"`
	// InvestCashFlowNet 为投资活动产生的现金流量净额,单位为原币元;未披露时为 nil。
	InvestCashFlowNet *float64 `json:"invest_cash_flow_net"`
	// FinancingCashFlowNet 为筹资活动产生的现金流量净额,单位为原币元;未披露时为 nil。
	FinancingCashFlowNet *float64 `json:"financing_cash_flow_net"`
	// PayFixedAssetsEtcCash 为购建长期资产支付的现金,单位为原币元;未披露时为 nil。
	PayFixedAssetsEtcCash *float64 `json:"pay_fixed_assets_etc_cash"`
	// PayDividendsProfitsInterestCash 为分配股利、利润或偿付利息支付的现金,单位为原币元;未披露时为 nil。
	PayDividendsProfitsInterestCash *float64 `json:"pay_dividends_profits_interest_cash"`
	// CashEquivalentsNetAddition 为现金及现金等价物净增加额,单位为原币元;未披露时为 nil。
	CashEquivalentsNetAddition *float64 `json:"cash_equivalents_net_addition"`
}

CashFlowStatementData 描述一条合并现金流量表记录。

type CashFlowStatementsResponse

type CashFlowStatementsResponse struct {
	// Timestamp 为本次数据中最新报告期末的 Unix 毫秒时间戳。
	Timestamp int64 `json:"timestamp"`
	// Item 为按报告期末倒序排列的合并现金流量表记录。
	Item []CashFlowStatementData `json:"item"`
}

CashFlowStatementsResponse 为现金流量表数据。

type DragonTigerConceptData

type DragonTigerConceptData struct {
	// Name 为概念展示名称。
	Name string `json:"name"`
}

DragonTigerConceptData 描述股票记录关联的一个概念。

type DragonTigerHotMoney

type DragonTigerHotMoney struct {
	// Name 为游资名称。
	Name string `json:"name"`
	// Buying 为该游资聚合净买入金额,单位为元。
	Buying float64 `json:"buying"`
	// Rows 为该游资关联的股票榜单记录。
	Rows []DragonTigerStockData `json:"rows"`
}

DragonTigerHotMoney 描述一个游资聚合榜单及其关联股票。

type DragonTigerListRequest

type DragonTigerListRequest struct {
	// BoardType 为榜单类型:all(全部)、org(机构)或 hot_money(游资),大小写不敏感;留空使用全部榜。
	BoardType string
	// Date 为目标交易日,格式为 yyyy-MM-dd;留空时由服务端选择最近可用交易日。
	Date string
}

DragonTigerListRequest 定义龙虎榜的可选榜单类型与交易日条件。

func (*DragonTigerListRequest) URLQuery

func (r *DragonTigerListRequest) URLQuery() (values url.Values, err error)

URLQuery 将 DragonTigerListRequest 编码为 URL 查询参数。

type DragonTigerListResponse

type DragonTigerListResponse struct {
	// Timestamp 为目标交易日 Asia/Shanghai 零点的 Unix 毫秒时间戳。
	Timestamp int64 `json:"timestamp"`
	// BoardType 为服务端实际返回的榜单类型。
	BoardType string `json:"board_type"`
	// TradeDate 为服务端实际查询的交易日,格式为 yyyy-MM-dd。
	TradeDate string `json:"trade_date"`
	// Count 为上游记录总数,同一股票可能同时出现当日和三日榜。
	Count int64 `json:"count"`
	// StockCount 为按股票代码去重后的股票数量。
	StockCount int64 `json:"stock_count"`
	// StockItems 为股票维度榜单;查询游资榜时为空数组。
	StockItems []DragonTigerStockData `json:"stock_items"`
	// HotMoneyItems 为游资维度聚合榜单;查询普通榜时为空数组。
	HotMoneyItems []DragonTigerHotMoney `json:"hot_money_items"`
}

DragonTigerListResponse 为龙虎榜榜单数据。

type DragonTigerStockData

type DragonTigerStockData struct {
	// THSCode 为带交易所后缀的标准股票代码。
	THSCode string `json:"thscode"`
	// Ticker 为不含交易所后缀的股票代码。
	Ticker string `json:"ticker"`
	// Name 为股票简称。
	Name string `json:"name"`
	// ConceptList 为股票所属概念列表。
	ConceptList []DragonTigerConceptData `json:"concept_list"`
	// Change 为当日涨跌幅,以小数形式表示。
	Change float64 `json:"change"`
	// NetValue 为龙虎榜净买入金额,单位为元。
	NetValue float64 `json:"net_value"`
	// NetRate 为龙虎榜净买入占比,以小数形式表示。
	NetRate float64 `json:"net_rate"`
	// HotRank 为同花顺人气排名,数值越小排名越靠前。
	HotRank int64 `json:"hot_rank"`
	// BuyValue 为买方金额,单位为元。
	BuyValue float64 `json:"buy_value"`
	// SellValue 为卖方金额,单位为元。
	SellValue float64 `json:"sell_value"`
	// LimitReason 为股票上榜时关联的涨跌停原因。
	LimitReason string `json:"limit_reason"`
	// RangeDays 为上榜区间天数,1 表示当日榜,3 表示三日榜。
	RangeDays int64 `json:"range_days"`
	// OrgNetValue 为机构净买入金额,单位为元。
	OrgNetValue *float64 `json:"org_net_value"`
	// OrgNetRate 为机构净买入占比,以小数形式表示。
	OrgNetRate *float64 `json:"org_net_rate"`
	// OrgBuyNum 为买入机构数量。
	OrgBuyNum *int64 `json:"org_buy_num"`
	// OrgSellNum 为卖出机构数量。
	OrgSellNum *int64 `json:"org_sell_num"`
	// Amount 为股票成交金额,单位为元。
	Amount *float64 `json:"amount"`
	// HotMoneyNetValue 为该股票维度汇总的游资净买入金额,单位为元。
	HotMoneyNetValue *float64 `json:"hot_money_net_value"`
	// HotMoneyNetRate 为该股票维度汇总的游资净买入占比,以小数形式表示。
	HotMoneyNetRate *float64 `json:"hot_money_net_rate"`
	// HotMoneyItemNetValue 为单个游资在该股票上的净买入金额,单位为元。
	HotMoneyItemNetValue *float64 `json:"hot_money_item_net_value"`
	// HotMoneyItemNetRate 为单个游资在该股票上的净买入占比,以小数形式表示。
	HotMoneyItemNetRate *float64 `json:"hot_money_item_net_rate"`
}

DragonTigerStockData 描述龙虎榜中的一条股票记录。

type FinancialIndicatorAbility

type FinancialIndicatorAbility struct {
	// Ability 为能力分类标识,例如 growth 或 profitability。
	Ability string `json:"ability"`
	// Indicators 为该能力分类下的具体指标列表。
	Indicators []FinancialIndicatorData `json:"indicators"`
}

FinancialIndicatorAbility groups indicators by financial capability.

type FinancialIndicatorData

type FinancialIndicatorData struct {
	// IndexID 为指标的稳定标识,例如 total_assets_growth_ratio。
	IndexID string `json:"index_id"`
	// Value 为服务端原样保留的指标数值字符串;上游缺失时为 nil。
	Value *string `json:"value"`
}

FinancialIndicatorData describes one source-preserved financial indicator value.

type FinancialIndicatorsRequest

type FinancialIndicatorsRequest struct {
	// THSCode 为带交易所后缀的单只 A 股代码,例如 300033.SZ。
	THSCode string
	// Report 为报告期,格式为 yyyy-1 到 yyyy-4,例如 2025-1。
	Report string
}

FinancialIndicatorsRequest 定义财务指标的查询条件。

func (*FinancialIndicatorsRequest) URLQuery

func (r *FinancialIndicatorsRequest) URLQuery() (values url.Values, err error)

URLQuery 将 FinancialIndicatorsRequest 编码为 URL 查询参数。

type FinancialIndicatorsResponse

type FinancialIndicatorsResponse struct {
	// THSCode 为入参的完整同花顺代码回显。
	THSCode string `json:"thscode"`
	// Report 为入参报告期的回显。
	Report string `json:"report"`
	// Abilities 为成长、盈利、偿债、营运和现金流五类指标分组。
	Abilities []FinancialIndicatorAbility `json:"abilities"`
}

FinancialIndicatorsResponse 为财务指标数据。

type FinancialStatementData

type FinancialStatementData struct {
	// THSCode 为带交易所后缀的完整同花顺代码。
	THSCode string `json:"thscode"`
	// Ticker 为不含交易所后缀的展示代码。
	Ticker string `json:"ticker"`
	// Period 为本条记录的报告期类型,annual 或 quarterly。
	Period string `json:"period"`
	// FiscalYear 为该报告对应的自然财年。
	FiscalYear int64 `json:"fiscal_year"`
	// FiscalPeriod 为财务期间标识:FY、Q1、Q2、Q3 或 Q4。
	FiscalPeriod string `json:"fiscal_period"`
	// ReportDateMs 为报告披露日的 Unix 毫秒时间戳。
	ReportDateMs int64 `json:"report_date_ms"`
	// PeriodEndMs 为报告期末 Asia/Shanghai 零点的 Unix 毫秒时间戳。
	PeriodEndMs int64 `json:"period_end_ms"`
	// Currency 为金额字段的币种代码,A 股通常为 CNY。
	Currency string `json:"currency"`
}

FinancialStatementData describes fields shared by each financial statement item.

type FinancialStatementsRequest

type FinancialStatementsRequest struct {
	// THSCode 为带交易所后缀的单只 A 股代码,例如 600519.SH。
	THSCode string
	// Period 为报告期类型:annual 表示年报,quarterly 表示季报。
	Period string
	// Limit 为最近 N 期模式下的返回条数。
	Limit int
	// Start 为时间区间模式的起始 Unix 毫秒时间戳,必须与 End 一起提供。
	Start int64
	// End 为时间区间模式的结束 Unix 毫秒时间戳,且不得早于 Start。
	End int64
}

FinancialStatementsRequest 定义三张财务报表共用的查询条件。

func (*FinancialStatementsRequest) URLQuery

func (r *FinancialStatementsRequest) URLQuery() (values url.Values, err error)

URLQuery 将 FinancialStatementsRequest 编码为 URL 查询参数。

type HiThinkFinancialClient

type HiThinkFinancialClient struct {
	// contains filtered or unexported fields
}

HiThinkFinancialClient 是金融数据 API 客户端。

func NewClient

func NewClient(apiKey string) (*HiThinkFinancialClient, error)

NewClient 创建金融数据 API 客户端。

func (*HiThinkFinancialClient) CalendarTradingDays

CalendarTradingDays 获取 A 股近一年的交易日序列。 返回窗口固定为 [今日 - 1 年, 今日],按 Asia/Shanghai 自然日计算,无请求参数。

接口文档:https://fuyao.aicubes.cn/docs/api-reference/calendar/

func (*HiThinkFinancialClient) GetAShareAdjustmentFactors

GetAShareAdjustmentFactors 获取单只 A 股的除复权事件流。 接口文档:https://fuyao.aicubes.cn/docs/api-reference/corporate-actions/

func (*HiThinkFinancialClient) GetAShareAnomalyAnalysisList

func (c *HiThinkFinancialClient) GetAShareAnomalyAnalysisList(ctx context.Context, req *AnomalyAnalysisListRequest) (*AnomalyAnalysisResponse, error)

GetAShareAnomalyAnalysisList 获取当日个股异动原因列表。 接口文档:https://fuyao.aicubes.cn/docs/api-reference/special-data/

func (*HiThinkFinancialClient) GetAShareAnomalyAnalysisStock

func (c *HiThinkFinancialClient) GetAShareAnomalyAnalysisStock(ctx context.Context, req *AnomalyAnalysisStockRequest) (*AnomalyAnalysisResponse, error)

GetAShareAnomalyAnalysisStock 获取指定股票当日的异动原因。 接口文档:https://fuyao.aicubes.cn/docs/api-reference/special-data/

func (*HiThinkFinancialClient) GetAShareBalanceSheets

GetAShareBalanceSheets 获取单只 A 股的多期合并资产负债表。 接口文档:https://fuyao.aicubes.cn/docs/api-reference/financials/

func (*HiThinkFinancialClient) GetAShareCashFlowStatements

GetAShareCashFlowStatements 获取单只 A 股的多期合并现金流量表。 接口文档:https://fuyao.aicubes.cn/docs/api-reference/financials/

func (*HiThinkFinancialClient) GetAShareDragonTigerList

GetAShareDragonTigerList 获取指定交易日和榜单类型的龙虎榜数据。 接口文档:https://fuyao.aicubes.cn/docs/api-reference/special-data/

func (*HiThinkFinancialClient) GetAShareFinancialIndicators

GetAShareFinancialIndicators 获取单只 A 股指定报告期的财务指标。 接口文档:https://fuyao.aicubes.cn/docs/api-reference/financial-indicators/

func (*HiThinkFinancialClient) GetAShareHotStockList

func (c *HiThinkFinancialClient) GetAShareHotStockList(ctx context.Context, req *HotListRequest) (*HotListResponse, error)

GetAShareHotStockList 获取 A 股热股榜单。 接口文档:https://fuyao.aicubes.cn/docs/api-reference/special-data/

func (*HiThinkFinancialClient) GetAShareHotStockListHistory

GetAShareHotStockListHistory 获取指定自然日的热股榜历史排行。 接口文档:https://fuyao.aicubes.cn/docs/api-reference/special-data/

func (*HiThinkFinancialClient) GetAShareHotStockRankTrend

GetAShareHotStockRankTrend 获取单只 A 股在日期区间内的热股排名走势。 接口文档:https://fuyao.aicubes.cn/docs/api-reference/special-data/

func (*HiThinkFinancialClient) GetAShareIncomeStatements

GetAShareIncomeStatements 获取单只 A 股的多期合并利润表。 接口文档:https://fuyao.aicubes.cn/docs/api-reference/financials/

func (*HiThinkFinancialClient) GetAShareIndexPricesHistorical

GetAShareIndexPricesHistorical 获取单只指数的历史日 K 线。 接口文档:https://fuyao.aicubes.cn/docs/api-reference/a-share-index/

func (*HiThinkFinancialClient) GetAShareIndexPricesSnapshot

func (c *HiThinkFinancialClient) GetAShareIndexPricesSnapshot(ctx context.Context, req *IndexPricesSnapshotRequest) (*SnapshotDataResponse, error)

GetAShareIndexPricesSnapshot 获取指定指数的最新行情快照。 接口文档:https://fuyao.aicubes.cn/docs/api-reference/a-share-index/

func (*HiThinkFinancialClient) GetAShareLimitUpLadder

func (c *HiThinkFinancialClient) GetAShareLimitUpLadder(ctx context.Context) (*LimitUpLadderResponse, error)

GetAShareLimitUpLadder 获取近三十个交易日的连板天梯。 接口文档:https://fuyao.aicubes.cn/docs/api-reference/special-data/

func (*HiThinkFinancialClient) GetAShareLimitUpPool

func (c *HiThinkFinancialClient) GetAShareLimitUpPool(ctx context.Context, req *LimitUpPoolRequest) (*LimitUpPoolResponse, error)

GetAShareLimitUpPool 获取指定交易日的涨停股票池。 接口文档:https://fuyao.aicubes.cn/docs/api-reference/special-data/

func (*HiThinkFinancialClient) GetASharePricesHistorical

GetASharePricesHistorical 获取单只 A 股的历史日 K 线。 接口文档:https://fuyao.aicubes.cn/docs/api-reference/prices/

func (*HiThinkFinancialClient) GetASharePricesSnapshot

func (c *HiThinkFinancialClient) GetASharePricesSnapshot(ctx context.Context, req *SnapshotDataRequest) (*SnapshotDataResponse, error)

GetASharePricesSnapshot 获取 A 股行情快照。 显式传入 thscodes 时按入参顺序批量取数;省略 thscodes 时按 thscode 升序分页获取完整 A 股代码表。

接口文档:https://fuyao.aicubes.cn/docs/api-reference/prices/

func (*HiThinkFinancialClient) GetAShareSkyrocketList

func (c *HiThinkFinancialClient) GetAShareSkyrocketList(ctx context.Context, req *HotListRequest) (*HotListResponse, error)

GetAShareSkyrocketList 获取 A 股热度飙升榜。 接口文档:https://fuyao.aicubes.cn/docs/api-reference/special-data/

func (*HiThinkFinancialClient) GetMarketDumpAdjustmentFactorsDownloadURL

func (c *HiThinkFinancialClient) GetMarketDumpAdjustmentFactorsDownloadURL(ctx context.Context) (*MarketDumpDownloadURLResponse, error)

GetMarketDumpAdjustmentFactorsDownloadURL 获取全市场复权因子 Parquet 文件的临时下载信息。 接口文档:https://fuyao.aicubes.cn/docs/api-reference/market-dumps/

func (*HiThinkFinancialClient) GetMarketDumpDailyK10DDownloadURL

func (c *HiThinkFinancialClient) GetMarketDumpDailyK10DDownloadURL(ctx context.Context) (*MarketDumpDownloadURLResponse, error)

GetMarketDumpDailyK10DDownloadURL 获取最近十个交易日日 K Parquet 文件的临时下载信息。 接口文档:https://fuyao.aicubes.cn/docs/api-reference/market-dumps/

func (*HiThinkFinancialClient) GetMarketDumpDailyKDownloadURL

func (c *HiThinkFinancialClient) GetMarketDumpDailyKDownloadURL(ctx context.Context) (*MarketDumpDownloadURLResponse, error)

GetMarketDumpDailyKDownloadURL 获取全市场十年日 K Parquet 文件的临时下载信息。 接口文档:https://fuyao.aicubes.cn/docs/api-reference/market-dumps/

func (*HiThinkFinancialClient) GetTHSIndexConstituents

GetTHSIndexConstituents 获取单只同花顺或标准指数的当前成分股。 接口文档:https://fuyao.aicubes.cn/docs/api-reference/a-share-index/

func (*HiThinkFinancialClient) GetTHSIndexList

GetTHSIndexList 获取同花顺指数目录。 接口文档:https://fuyao.aicubes.cn/docs/api-reference/a-share-index/

func (*HiThinkFinancialClient) Query

func (c *HiThinkFinancialClient) Query(ctx context.Context, path string, params QueryEncoder, result any) (err error)

Query 执行 HTTP GET 请求并将响应解码到 result。

func (*HiThinkFinancialClient) TickerSearch

TickerSearch 按 thscode、ticker 代码或中英文名称检索标的,支持子串匹配。

接口文档:https://fuyao.aicubes.cn/docs/api-reference/ticker-search/

func (*HiThinkFinancialClient) TickersList

TickersList 按资产类别筛选并通过 offset、limit 分页获取标的元信息。 调用方循环递增 Offset;当 len(resp.Item) 小于有效页长时,表示已获取全部数据。 有效页长为 Limit(大于 0 时),否则为服务端默认值 1000。

接口文档:https://fuyao.aicubes.cn/docs/api-reference/ticker-list/

type HistoricalPricesRequest

type HistoricalPricesRequest struct {
	// THSCode 为带交易所后缀的单只标的代码,例如 600519.SH。
	THSCode string
	// Interval 为 K 线周期;当前仅支持 1d。
	Interval string
	// Start 为查询起始时间的 Unix 毫秒时间戳。
	Start int64
	// End 为查询结束时间的 Unix 毫秒时间戳,且不得早于 Start。
	End int64
	// Adjust 为复权方式:none、forward(前复权)或 backward(后复权)。
	Adjust string
	// Offset 为分页偏移量,省略时由服务端使用默认值 0。
	Offset int
}

HistoricalPricesRequest 定义单只标的历史 K 线的查询条件。

func (*HistoricalPricesRequest) URLQuery

func (r *HistoricalPricesRequest) URLQuery() (values url.Values, err error)

URLQuery 将 HistoricalPricesRequest 编码为 URL 查询参数。

type HistoricalPricesResponse

type HistoricalPricesResponse struct {
	// Timestamp 为数据就绪时间,单位为 Unix 毫秒。
	Timestamp int64 `json:"timestamp"`
	// Item 为按时间顺序返回的 K 线记录。
	Item []PriceBarData `json:"item"`
}

HistoricalPricesResponse 为 A 股历史 K 线数据。

type HotListData

type HotListData struct {
	// THSCode 为带交易所后缀的标准股票代码。
	THSCode string `json:"thscode"`
	// Ticker 为不含交易所后缀的股票代码。
	Ticker string `json:"ticker"`
	// Name 为股票简称。
	Name string `json:"name"`
	// Rank 为当前榜单排名。
	Rank int64 `json:"rank"`
	// Heat 为服务端原样返回的热度字符串。
	Heat string `json:"heat"`
	// RankChange 为名次变化,正值表示上升,负值表示下降;缺失时为 nil。
	RankChange *int64 `json:"rank_change"`
	// RankTrend 为排名趋势:up、down、flat 或 unknown。
	RankTrend string `json:"rank_trend"`
}

HotListData 描述热榜或飙升榜中的一只股票。

type HotListRequest

type HotListRequest struct {
	// Period 为榜单周期:day 表示日榜,hour 表示小时榜;留空使用服务端默认 day。
	Period string
}

HotListRequest 定义热榜和飙升榜的可选周期。

func (*HotListRequest) URLQuery

func (r *HotListRequest) URLQuery() (values url.Values, err error)

URLQuery 将 HotListRequest 编码为 URL 查询参数。

type HotListResponse

type HotListResponse struct {
	// Timestamp 为榜单生成时间,单位为 Unix 毫秒。
	Timestamp int64 `json:"timestamp"`
	// Item 为榜单股票条目,服务端最多返回 30 条。
	Item []HotListData `json:"item"`
}

HotListResponse 为热榜或飙升榜数据。

type HotStockListHistoryData

type HotStockListHistoryData struct {
	// THSCode 为带交易所后缀的标准股票代码。
	THSCode string `json:"thscode"`
	// Ticker 为不含交易所后缀的股票代码。
	Ticker string `json:"ticker"`
	// Name 为股票简称。
	Name string `json:"name"`
	// Rank 为该自然日的热榜排名。
	Rank int64 `json:"rank"`
}

HotStockListHistoryData 描述历史热股榜中的一只股票。

type HotStockListHistoryRequest

type HotStockListHistoryRequest struct {
	// Date 为查询自然日,格式为 yyyy-MM-dd,且服务端仅支持一年内的数据。
	Date string
}

HotStockListHistoryRequest 定义历史热股榜日期。

func (*HotStockListHistoryRequest) URLQuery

func (r *HotStockListHistoryRequest) URLQuery() (values url.Values, err error)

URLQuery 将 HotStockListHistoryRequest 编码为 URL 查询参数。

type HotStockListHistoryResponse

type HotStockListHistoryResponse struct {
	// Date 为服务端回显的查询自然日,格式为 yyyy-MM-dd。
	Date string `json:"date"`
	// DateMs 为查询自然日 Asia/Shanghai 零点的 Unix 毫秒时间戳。
	DateMs int64 `json:"date_ms"`
	// Item 为该自然日的热股排行条目。
	Item []HotStockListHistoryData `json:"item"`
}

HotStockListHistoryResponse 为指定自然日的热股排行数据。

type HotStockRankTrendData

type HotStockRankTrendData struct {
	// THSCode 为带交易所后缀的标准股票代码。
	THSCode string `json:"thscode"`
	// Ticker 为不含交易所后缀的股票代码。
	Ticker string `json:"ticker"`
	// Date 为该点位对应的自然日,格式为 yyyy-MM-dd。
	Date string `json:"date"`
	// DateMs 为该自然日 Asia/Shanghai 零点的 Unix 毫秒时间戳。
	DateMs int64 `json:"date_ms"`
	// Rank 为该自然日的热股排名。
	Rank int64 `json:"rank"`
}

HotStockRankTrendData 描述一个自然日的热股排名走势点位。

type HotStockRankTrendRequest

type HotStockRankTrendRequest struct {
	// THSCode 为带交易所后缀的单只 A 股代码,例如 300034.SZ。
	THSCode string
	// StartDate 为查询起始自然日,格式为 yyyy-MM-dd。
	StartDate string
	// EndDate 为查询结束自然日,格式为 yyyy-MM-dd,且不得早于 StartDate。
	EndDate string
}

HotStockRankTrendRequest 定义单只股票的热榜排名走势区间。

func (*HotStockRankTrendRequest) URLQuery

func (r *HotStockRankTrendRequest) URLQuery() (values url.Values, err error)

URLQuery 将 HotStockRankTrendRequest 编码为 URL 查询参数。

type HotStockRankTrendResponse

type HotStockRankTrendResponse struct {
	// Timestamp 为起始自然日 Asia/Shanghai 零点的 Unix 毫秒时间戳。
	Timestamp int64 `json:"timestamp"`
	// Item 为按自然日返回的热榜排名走势点位。
	Item []HotStockRankTrendData `json:"item"`
}

HotStockRankTrendResponse 为热股排名走势数据。

type IncomeStatementData

type IncomeStatementData struct {
	// FinancialStatementData 为本条利润表记录共用的代码、报告期和币种元数据。
	FinancialStatementData
	// OperatingIncome 为营业收入,单位为原币元;未披露时为 nil。
	OperatingIncome *float64 `json:"operating_income"`
	// OperatingCosts 为营业成本,单位为原币元;未披露时为 nil。
	OperatingCosts *float64 `json:"operating_costs"`
	// OperatingExpenses 为营业总成本,单位为原币元;未披露时为 nil。
	OperatingExpenses *float64 `json:"operating_expenses"`
	// SalesFee 为销售费用,单位为原币元;未披露时为 nil。
	SalesFee *float64 `json:"sales_fee"`
	// ManageFee 为管理费用,单位为原币元;未披露时为 nil。
	ManageFee *float64 `json:"manage_fee"`
	// ResearchAndDevelopmentExpenses 为研发费用,单位为原币元;未披露时为 nil。
	ResearchAndDevelopmentExpenses *float64 `json:"research_and_development_expenses"`
	// OperatingProfit 为营业利润,单位为原币元;未披露时为 nil。
	OperatingProfit *float64 `json:"operating_profit"`
	// InterestExpenses 为利息费用,单位为原币元;未披露时为 nil。
	InterestExpenses *float64 `json:"interest_expenses"`
	// ProfitTotal 为利润总额,单位为原币元;未披露时为 nil。
	ProfitTotal *float64 `json:"profit_total"`
	// IncomeTaxExpense 为所得税费用,单位为原币元;未披露时为 nil。
	IncomeTaxExpense *float64 `json:"income_tax_expense"`
	// NetProfit 为净利润,单位为原币元;未披露时为 nil。
	NetProfit *float64 `json:"net_profit"`
	// ParentHolderNetProfit 为归属于母公司股东的净利润,单位为原币元;未披露时为 nil。
	ParentHolderNetProfit *float64 `json:"parent_holder_net_profit"`
	// BasicEPS 为基本每股收益,单位为元/股;未披露时为 nil。
	BasicEPS *float64 `json:"basic_eps"`
}

IncomeStatementData 描述一条合并利润表记录。

type IncomeStatementsResponse

type IncomeStatementsResponse struct {
	// Timestamp 为本次数据中最新报告期末的 Unix 毫秒时间戳。
	Timestamp int64 `json:"timestamp"`
	// Item 为按报告期末倒序排列的合并利润表记录。
	Item []IncomeStatementData `json:"item"`
}

IncomeStatementsResponse 为利润表数据。

type IndexPricesHistoricalRequest

type IndexPricesHistoricalRequest struct {
	// THSCode 为带后缀的单只指数代码,例如 000001.SH。
	THSCode string
	// Interval 为 K 线周期;当前仅支持 1d。
	Interval string
	// Start 为查询起始时间的 Unix 毫秒时间戳。
	Start int64
	// End 为查询结束时间的 Unix 毫秒时间戳,且不得早于 Start。
	End int64
}

IndexPricesHistoricalRequest 定义单只指数历史 K 线的查询条件。

func (*IndexPricesHistoricalRequest) URLQuery

func (r *IndexPricesHistoricalRequest) URLQuery() (values url.Values, err error)

URLQuery 将 IndexPricesHistoricalRequest 编码为 URL 查询参数。

type IndexPricesHistoricalResponse

type IndexPricesHistoricalResponse struct {
	// Timestamp 为数据就绪时间,单位为 Unix 毫秒。
	Timestamp int64 `json:"timestamp"`
	// Adjust 为服务端回显的复权方式;指数 K 线固定返回 nil。
	Adjust *string `json:"adjust"`
	// Item 为按时间顺序返回的 K 线记录。
	Item []PriceBarData `json:"item"`
}

IndexPricesHistoricalResponse 为指数历史 K 线数据。

type IndexPricesSnapshotRequest

type IndexPricesSnapshotRequest struct {
	// THSCodes 为需要查询的指数完整代码列表,至少包含一个代码。
	THSCodes []string
	// Limit 为分页大小。
	Limit int
	// Offset 为分页偏移量。
	Offset int64
}

IndexPricesSnapshotRequest 定义行情快照必需的指数代码列表。

func (*IndexPricesSnapshotRequest) URLQuery

func (r *IndexPricesSnapshotRequest) URLQuery() (values url.Values, err error)

URLQuery 将 IndexPricesSnapshotRequest 编码为 URL 查询参数。

type LimitUpLadderBoardCaps

type LimitUpLadderBoardCaps struct {
	// TwoBoard 为二连板层级的最大股票数。
	TwoBoard int64 `json:"two_board"`
	// ThreeBoard 为三连板层级的最大股票数。
	ThreeBoard int64 `json:"three_board"`
	// FourBoard 为四连板层级的最大股票数。
	FourBoard int64 `json:"four_board"`
	// FiveBoard 为五连板层级的最大股票数。
	FiveBoard int64 `json:"five_board"`
	// SixBoard 为六连板层级的最大股票数。
	SixBoard int64 `json:"six_board"`
	// SevenOver 为七连板及以上层级的最大股票数。
	SevenOver int64 `json:"seven_over"`
}

LimitUpLadderBoardCaps 描述各连板层级的容量上限。

type LimitUpLadderBoards

type LimitUpLadderBoards struct {
	// TwoBoard 为二连板股票列表。
	TwoBoard []LimitUpLadderStockData `json:"two_board"`
	// ThreeBoard 为三连板股票列表。
	ThreeBoard []LimitUpLadderStockData `json:"three_board"`
	// FourBoard 为四连板股票列表。
	FourBoard []LimitUpLadderStockData `json:"four_board"`
	// FiveBoard 为五连板股票列表。
	FiveBoard []LimitUpLadderStockData `json:"five_board"`
	// SixBoard 为六连板股票列表。
	SixBoard []LimitUpLadderStockData `json:"six_board"`
	// SevenOver 为七连板及以上股票列表。
	SevenOver []LimitUpLadderStockData `json:"seven_over"`
}

LimitUpLadderBoards 包含固定的六个连板层级列表。

type LimitUpLadderData

type LimitUpLadderData struct {
	// Date 为交易日,格式为 yyyyMMdd。
	Date string `json:"date"`
	// Boards 为该交易日按连板层级分组的股票列表。
	Boards LimitUpLadderBoards `json:"boards"`
}

LimitUpLadderData 描述单个交易日的连板矩阵。

type LimitUpLadderResponse

type LimitUpLadderResponse struct {
	// Timestamp 为数据就绪时间,单位为 Unix 毫秒。
	Timestamp int64 `json:"timestamp"`
	// Window 为服务端固定交易日窗口的元信息。
	Window LimitUpLadderWindow `json:"window"`
	// Item 为按交易日组织的连板矩阵。
	Item []LimitUpLadderData `json:"item"`
}

LimitUpLadderResponse 为近三十个交易日的连板天梯数据。

type LimitUpLadderStockData

type LimitUpLadderStockData struct {
	// THSCode 为带交易所后缀的标准股票代码。
	THSCode string `json:"thscode"`
	// Ticker 为不含交易所后缀的股票代码。
	Ticker string `json:"ticker"`
	// Name 为股票简称。
	Name string `json:"name"`
	// BoardNum 为当前连板数。
	BoardNum int64 `json:"board_num"`
	// SealNextday 表示次一交易日是否继续封板;最新交易日没有参考值时为 nil。
	SealNextday *bool `json:"seal_nextday"`
	// SignLevel 为上游标记等级。
	SignLevel int64 `json:"sign_level"`
}

LimitUpLadderStockData 描述连板层级中的一只股票。

type LimitUpLadderWindow

type LimitUpLadderWindow struct {
	// Length 为交易日窗口长度。
	Length int64 `json:"length"`
	// DateList 为窗口内交易日列表,格式为 yyyyMMdd。
	DateList []string `json:"date_list"`
	// BoardCaps 为各连板层级允许返回的最大股票数。
	BoardCaps LimitUpLadderBoardCaps `json:"board_caps"`
}

LimitUpLadderWindow 描述连板天梯的时间窗口和各板位容量。

type LimitUpPoolData

type LimitUpPoolData struct {
	// THSCode 为带交易所后缀的标准股票代码。
	THSCode string `json:"thscode"`
	// Ticker 为不含交易所后缀的股票代码。
	Ticker string `json:"ticker"`
	// Name 为股票简称。
	Name string `json:"name"`
	// IsST 表示该股票是否为 ST 股票。
	IsST bool `json:"is_st"`
	// IsNew 表示该股票是否为尚未开板的新股。
	IsNew bool `json:"is_new"`
	// LastPrice 为当前价格,单位为元。
	LastPrice float64 `json:"last_price"`
	// PriceChangeRatioPct 为涨跌幅百分比数值,例如 10 表示 10%。
	PriceChangeRatioPct float64 `json:"price_change_ratio_pct"`
	// LimitUpTime 为涨停时间,格式为 HH:MM。
	LimitUpTime string `json:"limit_up_time"`
	// LimitUpReason 为涨停原因;上游未提供时为 nil。
	LimitUpReason *string `json:"limit_up_reason"`
	// ContinueDayText 为连板文本,例如首板或 5 天 4 板。
	ContinueDayText string `json:"continue_day_text"`
	// ContinueDayCnt 为连板计数。
	ContinueDayCnt int64 `json:"continue_day_cnt"`
	// SealMoney 为当前封单额,单位为元。
	SealMoney float64 `json:"seal_money"`
	// MaxSealMoney 为峰值封单额,单位为元。
	MaxSealMoney float64 `json:"max_seal_money"`
}

LimitUpPoolData 描述涨停股票池中的一只股票。

type LimitUpPoolPagination

type LimitUpPoolPagination struct {
	// Total 为符合条件的股票总条数。
	Total int64 `json:"total"`
	// Pages 为总页数。
	Pages int64 `json:"pages"`
	// Size 为当前每页条数。
	Size int64 `json:"size"`
	// Page 为当前页码。
	Page int64 `json:"page"`
}

LimitUpPoolPagination 描述涨停股票池的分页状态。

type LimitUpPoolRequest

type LimitUpPoolRequest struct {
	// DateMs 为查询交易日 Asia/Shanghai 零点的 Unix 毫秒时间戳;留空时由服务端使用当前自然日。
	DateMs int64
	// Page 为从 1 开始的页码;留空时由服务端使用默认值 1。
	Page int
	// Size 为每页条数,取值范围为 1 到 200;留空时由服务端使用默认值 50。
	Size int
	// SortField 为排序字段:last_price、continue_day_cnt、seal_money 或 limit_up_time。
	SortField string
	// SortDir 为排序方向:asc 或 desc。
	SortDir string
}

LimitUpPoolRequest 定义涨停股票池的日期、分页和排序条件。

func (*LimitUpPoolRequest) URLQuery

func (r *LimitUpPoolRequest) URLQuery() (values url.Values, err error)

URLQuery 将 LimitUpPoolRequest 编码为 URL 查询参数。

type LimitUpPoolResponse

type LimitUpPoolResponse struct {
	// Timestamp 为数据就绪时间,单位为 Unix 毫秒。
	Timestamp int64 `json:"timestamp"`
	// Pagination 为当前查询的分页信息。
	Pagination LimitUpPoolPagination `json:"pagination"`
	// Item 为当前页的涨停股票列表。
	Item []LimitUpPoolData `json:"item"`
}

LimitUpPoolResponse 为涨停股票池数据。

type MarketDumpDownloadURLResponse

type MarketDumpDownloadURLResponse struct {
	// PresignedURL 为指向 Parquet 文件的短时有效预签名下载链接。
	PresignedURL string `json:"presigned_url"`
	// PresignedURLExpiresAt 为预签名下载链接的过期时间,格式为 RFC3339/date-time 字符串。
	PresignedURLExpiresAt string `json:"presigned_url_expires_at"`
	// ExpiresInSeconds 为预签名下载链接距离过期的秒数。
	ExpiresInSeconds int64 `json:"expires_in_seconds"`
}

MarketDumpDownloadURLResponse 为市场导出服务返回的临时下载信息。

type PriceBarData

type PriceBarData struct {
	// DateMs 为该根 K 线对应交易日的 Unix 毫秒时间戳。
	DateMs int64 `json:"date_ms"`
	// OpenPrice 为开盘价,使用原始货币计价。
	OpenPrice float64 `json:"open_price"`
	// HighPrice 为最高价,使用原始货币计价。
	HighPrice float64 `json:"high_price"`
	// LowPrice 为最低价,使用原始货币计价。
	LowPrice float64 `json:"low_price"`
	// ClosePrice 为收盘价,使用原始货币计价。
	ClosePrice float64 `json:"close_price"`
	// Volume 为成交量,单位为股。
	Volume float64 `json:"volume"`
	// Turnover 为成交额,使用原始货币计价。
	Turnover float64 `json:"turnover"`
}

PriceBarData 描述一个日 K 线。

type QueryEncoder

type QueryEncoder interface {
	URLQuery() (values url.Values, err error)
}

type SnapshotData

type SnapshotData struct {
	// THSCode 为带交易所后缀的完整 thscode,例如 600519.SH。
	THSCode string `json:"thscode"`
	// Ticker 为不含交易所后缀的纯代码,例如 600519。
	Ticker string `json:"ticker"`
	// LastPrice 为最新成交价,使用原始货币计价。
	LastPrice float64 `json:"last_price"`
	// PriceChange 为相对前收盘价的涨跌额,使用原始货币计价。
	PriceChange float64 `json:"price_change"`
	// PriceChangeRatioPct 为涨跌幅百分比数值,例如 1.74 表示 +1.74%。
	PriceChangeRatioPct float64 `json:"price_change_ratio_pct"`
	// OpenPrice 为当日开盘价。
	OpenPrice float64 `json:"open_price"`
	// HighPrice 为当日最高价。
	HighPrice float64 `json:"high_price"`
	// LowPrice 为当日最低价。
	LowPrice float64 `json:"low_price"`
	// PrevPrice 为前收盘价。
	PrevPrice float64 `json:"prev_price"`
	// Volume 为成交量,单位为股。
	Volume float64 `json:"volume"`
	// Turnover 为成交额,使用原始货币计价。
	Turnover float64 `json:"turnover"`
}

SnapshotData 描述单个 A 股行情快照。

type SnapshotDataRequest

type SnapshotDataRequest struct {
	// Thscodes 为逗号分隔的 thscode 列表,例如 600519.SH,000001.SZ。
	// 非空时按入参顺序返回结果,并忽略 Limit 和 Offset。
	Thscodes []string
	// Limit 为分页大小,仅在 Thscodes 为空时生效,接口默认 100。
	Limit int
	// Offset 为分页偏移量,仅在 Thscodes 为空时生效,接口默认 0。
	Offset int64
}

SnapshotDataRequest 定义 A 股行情快照的筛选与分页参数。

func (*SnapshotDataRequest) URLQuery

func (c *SnapshotDataRequest) URLQuery() (values url.Values, err error)

URLQuery 将 SnapshotDataRequest 编码为 URL 查询参数。

type SnapshotDataResponse

type SnapshotDataResponse struct {
	// Timestamp 为数据就绪时间,单位为 Unix 毫秒。
	// 显式传入 Thscodes 时为 nil;全市场分页模式下为序列中最新有效时间。
	Timestamp *int64 `json:"timestamp"`
	// Total 为全市场代码表总数,用于分页模式估算页数。
	Total int64 `json:"total"`
	// Item 为快照记录列表,单条记录也以数组返回。
	Item []SnapshotData `json:"item"`
}

SnapshotDataResponse 为 GetASharePricesSnapshot 返回的行情快照数据。

type THSIndexConstituentData

type THSIndexConstituentData struct {
	// THSCode 为成分股带交易所后缀的完整代码。
	THSCode string `json:"thscode"`
	// Ticker 为成分股不含交易所后缀的展示代码。
	Ticker string `json:"ticker"`
	// Name 为成分股展示名称。
	Name string `json:"name"`
}

THSIndexConstituentData 描述一只成分股。

type THSIndexConstituentsRequest

type THSIndexConstituentsRequest struct {
	// THSCode 为带后缀的单只指数代码,例如 886042.TI 或 000300.SH。
	THSCode string
}

THSIndexConstituentsRequest 定义单只指数的成分股查询条件。

func (*THSIndexConstituentsRequest) URLQuery

func (r *THSIndexConstituentsRequest) URLQuery() (values url.Values, err error)

URLQuery 将 THSIndexConstituentsRequest 编码为 URL 查询参数。

type THSIndexConstituentsResponse

type THSIndexConstituentsResponse struct {
	// Timestamp 为成分股快照时间,单位为 Unix 毫秒。
	Timestamp int64 `json:"timestamp"`
	// Item 为该指数当前的成分股列表。
	Item []THSIndexConstituentData `json:"item"`
}

THSIndexConstituentsResponse 为指数成分股快照数据。

type THSIndexData

type THSIndexData struct {
	// THSCode 为同花顺指数的完整代码,例如 886042.TI。
	THSCode string `json:"thscode"`
	// Name 为指数展示名称。
	Name string `json:"name"`
}

THSIndexData 描述目录中的一只同花顺指数。

type THSIndexListRequest

type THSIndexListRequest struct {
	// Tag 为指数目录分类:cn_concept、region、tszs 或 industry,大小写不敏感;留空使用服务端默认分类。
	Tag string
}

THSIndexListRequest 定义指数目录的可选标签过滤条件。

func (*THSIndexListRequest) URLQuery

func (r *THSIndexListRequest) URLQuery() (values url.Values, err error)

URLQuery 将 THSIndexListRequest 编码为 URL 查询参数。

type THSIndexListResponse

type THSIndexListResponse struct {
	// Timestamp 为指数目录快照时间,单位为 Unix 毫秒。
	Timestamp int64 `json:"timestamp"`
	// Item 为匹配标签的同花顺指数列表。
	Item []THSIndexData `json:"item"`
}

THSIndexListResponse 为指数目录快照数据。

type TickerListData

type TickerListData struct {
	// THSCode 为完整的同花顺代码,例如 600519.SH。
	THSCode string `json:"thscode"`
	// Ticker 为不含交易所后缀的纯代码,例如 600519。
	Ticker string `json:"ticker"`
	// Name 为标的展示名称。
	Name string `json:"name"`
	// Exchange 为交易所后缀:SH、SZ 或 BJ;无后缀的指数为 nil。
	Exchange *string `json:"exchange"`
	// AssetType 为对外资产类别:a-share 或 a-share-index。
	AssetType string `json:"asset_type"`
	// Currency 为币种代码,A 股恒为 CNY。
	Currency string `json:"currency"`
}

TickerListData 描述单个标的。

type TickerListRequest

type TickerListRequest struct {
	// AssetType 为资产类别:a-share 或 a-share-index。
	AssetType string
	// Limit 为每页条数,接口默认 1000,最大 10000。
	Limit int
	// Offset 为从 0 开始的分页偏移量,接口默认 0。
	Offset int64
}

TickerListRequest 定义 TickersList 的可选筛选条件与分页参数。

func (*TickerListRequest) URLQuery

func (p *TickerListRequest) URLQuery() (url.Values, error)

URLQuery 将 TickerListRequest 编码为 URL 查询参数。

type TickerListResponse

type TickerListResponse struct {
	// Timestamp 为上游标的列表快照的加载时间,单位为 Unix 毫秒。
	Timestamp int64 `json:"timestamp"`
	// Item 为符合筛选条件的标的列表。
	Item []TickerListData `json:"item"`
}

TickerListResponse 为 TickersList 返回的标的列表数据。

type TickerSearchData

type TickerSearchData struct {
	// Thscode 为完整的同花顺代码,例如 600519.SH。
	Thscode string `json:"thscode"`
	// Ticker 为不含交易所后缀的纯代码,例如 600519。
	Ticker string `json:"ticker"`
	// Name 为标的展示名称。
	Name string `json:"name"`
	// Exchange 为交易所后缀:SH、SZ 或 BJ;无后缀的指数为 nil。
	Exchange *string `json:"exchange"`
	// AssetType 为对外资产类别:a-share 或 a-share-index。
	AssetType string `json:"asset_type"`
	// Currency 为币种代码,A 股恒为 CNY。
	Currency string `json:"currency"`
}

TickerSearchData 描述单个匹配标的。

type TickerSearchRequest

type TickerSearchRequest struct {
	// Q 为必填搜索关键词,支持完整 thscode、ticker 代码或中英文名称的子串匹配。
	Q string
	// AssetType 为可选资产类别过滤:a-share(A 股)或 a-share-index(A 股指数)。
	AssetType string
	// Limit 为返回条数上限,接口默认 10,最大 50。
	Limit int
}

TickerSearchRequest 定义 TickerSearch 的查询条件。

func (*TickerSearchRequest) URLQuery

func (c *TickerSearchRequest) URLQuery() (values url.Values, err error)

URLQuery 将 TickerSearchRequest 编码为 URL 查询参数。

type TickerSearchResponse

type TickerSearchResponse struct {
	// Timestamp 为上游代码表快照的加载时间,单位为 Unix 毫秒。
	Timestamp int64 `json:"timestamp"`
	// Item 为匹配搜索关键词的标的列表。
	Item []TickerSearchData `json:"item"`
}

TickerSearchResponse 为 TickerSearch 返回的标的检索结果。

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL