### Install the API package Source: https://kouchao.github.io/TiantianFundApi/guide Installs the library as a dependency in your project. ```bash npm i tiantian-fund-api -S ``` -------------------------------- ### Install project dependencies Source: https://kouchao.github.io/TiantianFundApi/guide Run this command in the project root to install required dependencies. ```bash npm i ``` -------------------------------- ### Start the application in Node.js Source: https://kouchao.github.io/TiantianFundApi/guide Starts the API server using the configured npm script. ```bash npm run start ``` -------------------------------- ### GET /stockGet - Get Stock Details Source: https://kouchao.github.io/TiantianFundApi/apis Retrieves comprehensive details for a given stock, including its name, industry, pricing, trading volume, market capitalization, and flow data. ```APIDOC ## GET /stockGet ### Description Retrieves comprehensive details for a given stock. ### Method GET ### Endpoint /stockGet ### Parameters #### Query Parameters - **type** (integer) - Required - Market type (0: Other, 1: Shanghai, 2: Unknown, 116: Hong Kong, 105: US, 155: UK) - **code** (string) - Required - Stock code ### Response #### Success Response (200) - **f57** (string) - Stock code. - **f58** (string) - Stock name. - **f127** (string) - Industry. - **f43** (number) - Transaction price. - **f44** (number) - Highest price. - **f45** (number) - Lowest price. - **f169** (number) - Price change amount. - **f170** (number) - Price change percentage. - **f168** (number) - Turnover rate. - **f47** (number) - Total volume. - **f48** (number) - Total turnover. - **f116** (number) - Total market capitalization. - **f117** (number) - Circulating market capitalization. - **f162** (number) - Price-to-earnings ratio (P/E). - **f135** (number) - Main fund inflow. - **f136** (number) - Main fund outflow. - **f137** (number) - Main fund net flow. - **f138** (number) - Super large order inflow. - **f139** (number) - Super large order outflow. - **f140** (number) - Super large order net flow. - **f141** (number) - Large order inflow. - **f142** (number) - Large order outflow. - **f143** (number) - Large order net flow. - **f144** (number) - Medium order inflow. - **f145** (number) - Medium order outflow. - **f146** (number) - Medium order net flow. - **f147** (number) - Small order inflow. - **f148** (number) - Small order outflow. - **f149** (number) - Small order net flow. - **f178** (string) - Recent 5-day main fund net change (JSON string). ### Response Example ```json { "f57": "300750", "f58": "宁德时代", "f127": "电池", "f43": 40201, "f44": 40211, "f45": 40191, "f169": 1150, "f170": 294, "f168": 80, "f47": 172379, "f48": 6844475287.47, "f116": 981915263793.24, "f117": 867212540040.63, "f162": 3195, "f135": 4381590720, "f136": 3941491264, "f137": 440099456, "f138": 4381590720, "f139": 4381590720, "f140": 4381590720, "f141": 4381590720, "f142": 4381590720, "f143": -4381590720, "f144": 4381590720, "f145": 4381590720, "f146": -4381590720, "f147": 624492672, "f148": 624492672, "f149": -624492672, "f178": "[\"{\\\"date\\\":\\\"2023-04-07\\\",\\\"mainNetAmt\\\":401068560.0}\\\",{\\\"date\\\":\\\"2023-04-06\\\",\\\"mainNetAmt\\\":-290600944.0}\\\",{\\\"date\\\":\\\"2023-04-04\\\",\\\"mainNetAmt\\\":-1146420016.0}\\\",{\\\"date\\\":\\\"2023-04-03\\\",\\\"mainNetAmt\\\":-1051367888.0}\\\",{\\\"date\\\":\\\"2023-03-31\\\",\\\"mainNetAmt\\\":163445664.0}\\\"]" } ``` ``` -------------------------------- ### GET /fundSuggestList Source: https://kouchao.github.io/TiantianFundApi/apis Retrieves a simplified list of all funds. ```APIDOC ## GET /fundSuggestList ### Description Retrieves a simplified list of all available funds. ### Method GET ### Endpoint /fundSuggestList ``` -------------------------------- ### GET /fundMNSubjectList Source: https://kouchao.github.io/TiantianFundApi/apis Retrieves a list of fund themes. ```APIDOC ## GET /fundMNSubjectList ### Description Retrieves a list of fund themes. ### Method GET ### Endpoint /fundMNSubjectList ``` -------------------------------- ### GET /stockDetails - Get Stock Transaction Details Source: https://kouchao.github.io/TiantianFundApi/apis Retrieves real-time transaction details for a given stock, including time, price, volume, and turnover. ```APIDOC ## GET /stockDetails ### Description Retrieves real-time transaction details for a given stock. ### Method GET ### Endpoint /stockDetails ### Parameters #### Query Parameters - **type** (integer) - Required - Market type (0: Other, 1: Shanghai, 2: Unknown, 116: Hong Kong, 105: US, 155: UK) - **code** (string) - Required - Stock code ### Response #### Success Response (200) - **code** (string) - Stock code. - **market** (integer) - Market identifier. - **decimal** (integer) - Number of decimal places for prices. - **prePrice** (number) - Previous price. - **details** (array) - Array of transaction details. - Each detail point is a string formatted as "time,price,volume,turnover". ### Response Example ```json { "code": "300750", "market": 0, "decimal": 2, "prePrice": 390.51, "details": [ "14:56:42,402.08,16,15,2" ] } ``` ``` -------------------------------- ### Get Fund Profile Source: https://kouchao.github.io/TiantianFundApi/apis Fetches a summary of a fund using its code. Requires the 'FCODE' parameter. ```json { "FCODE": "580007", "SHORTNAME": "东吴安享量化混合", "ABBTNAME": "DONGWUANXIANGLIANGHUAHUNHE", "P": "F", "T": "H", "F": "--", "FTYPE": "混合型-灵活", "BACKCODE": "--", "REALSGCODE": "--", "QDTCODE": "--", "LISTTEXCH": "--", "FEATURE": "215", "TSRQ": "--", "INDEXCODE": "--", "INDEXNAME": "--", "INDEXTEXCH": "--", "BFUNDTYPE": "002", "ESTABDATE": "2010-06-29", "ISPTP": "--" } ``` -------------------------------- ### GET /fundThemeFocusList Source: https://kouchao.github.io/TiantianFundApi/apis Retrieves focus information for fund themes. ```APIDOC ## GET /fundThemeFocusList ### Description Retrieves focus information for fund themes. ### Method GET ### Endpoint /fundThemeFocusList ### Parameters #### Query Parameters - **code** (string) - Optional - The code associated with the focus. (Source indicates this parameter's usage might be unclear). ``` -------------------------------- ### GET /fundMNStopWatch Source: https://kouchao.github.io/TiantianFundApi/apis Retrieves a brief profile for a specific fund. ```APIDOC ## GET /fundMNStopWatch ### Description Retrieves a brief profile for a specific fund. ### Method GET ### Endpoint /fundMNStopWatch ### Parameters #### Query Parameters - **FCODE** (string) - Required - The fund code. ### Response #### Success Response (200) - **FCODE** (string) - Fund code. - **SHORTNAME** (string) - Short name of the fund. - **ABBTNAME** (string) - Abbreviated name of the fund. - **P** (string) - Type indicator. - **T** (string) - Type indicator. - **F** (string) - Indicator. - **FTYPE** (string) - Fund type. - **BACKCODE** (string) - Back code. - **REALSGCODE** (string) - Real SG code. - **QDTCODE** (string) - QDT code. - **LISTTEXCH** (string) - Listing exchange. - **FEATURE** (string) - Fund features. - **TSRQ** (string) - TSRQ value. - **INDEXCODE** (string) - Index code. - **INDEXNAME** (string) - Index name. - **INDEXTEXCH** (string) - Index exchange. - **BFUNDTYPE** (string) - BFUND type. - **ESTABDATE** (string) - Establishment date. - **ISPTP** (string) - ISPTP indicator. ### Response Example ```json { "FCODE": "580007", "SHORTNAME": "东吴安享量化混合", "ABBTNAME": "DONGWUANXIANGLIANGHUAHUNHE", "P": "F", "T": "H", "F": "--", "FTYPE": "混合型-灵活", "BACKCODE": "--", "REALSGCODE": "--", "QDTCODE": "--", "LISTTEXCH": "--", "FEATURE": "215", "TSRQ": "--", "INDEXCODE": "--", "INDEXNAME": "--", "INDEXTEXCH": "--", "BFUNDTYPE": "002", "ESTABDATE": "2010-06-29", "ISPTP": "--" } ``` ``` -------------------------------- ### GET /fundCompanyBaseList Source: https://kouchao.github.io/TiantianFundApi/apis Retrieves a list of all fund companies. ```APIDOC ## GET /fundCompanyBaseList ### Description Retrieves a list of all fund companies. ### Method GET ### Endpoint /fundCompanyBaseList ``` -------------------------------- ### GET /fundMNRank - Get Fund Rankings Source: https://kouchao.github.io/TiantianFundApi/apis Retrieves a list of fund rankings based on various criteria. Supports filtering by fund type, sorting by performance metrics, and pagination. ```APIDOC ## GET /fundMNRank ### Description Retrieves a list of fund rankings with various filtering and sorting options. ### Method GET ### Endpoint `/fundMNRank` ### Parameters #### Query Parameters - **FundType** (string) - Optional - Specifies the type of fund. Accepted values: `0` (All), `25` (Stock), `27` (Hybrid), `26` (Index), `31` (Bond), `35` (Money Market), `6` (QDII), `3` (ETF), `33` (Connecting), `15` (FOF), `4` (LOF), `50` (Commodity), `32` (Fixed-term Bond), `2949` (Wealth Management). - **SortColumn** (string) - Optional - Specifies the column to sort by. Examples: `SYL_Z` (1-week return), `SYL_Y` (1-month return), `ENDNAV` (Scale), `HLDWJZ` (Net value), `RZDF` (Daily increase), `DWJZ` (Per ten thousand yield), `LJJZ` (7-day annualized), `CYCLE` (Lock-up period), `KFR` (Next open day), `PTDT_Y` (Regular investment 1-year), `SALESRANK_D` (Daily sales rank), `PVRANK_D` (Daily visit rank), `DTSALESRANK_Y` (Regular investment sales rank). - **Sort** (string) - Optional - Specifies the sort order. Accepted values: `desc` (Descending), `asc` (Ascending). - **pageIndex** (integer) - Optional - The page number, starting from 1. - **pageSize** (integer) - Optional - The number of items per page, maximum 30. - **CompanyId** (string) - Optional - The fund company ID (obtainable via `/fundCompanyBaseList`). - **CLTYPE** (string) - Optional - Filtering scheme, comma-separated (e.g., `022,006`). Accepted values: `0` (All), `022` (Golden Bull Award), `006` (Five-star rating), `042` (2020 Annual Return Ranking), `024` (2020 Annual Return Ranking), `029` (High Dividend), `038` (Quality Bonds), `021` (High Sharpe Ratio), `025` (Continuous Top Ranking), `030` (CSI 300 Index Enhancement), `031` (Ten-year Old Brand), `034` (Low Drawdown), `044` (Electronic Information Theme). - **ISABNORMAL** (boolean) - Optional - Whether to remove abnormal increases due to large redemptions. Accepted values: `true` (Yes), `false` (No). - **BUY** (boolean) - Optional - Open status. Accepted values: `true` (Available for purchase), `false` (All). - **DISCOUNT** (string) - Optional - Subscription fee rate, comma-separated (e.g., `0,1`). Accepted values: `0` (0% fee), `1` (10% discount). - **LevelOne** (string) - Optional - Stock type, comma-separated (e.g., `N050,050`). Accepted values: `N050` (Stock Type), `050` (Stock Index). - **ENDNAV** (string) - Optional - Fund scale in billions, comma-separated (e.g., `1,2`). Accepted values: `1` (<=2), `2` (2-10), `3` (10-50), `4` (50-100), `5` (>100). - **RLEVEL_SZ** (string) - Optional - Fund rating (Shanghai Securities), comma-separated (e.g., `5,4`). Accepted values: `5` (Five stars), `4` (Four stars), `3` (Three stars), `2` (Two stars), `1` (One star). - **ESTABDATE** (string) - Optional - Establishment age in years, comma-separated (e.g., `1,2`). Accepted values: `1` (<=1), `2` (1-2), `3` (2-3), `4` (3-4), `5` (4-5), `6` (>5). - **TOPICAL** (string) - Optional - Fund theme, comma-separated (e.g., `BK0735,BK0499`). Reference: `/fundMNSubjectList`. - **RISKLEVEL** (string) - Optional - Risk type, comma-separated (e.g., `1,2`). Accepted values: `1` (Low risk), `2` (Low-medium risk), `3` (Medium risk), `4` (Medium-high risk), `5` (High risk). - **DataConstraintType** (string) - Optional - Used for error handling, typically `0`. - **LevelTwo** (string) - Optional - Secondary level classification. ### Request Example ```json { "FundType": "25", "SortColumn": "SYL_JN", "Sort": "desc", "pageIndex": 1, "pageSize": 10 } ``` ### Response #### Success Response (200) - **fundList** (array) - List of funds. - **fundName** (string) - Name of the fund. - **fundCode** (string) - Code of the fund. - **fundType** (string) - Type of the fund. - **performance** (object) - Performance metrics. - **SYL_JN** (string) - Year-to-date return. - **SYL_1N** (string) - 1-year return. - **scale** (string) - Fund scale. - **manager** (string) - Fund manager. #### Response Example ```json { "fundList": [ { "fundName": "Example Fund A", "fundCode": "000001.OF", "fundType": "Stock", "performance": { "SYL_JN": "15.23%", "SYL_1N": "20.50%" }, "scale": "10.5B", "manager": "John Doe" } ] } ``` ``` -------------------------------- ### GET /fundMNHKRank - Get Hong Kong Fund Rankings Source: https://kouchao.github.io/TiantianFundApi/apis Retrieves a list of Hong Kong fund rankings. Supports filtering by fund type and sorting by various performance metrics. ```APIDOC ## GET /fundMNHKRank ### Description Retrieves a list of fund rankings for Hong Kong funds with various filtering and sorting options. ### Method GET ### Endpoint `/fundMNHKRank` ### Parameters #### Query Parameters - **FundType** (string) - Optional - Specifies the type of fund. Accepted values: `0` (All). - **SortColumn** (string) - Optional - Specifies the column to sort by. Examples: `NAV` (Net value), `JZCUNIT` (Currency), `NAVCHGRT` (Daily increase rate), `W` (1-week return), `M` (1-month return), `Q` (3-month return), `SY` (Year-to-date return), `Y` (1-year return), `TWY` (2-year return), `TRY` (3-year return), `SE` (Since inception return). - **Sort** (string) - Optional - Specifies the sort order. Accepted values: `desc` (Descending), `asc` (Ascending). - **pageIndex** (integer) - Optional - The page number, starting from 1. - **pageSize** (integer) - Optional - The number of items per page. - **CompanyId** (string) - Optional - The fund company ID (obtainable via `/fundCompanyBaseList`). - **CLTYPE** (string) - Optional - Filtering scheme, comma-separated (e.g., `022,006`). Accepted values: `0` (All), `022` (Golden Bull Award), `006` (Five-star rating), `042` (2020 Annual Return Ranking), `024` (2020 Annual Return Ranking), `029` (High Dividend), `038` (Quality Bonds), `021` (High Sharpe Ratio), `025` (Continuous Top Ranking), `030` (CSI 300 Index Enhancement), `031` (Ten-year Old Brand), `034` (Low Drawdown), `044` (Electronic Information Theme). - **ISABNORMAL** (boolean) - Optional - Whether to remove abnormal increases due to large redemptions. Accepted values: `true` (Yes), `false` (No). - **BUY** (boolean) - Optional - Open status. Accepted values: `true` (Available for purchase), `false` (All). - **DISCOUNT** (string) - Optional - Subscription fee rate, comma-separated (e.g., `0,1`). Accepted values: `0` (0% fee), `1` (10% discount). - **LevelOne** (string) - Optional - Stock type, comma-separated (e.g., `N050,050`). Accepted values: `N050` (Stock Type), `050` (Stock Index). - **ENDNAV** (string) - Optional - Fund scale in billions, comma-separated (e.g., `1,2`). Accepted values: `1` (<=2), `2` (2-10), `3` (10-50), `4` (50-100), `5` (>100). - **RLEVEL_SZ** (string) - Optional - Fund rating (Shanghai Securities), comma-separated (e.g., `5,4`). Accepted values: `5` (Five stars), `4` (Four stars), `3` (Three stars), `2` (Two stars), `1` (One star). - **ESTABDATE** (string) - Optional - Establishment age in years, comma-separated (e.g., `1,2`). Accepted values: `1` (<=1), `2` (1-2), `3` (2-3), `4` (3-4), `5` (4-5), `6` (>5). - **TOPICAL** (string) - Optional - Fund theme, comma-separated (e.g., `BK0735,BK0499`). Reference: `/fundMNSubjectList`. - **RISKLEVEL** (string) - Optional - Risk type, comma-separated (e.g., `1,2`). Accepted values: `1` (Low risk), `2` (Low-medium risk), `3` (Medium risk), `4` (Medium-high risk), `5` (High risk). - **DataConstraintType** (string) - Optional - Used for error handling, typically `0`. - **LevelTwo** (string) - Optional - Secondary level classification. ### Request Example ```json { "FundType": "0", "SortColumn": "NAVCHGRT", "Sort": "asc", "pageIndex": 1, "pageSize": 20 } ``` ### Response #### Success Response (200) - **fundList** (array) - List of funds. - **fundName** (string) - Name of the fund. - **fundCode** (string) - Code of the fund. - **fundType** (string) - Type of the fund. - **performance** (object) - Performance metrics. - **NAVCHGRT** (string) - Daily increase rate. - **W** (string) - 1-week return. - **currency** (string) - Fund currency. - **manager** (string) - Fund manager. #### Response Example ```json { "fundList": [ { "fundName": "Example HK Fund A", "fundCode": "HK000001.HK", "fundType": "Stock", "performance": { "NAVCHGRT": "0.50%", "W": "2.10%" }, "currency": "HKD", "manager": "Jane Smith" } ] } ``` ``` -------------------------------- ### GET /fundMNDetailInformation Source: https://kouchao.github.io/TiantianFundApi/apis Retrieves comprehensive details for a specific fund. ```APIDOC ## GET /fundMNDetailInformation ### Description Retrieves comprehensive details for a specific fund. ### Method GET ### Endpoint /fundMNDetailInformation ### Parameters #### Query Parameters - **FCODE** (string) - Required - The fund code. ### Response #### Success Response (200) - **Datas** (object) - Contains detailed fund information. - **FCODE** (string) - Fund code. - **FEATURE** (string) - Fund features. - **CYCLE** (string) - Cycle information. - **WEBBACKCODE** (string) - Web back code. - **SHORTNAME** (string) - Short name of the fund. - **FULLNAME** (string) - Full name of the fund. - **FTYPE** (string) - Fund type. - **ESTABDATE** (string) - Establishment date. - **ENDNAV** (string) - Latest net asset value. - **FEGMRQ** (string) - FEGMRQ date. - **RLEVEL_SZ** (string) - Latest rating (Shenzhen). - **RISKLEVEL** (string) - Risk level. - **JJGS** (string) - Fund management company. - **TGYH** (string) - Custodian bank. - **JJGSID** (string) - Fund management company ID. - **JJJL** (string) - Fund manager. - **NETNAV** (string) - Net asset value. - **BENCH** (string) - Benchmark index. - **INDEXCODE** (string) - Index code. - **INDEXNAME** (string) - Index name. - **PRSVPERIOD** (string) - Preservation period. - **PRSVDATE** (string) - Preservation date. - **PRSVTYPE** (string) - Preservation type. - **BUYTIME** (string) - Buy time. - **MGREXP** (string) - Management expense ratio. - **TRUSTEXP** (string) - Trust expense ratio. - **SALESEXP** (string) - Sales expense ratio. - **PERFCMP** (string) - Performance comparison benchmark. - **INVTGT** (string) - Investment objective. - **INVSTRA** (string) - Investment strategy. ### Response Example ```json { "Datas": { "FCODE": "003834", "FEATURE": "--", "CYCLE": "--", "WEBBACKCODE": "--", "SHORTNAME": "华夏能源革新股票A", "FULLNAME": "华夏能源革新股票型证券投资基金", "FTYPE": "股票型", "ESTABDATE": "2017-06-07", "ENDNAV": "18434368978.8", "FEGMRQ": "2022-03-31", "RLEVEL_SZ": "3", "RISKLEVEL": "5", "JJGS": "华夏基金", "TGYH": "建设银行", "JJGSID": "80000222", "JJJL": "郑泽鸿", "NETNAV": "1482233462.89", "BENCH": "中证内地新能源指数收益率*90%+上证国债指数收益率*10%", "INDEXCODE": "--", "INDEXNAME": "--", "PRSVPERIOD": "--", "PRSVDATE": "--", "PRSVTYPE": "--", "BUYTIME": "--", "MGREXP": "1.50%", "TRUSTEXP": "0.25%", "SALESEXP": "0.00%", "PERFCMP": "中证内地新能源指数收益率*90%+上证国债指数收益率*10%", "INVTGT": "通过精选能源革新的优质企业,在严格控制风险的前提下,力求实现基金资产的长期稳健增值。", "INVSTRA": "资产配置策略\r\n本基金通过对宏观经济环境、政策形势、证券市场走势的综合分析,主动判断市场时机,进行积极的资产配置,合理确定基金在股票、债券等各类资产类别上的投资比例,并随着各类资产风险收益特征的相对变化,适时进行动态调整。\n股票投资策略\r\n(1)能源革新主题的界定本基金投资的能源革新主题界定如下:①直接从事新能源产业相关的行业,包括新能源汽车、太阳能、光伏、风能、核能、水能、电力、页岩气、绿色照明、生物资源、天然气发电、地热、垃圾发电、氢能、锂电池、垃圾发电、储能、智能电网、节能环保等。投资标的涵盖新能源产业链的上中下游,包括上游资源类、中游材料类、以及下游运营类上市公司。\r\n②受益于能源革新主题的行业,包括:从传统行业向新能源行业逐步转型的公司;因与新能源主题相关的产业结构升级、消费生活模式转变而受益的其他上市公司。\r\n③新能源推广及其服务行业,包括:为新能源行业提供服务的大金融行业,已经或者计划采用新能源技术的电信设备通讯、电力及电力设备行业,以及为新能源产品销售提供支持的商业、贸易和物流行业等。\r\n鉴于科学技术发展和产业结构升级等因素,能源革新主题的范围可能会发生扩大或者变化,未来如果基金管理人认为有更适当的能源革新主题的界定方法,基金管理人有权对能源革新主题的界定方法进行变更,并在招募说明书更新中公告,不需召开持有人大会。\r\n(2)个股选择\r\n基金将采用定性和定量相结合的方式,精选能源革新主题下的优质个股进行重点投资。\r\n①定性分析主要从公司所在行业的发展特点及公司的行业地位、公司的核心竞争力、公司的经营能力和治理结构等方面进行分析。\r\n②定量分析主要从公司的盈利能力、增长能力、偿债能力、营运能力以及估值水平等方面进行分析。\r\n对于存托凭证投资,本基金将在深入研究的基础上,通过定性分析和定量分析相结合的方式,精选出具有比较优势的存托凭证。" } } ``` ``` -------------------------------- ### GET /fundThemeList Source: https://kouchao.github.io/TiantianFundApi/apis Retrieves a list of popular fund themes, sortable by various performance metrics. ```APIDOC ## GET /fundThemeList ### Description Retrieves a list of popular fund themes, sortable by various performance metrics. ### Method GET ### Endpoint /fundThemeList ### Parameters #### Query Parameters - **RankItems** (string) - Optional - Metric to rank themes by. Options: `ZDF` (Real-time Gain), `SYL_W` (Weekly Gain), `SYL_M` (Monthly Gain), `SYL_Q` (Quarterly Gain), `SYL_1N` (Yearly Gain), `SYL_JN` (Year-to-date Gain), `Cinflow` (Real-time Inflow), `Cinflow_W` (Weekly Inflow), `ZS_3` (3-minute Speed), `ZS_5` (5-minute Speed). - **RankVectors** (string) - Optional - Sorting order. Options: `desc` (Descending), `asc` (Ascending). - **category** (string) - Optional - Theme category. Options: `2` (All), `0` (Industry), `1` (Concept). ``` -------------------------------- ### GET /fundSearchInfoByName Source: https://kouchao.github.io/TiantianFundApi/apis Retrieves fund information by name with pagination and sorting options. ```APIDOC ## GET /fundSearchInfoByName ### Description Retrieves fund information by name, supporting pagination and sorting. ### Method GET ### Endpoint /fundSearchInfoByName ### Parameters #### Query Parameters - **key** (string) - Required - The keyword to search for (fund name). - **orderType** (string) - Optional - Sorting order. Default is `2`. Use `1` for sorting by popularity. - **pageindex** (integer) - Optional - The page number for pagination. - **pagesize** (integer) - Optional - The number of items per page. ### Request Example ``` /fundSearchInfoByName?key=华夏&orderType=1&pageindex=1&pagesize=10 ``` ### Response #### Success Response (200) - **totalCount** (integer) - The total number of matching funds. - **data** (array) - An array of fund objects. - **fcode** (string) - Fund code. - **showfcode** (string) - Display fund code. - **ftype** (string) - Fund type. - **shortname** (string) - Fund name. - **hightlight** (string) - Fund name with keyword highlighting. - **fcodetype** (integer) - Fund code type. - **secondfcodetype** (integer) - Second fund code type. - **abbname** (string) - Abbreviated fund name. - **abbtname** (string) - Abbreviated fund name in full. - **foreshortname** (string) - Foreshortened fund name. - **t** (string) - Type indicator. - **p** (string) - Type indicator. - **f** (string) - Type indicator. - **newtexch** (string) - New exchange information. #### Response Example ```json { "totalCount": 647, "data": [ { "fcode": "000075", "showfcode": "000075", "ftype": "QDII", "shortname": "华夏恒生ETF联接现汇", "hightlight": "000075_华夏恒生ETF联接现汇", "fcodetype": 0, "secondfcodetype": 0, "abbname": "HXHSETFLJXH", "abbtname": "HUAXIAHENGSHENGETFLIANJIEXIANHUI", "foreshortname": "华夏恒生ETF联接现汇", "t": "T", "p": "F", "f": "", "newtexch": "" } ] } ``` ``` -------------------------------- ### GET /fundMNMangerList Source: https://kouchao.github.io/TiantianFundApi/apis Retrieves a list of fund managers for a specific fund. ```APIDOC ## GET /fundMNMangerList ### Description Retrieves a list of fund managers for a specific fund. ### Method GET ### Endpoint /fundMNMangerList ### Parameters #### Query Parameters - **FCODE** (string) - Required - The fund code. ### Response #### Success Response (200) - **Datas** (array) - Array of fund manager objects. - **MGRID** (string) - List of fund manager IDs. - **MGRNAME** (string) - List of fund manager names. - **FCODE** (string) - Fund code. - **DAYS** (string) - Number of days managed. - **FEMPDATE** (string) - Management start date. - **LEMPDATE** (string) - Management end date. - **PENAVGROWTH** (string) - Average return during tenure. - **NEWPHOTOURL** (string) - URLs for fund manager photos. - **ISINOFFICE** (string) - Indicator if the manager is currently in office. ### Response Example ```json { "Datas": [ { "MGRID": "30040539,30675033,30725205", "MGRNAME": "周蔚文,罗佳明,刘伟伟", "FCODE": "004241", "DAYS": "158", "FEMPDATE": "2021-12-17", "LEMPDATE": "--", "PENAVGROWTH": "-26.0088", "NEWPHOTOURL": "https://pdf.dfcfw.com/pdf/H8_30040539_1.JPG,https://pdf.dfcfw.com/pdf/H8_30675033_1.JPG,https://pdf.dfcfw.com/pdf/H8_30725205_1.PNG", "ISINOFFICE": "1,1,1" } ] } ``` ``` -------------------------------- ### Use the API in Node.js Source: https://kouchao.github.io/TiantianFundApi/guide Demonstrates importing and calling the fundSearch function. ```javascript const { fundSearch } = require('tiantian-fund-api') async function main() { const res = await fundSearch({ m: '1', key: '11' }) } ``` -------------------------------- ### GET /stockKline - Get Stock K-Line Data Source: https://kouchao.github.io/TiantianFundApi/apis Retrieves K-line (candlestick) data for a specified stock, including various time intervals and date ranges. ```APIDOC ## GET /stockKline ### Description Retrieves K-line (candlestick) data for a specified stock. ### Method GET ### Endpoint /stockKline ### Parameters #### Query Parameters - **type** (integer) - Required - Market type (0: Other, 1: Shanghai, 2: Unknown, 116: Hong Kong, 105: US, 155: UK) - **code** (string) - Required - Stock code - **klt** (integer) - Required - K-line type (101: Daily, 102: Weekly, 103: Monthly, 1: 1-min, 5: 5-min, 15: 15-min, 30: 30-min, 60: 60-min) - **lmt** (integer) - Optional - Number of records per page - **fqt** (integer) - Optional - Page number - **end** (string) - Optional - End date (YYYYMMDD format) ### Response #### Success Response (200) - **code** (string) - Stock code. - **market** (integer) - Market identifier. - **name** (string) - Stock name. - **decimal** (integer) - Number of decimal places for prices. - **dktotal** (integer) - Total number of K-line data points. - **klines** (array) - Array of K-line data points. - Each kline point is a string formatted as "timestamp,open,high,low,close,volume,turnover". ### Response Example ```json { "code": "399001", "market": 0, "name": "深证成指", "decimal": 2, "dktotal": 7845, "klines": [ "2023-03-13 10:30,11405.14,11428.89,11511.12,11396.61,166613932,210718299984.00" ] } ``` ``` -------------------------------- ### Run the application in Docker Source: https://kouchao.github.io/TiantianFundApi/guide Deploys the API container mapping port 3000 to the host. ```bash docker run -d -p 3000:3000 kouchao/tiantian_fund_api ``` -------------------------------- ### GET stockTrends2 - Get Stock Trends Source: https://kouchao.github.io/TiantianFundApi/apis Retrieves historical trend data for a given stock, specified by its code and market type, over a defined number of days. ```APIDOC ## GET stockTrends2 ### Description Retrieves historical trend data for a given stock. ### Method GET ### Endpoint stockTrends2 ### Parameters #### Query Parameters - **type** (integer) - Required - Market type (0: Other, 1: Shanghai, 2: Unknown, 116: Hong Kong, 105: US, 155: UK) - **code** (string) - Required - Stock code - **ndays** (integer) - Required - Number of days for trend data (1: Intraday, 5: Five-day) ### Response #### Success Response (200) - **code** (string) - Stock code. - **market** (integer) - Market identifier. - **type** (integer) - Market type. - **status** (integer) - Status code. - **name** (string) - Stock name. - **decimal** (integer) - Number of decimal places for prices. - **preSettlement** (number) - Previous settlement price. - **preClose** (number) - Previous closing price. - **beticks** (string) - Tick data string. - **trendsTotal** (integer) - Total number of trend data points. - **time** (integer) - Timestamp of the data. - **kind** (integer) - Kind identifier. - **prePrice** (number) - Previous price. - **trends** (array) - Array of trend data points. - Each trend point is a string formatted as "timestamp,price,volume,turnover". ### Response Example ```json { "code": "399001", "market": 0, "type": 5, "status": 0, "name": "深证成指", "decimal": 2, "preSettlement": 0, "preClose": 11967.74, "beticks": "33300|34200|54000|34200|41400|46800|54000", "trendsTotal": 241, "time": 1681112058, "kind": 2, "prePrice": 11967.74, "trends": [ "2023-04-10 09:30,11987.68,5315278,11974.320" ] } ``` ```