### Start the application in Node.js Source: https://github.com/kouchao/tiantianfundapi/blob/main/docs/guide/README.md Execute the start script to run the API server locally. ```bash npm run start ``` -------------------------------- ### Install project dependencies Source: https://github.com/kouchao/tiantianfundapi/blob/main/docs/guide/README.md Run this command in the project root to install required dependencies. ```bash npm i ``` -------------------------------- ### Install dependencies Source: https://github.com/kouchao/tiantianfundapi/blob/main/README.md Installs project dependencies using pnpm. ```bash pnpm i ``` -------------------------------- ### Get Fund Suggest List API (JavaScript) Source: https://context7.com/kouchao/tiantianfundapi/llms.txt Fetches a brief list of all funds using the tiantian-fund-api library. Ensure the library is installed. ```javascript const { fundSuggestList } = require('tiantian-fund-api'); const result = await fundSuggestList(); ``` -------------------------------- ### Start the service Source: https://github.com/kouchao/tiantianfundapi/blob/main/README.md Launches the API service. ```bash pnpm start ``` -------------------------------- ### Get Fund Suggest List API Source: https://context7.com/kouchao/tiantianfundapi/llms.txt Fetches a brief list of all funds. Use this to get a general overview of available funds. ```bash curl "http://localhost:3000/fundSuggestList" ``` -------------------------------- ### Install the library as a dependency Source: https://github.com/kouchao/tiantianfundapi/blob/main/docs/guide/README.md Add the package to your project using npm. ```bash npm i tiantian-fund-api -S ``` -------------------------------- ### Run the application in Docker Source: https://github.com/kouchao/tiantianfundapi/blob/main/docs/guide/README.md Start the API container mapping port 3000 to the host. ```bash docker run -d -p 3000:3000 kouchao/tiantian_fund_api ``` -------------------------------- ### Get Stock Intraday Trends API (5 Days) Source: https://context7.com/kouchao/tiantianfundapi/llms.txt Retrieves intraday stock trend data for the last 5 days. Use ndays=5 to get data for the past five days. ```bash # 5日走势 curl "http://localhost:3000/stockTrends2?type=0&code=399001&ndays=5" ``` -------------------------------- ### Get Fund Brief Information Source: https://context7.com/kouchao/tiantianfundapi/llms.txt Retrieve basic fund metadata such as establishment date and type. ```bash curl "http://localhost:3000/fundMNStopWatch?FCODE=580007" ``` ```javascript const { fundMNStopWatch } = require('tiantian-fund-api'); const result = await fundMNStopWatch({ FCODE: '580007' }); // 返回: { FCODE: "580007", SHORTNAME: "东吴安享量化混合", FTYPE: "混合型-灵活", ESTABDATE: "2010-06-29" } ``` -------------------------------- ### Get Fund Details Source: https://context7.com/kouchao/tiantianfundapi/llms.txt Retrieve comprehensive details for a specific fund using its code. ```bash curl "http://localhost:3000/fundMNDetailInformation?FCODE=003834" ``` ```javascript const { fundMNDetailInformation } = require('tiantian-fund-api'); const result = await fundMNDetailInformation({ FCODE: '003834' }); // 返回: // { // "Datas": { // "FCODE": "003834", // "SHORTNAME": "华夏能源革新股票A", // "FULLNAME": "华夏能源革新股票型证券投资基金", // "FTYPE": "股票型", // "ESTABDATE": "2017-06-07", // "ENDNAV": "18434368978.8", // "JJGS": "华夏基金", // "JJJL": "郑泽鸿", // "INVTGT": "通过精选能源革新的优质企业...", // "INVSTRA": "资产配置策略..." // } // } ``` -------------------------------- ### GET /fundMNDetailInformation Source: https://github.com/kouchao/tiantianfundapi/blob/main/docs/apis/README.md 获取指定基金的详细信息,包括基金公司、经理、投资目标等。 ```APIDOC ## GET /fundMNDetailInformation ### Description 获取基金详细信息。 ### Method GET ### Endpoint /fundMNDetailInformation ### Parameters #### Query Parameters - **FCODE** (string) - Required - 基金代码 ### Response #### Success Response (200) - **Datas** (object) - 基金详情数据对象 #### Response Example { "Datas": { "FCODE": "003834", "SHORTNAME": "华夏能源革新股票A", "JJGS": "华夏基金", "JJJL": "郑泽鸿" } } ``` -------------------------------- ### Fund Search Results Source: https://github.com/kouchao/tiantianfundapi/blob/main/docs/apis/README.md Examples of JSON responses for different fund search categories. ```js [{ "_id": "110003", "CODE": "110003", "NAME": "易方达上证50增强A", "JP": "YFDSZ50ZQA", "CATEGORY": 700, "CATEGORYDESC": "基金", "STOCKMARKET": "", "BACKCODE": "", "MatchCount": 1, "FundBaseInfo": { "_id": "110003", "DWJZ": 2.0939, "FCODE": "110003", "FSRQ": "2021-08-30", "FTYPE": "指数型-股票", "FUNDTYPE": "001", "ISBUY": "1", "JJGS": "易方达基金", "JJGSBID": 4, "JJGSID": "80000229", "JJJL": "张胜记", "JJJLID": "30057450", "MINSG": 10, "NAVURL": "http://fund.eastmoney.com/ZS_jzzzl.html#os_0;isall_0;ft_;pt_5", "OTHERNAME": "易方达50指数,易方达上证50增强,易方达上证50指数,易方达上证50指数A,易基50,易基50增强A,易基50指数,易基50指数A", "SHORTNAME": "易方达上证50增强A" }, "StockHolder": "", "ZTJJInfo": [ { "TTYPE": "BK0438", "TTYPENAME": "食品饮料" } ] }] ``` ```js [{ "MgrId": "30728448", "MgrName": "徐维君", "AbbName": "XWJ", "JJGS": "方正富邦基金", "JJGSID": "80174741", "MatchCount": 2 }] ``` ```js [{ "JJGSID": "81052915", "JJGS": "安信证券资产", "JJGSJP": "", "GSJJBID": null, "QXJJ": [ { "_id": "970003", "FCODE": "970003", "SHORTNAME": "安信瑞鸿中短债A" } ] }] ``` ```js [{ "JJGSID": "80000031", "JJGS": "东吴证券", "JJGSJP": "DWZQ", "GSJJBID": "", "QXJJ": null }] ``` -------------------------------- ### Get Stock Profile Source: https://github.com/kouchao/tiantianfundapi/blob/main/docs/apis/README.md Retrieves comprehensive profile and market data for a specific stock. ```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}]", // 近5日主力增减持仓 } ``` -------------------------------- ### GET /fundSearchInfoByName Source: https://github.com/kouchao/tiantianfundapi/blob/main/docs/apis/README.md Search for funds by name with pagination and sorting options. ```APIDOC ## GET /fundSearchInfoByName ### Description Search for funds by name with pagination and sorting options. ### Method GET ### Endpoint /fundSearchInfoByName ### Parameters #### Query Parameters - **orderType** (integer) - Optional - Sorting: 2 (Default), 1 (By popularity) - **key** (string) - Required - Search keyword - **pageindex** (integer) - Required - Page number - **pagesize** (integer) - Required - Items per page ``` -------------------------------- ### GET /fundThemeList Source: https://context7.com/kouchao/tiantianfundapi/llms.txt Retrieves industry or concept themes and their performance rankings. ```APIDOC ## GET /fundThemeList ### Description Fetches a list of market themes sorted by specific performance metrics. ### Method GET ### Endpoint /fundThemeList ### Parameters #### Query Parameters - **RankItems** (string) - Required - Metric to rank by (e.g., SYL_M, ZDF, SYL_1N) - **RankVectors** (string) - Required - Sort order (desc/asc) - **category** (string) - Required - Category type (0=Industry, 1=Concept, 2=All) ``` -------------------------------- ### Fund Brief Information API Source: https://context7.com/kouchao/tiantianfundapi/llms.txt Get brief information about a fund, including its establishment date and type. ```APIDOC ## POST /fundMNStopWatch ### Description Retrieves brief information for a fund. ### Method GET ### Endpoint `/fundMNStopWatch` ### Parameters #### Query Parameters - **FCODE** (string) - Required - The fund code. ### Request Example ```bash curl "http://localhost:3000/fundMNStopWatch?FCODE=580007" ``` ### Response #### Success Response (200) - **FCODE** (string) - Fund code. - **SHORTNAME** (string) - Fund short name. - **FTYPE** (string) - Fund type. - **ESTABDATE** (string) - Establishment date. #### Response Example ```json { "FCODE": "580007", "SHORTNAME": "东吴安享量化混合", "FTYPE": "混合型-灵活", "ESTABDATE": "2010-06-29" } ``` ``` -------------------------------- ### GET /fundThemeList Source: https://github.com/kouchao/tiantianfundapi/blob/main/docs/apis/README.md Retrieve a list of popular fund themes based on performance or capital flow. ```APIDOC ## GET /fundThemeList ### Description Retrieve a list of popular fund themes based on performance or capital flow. ### Method GET ### Endpoint /fundThemeList ### Parameters #### Query Parameters - **RankItems** (string) - Required - ZDF (Real-time Gain), SYL_W (1 Week), SYL_M (1 Month), SYL_Q (3 Months), SYL_1N (1 Year), SYL_JN (Year to Date), Cinflow (Real-time Capital Flow), ZS_3 (3 min speed) - **RankVectors** (string) - Required - desc (Descending), asc (Ascending) - **category** (integer) - Required - 2 (All), 0 (Industry), 1 (Concept) ``` -------------------------------- ### Get Historical Net Values Source: https://context7.com/kouchao/tiantianfundapi/llms.txt Query historical net value data for a fund with pagination support. ```bash curl "http://localhost:3000/fundMNHisNetList?FCODE=003834&pageIndex=1&pagesize=30" ``` ```javascript const { fundMNHisNetList } = require('tiantian-fund-api'); const result = await fundMNHisNetList({ FCODE: '003834', pageIndex: '1', pagesize: '30' }); // 返回: // { // "Datas": [{ // "FSRQ": "2022-05-25", // 日期 // "DWJZ": "3.1140", // 单位净值 // "JZZZL": "0.61", // 日涨幅% // "LJJZ": "3.1140" // 累计净值 // }] // } ``` -------------------------------- ### Get Fund List by Letter Source: https://context7.com/kouchao/tiantianfundapi/llms.txt Retrieves a list of funds, with options to filter by fund type, sort column, sort order, and starting letter. Supports pagination. ```bash curl "http://localhost:3000/fundNetList?fundtype=25&SortColumn=RDZF&Sort=desc&Letter=a&pageIndex=1&pagesize=20" ``` ```javascript const { fundNetList } = require('tiantian-fund-api'); const result = await fundNetList({ fundtype: '25', // 0=全部, 25=股票, 27=混合, 35=货币 SortColumn: 'RDZF', // RDZF=日涨幅, DWJZ=最新净值 Sort: 'desc', Letter: 'a', // a-z 或不填为全部 pageIndex: '1', pagesize: '20' }); ``` -------------------------------- ### GET /fundMNHisNetList - Get Fund Historical Net Value Source: https://github.com/kouchao/tiantianfundapi/blob/main/docs/apis/README.md Retrieves a paginated list of historical net value data for a fund. ```APIDOC ## GET /fundMNHisNetList ### Description Retrieves a paginated list of historical net value data for a fund. ### Method GET ### Endpoint /fundMNHisNetList ### Parameters #### Query Parameters - **FCODE** (string) - Required - Fund code. - **pageIndex** (integer) - Required - Page number, starting from 1. - **pagesize** (integer) - Required - Number of items per page. ### Response #### Success Response (200) - **Datas** (array) - Array of historical net value data objects. - **FSRQ** (string) - Date of the record. - **DWJZ** (string) - Net asset value per unit. - **JZZZL** (string) - Daily percentage change. - **LJJZ** (string) - Cumulative net value. - **NAVTYPE** (string) - Net asset value type. - **RATE** (string) - Rate information. - **MUI** (string) - MUI information. - **SYI** (string) - SYI information. ### Response Example ```json { "Datas": [ { "FSRQ": "2022-05-25", "DWJZ": "3.1140", "JZZZL": "0.61", "LJJZ": "3.1140", "NAVTYPE": "1", "RATE": "--", "MUI": "--", "SYI": "--" } ] } ``` ``` -------------------------------- ### GET /fundVPageDiagram - Get Fund Net Value Source: https://github.com/kouchao/tiantianfundapi/blob/main/docs/apis/README.md Retrieves historical net value data for a fund, including daily changes. ```APIDOC ## GET /fundVPageDiagram ### Description Retrieves historical net value data for a fund, including daily changes. ### Method GET ### Endpoint /fundVPageDiagram ### Parameters #### Query Parameters - **FCODE** (string) - Required - Fund code. - **RANGE** (string) - Optional - The period for returns. Options include 'n' (annual, e.g., '3n' for 3 years), 'y' (monthly, e.g., '3y' for 3 months), 'jn' (recent years), 'ln' (since inception). - **POINTCOUNT** (integer) - Optional - Number of data points to retrieve (purpose is unknown, suggested value is 500). ### Response #### Success Response (200) - **Datas** (array) - Array of net value data objects. - **FSRQ** (string) - Date of the net value. - **DWJZ** (string) - Net asset value per unit. - **JZZZL** (string) - Daily percentage change. - **LJJZ** (string) - Cumulative net value. - **NAVTYPE** (string) - Net asset value type. - **RATE** (string) - Rate information (often '--'). ### Response Example ```json { "Datas": [ { "FSRQ": "2022-05-20", "DWJZ": "2.84", "JZZZL": "1.57", "LJJZ": "2.84", "NAVTYPE": "1", "RATE": "--" } ] } ``` ``` -------------------------------- ### GET /fundVPageAcc - Get Fund Cumulative Returns Source: https://github.com/kouchao/tiantianfundapi/blob/main/docs/apis/README.md Retrieves the cumulative returns of a fund over various periods, with options to compare against benchmarks. ```APIDOC ## GET /fundVPageAcc ### Description Retrieves the cumulative returns of a fund over various periods, with options to compare against benchmarks. ### Method GET ### Endpoint /fundVPageAcc ### Parameters #### Query Parameters - **FCODE** (string) - Required - Fund code. - **RANGE** (string) - Optional - The period for returns. Options include 'n' (annual, e.g., '3n' for 3 years), 'y' (monthly, e.g., '3y' for 3 months), 'jn' (recent years), 'ln' (since inception). - **INDEXCODE** (string) - Optional - Benchmark index code for comparison (e.g., '000001' for Shanghai Composite Index). ### Response #### Success Response (200) - **Datas** (array) - Array of return data objects. - **PDATE** (string) - Date of the data. - **YIELD** (string) - Yield for the specified period (e.g., last month). - **INDEXYIELD** (string) - Yield of the selected benchmark index. - **FUNDTYPEYIELD** (string) - Yield of funds in the same category. - **BENCHQUOTE** (null) - Performance benchmark value (currently null). ### Response Example ```json { "Datas": [ { "PDATE": "2022-05-25", "YIELD": "6.04", "INDEXYIELD": "4.41", "FUNDTYPEYIELD": "8.79", "BENCHQUOTE": null } ] } ``` ``` -------------------------------- ### Deployment and Integration Source: https://context7.com/kouchao/tiantianfundapi/llms.txt Information on how to deploy and integrate the Tiantian Fund API. ```APIDOC ## Deployment and Integration ### Description Information on how to deploy and integrate the Tiantian Fund API. ### Deployment Options - **Standalone Service**: Run directly using Node.js (`npm start`) or via Docker (`docker run -d -p 3000:3000 kouchao/tiantian_fund_api`). - **Serverless Architecture**: Use Vercel with the `action_name` parameter for routing. ### Integration as npm package Install `tiantian-fund-api` and call module functions directly. ### Use Cases - Building fund screening tools. - Investment portfolio analysis systems. - Quantitative strategy backtesting platforms. ### Typical Usage Patterns - Filter funds using ranking interfaces. - Conduct in-depth analysis with fund manager ratings. - Backtest returns using historical net value data. - Monitor holdings using stock interfaces. ### Data Format All interfaces return JSON data. ### Request Frequency Control request frequency to avoid overloading the data source. ``` -------------------------------- ### Run tests Source: https://github.com/kouchao/tiantianfundapi/blob/main/README.md Executes the project test suite. ```bash pnpm test ``` -------------------------------- ### GET /companyApi2?action=fundlist - Get Fund Company Fund List Source: https://github.com/kouchao/tiantianfundapi/blob/main/docs/apis/README.md Retrieves a paginated list of funds managed by a specific fund company, with filtering and sorting options. ```APIDOC ## GET /companyApi2?action=fundlist ### Description Retrieves a paginated list of funds managed by a specific fund company, with filtering and sorting options. ### Method GET ### Endpoint /companyApi2 ### Parameters #### Query Parameters - **cc** (string) - Required - Fund company ID. - **action** (string) - Required - Must be set to 'fundlist'. - **fundtype** (string) - Optional - Filter by fund type. Options: 'all', '1' (stock), '2' (hybrid), '3' (bond), '4' (wealth management), '5' (money market), '7' (QDLL), '8' (index). - **pi** (integer) - Optional - Page number. - **ps** (integer) - Optional - Number of items per page. - **sd** (string) - Optional - Sort order, 'desc' for descending. - **sf** (string) - Optional - Sort field. Options: 'SYL_Z' (weekly), 'SYL_3Z' (3 weeks), 'SYL_Y' (monthly), 'SYL_3Y' (3 months), 'SYL_1N' (1 year), 'SYL_JN' (year to date), 'SYL_LN' (since inception), 'LJJZ' (7-day annualized for types 4, 5), 'FTYI' (14-day), 'TEYI' (35-day). ### Response #### Success Response (200) - **code** (string) - API response code (e.g., '1' for success). - **data** (array) - Array of fund objects. - **FCODE** (string) - Fund code. - **FEATURE** (string) - Fund features codes. - **FUNDTYPE** (string) - Fund type code. - **FULLNAME** (string) - Full fund name. - **SHORTNAME** (string) - Fund short name. - **JJGSID** (string) - Fund company ID. - **DWJZ** (number) - Latest net asset value per unit. - **LJJZ** (number) - Latest cumulative net value (or sort field value). - **SYL_Z** (number) - Weekly return (%). - **SYL_Y** (number) - Monthly return (%). - **SYL_LN** (number) - Return since inception (%). - ... (other sortable fields like SYL_1N, SYL_JN, etc.) ### Response Example ```json { "code": "1", "data": [ { "FCODE": "015387", "FEATURE": "050,052,053,701", "FUNDTYPE": "001", "FULLNAME": "中欧沪深300指数增强型证券投资基金", "SHORTNAME": "中欧沪深300指数增强A", "JJGSID": "80065113", "DWJZ": 0.9741, "LJJZ": 0.9741, "FTYI": null, "TEYI": null, "TFYI": null, "SYL_D": null, "SYL_Z": 1.54, "SYL_Y": -2.43, "SYL_3Y": null, "SYL_6Y": null, "SYL_1N": null, "SYL_2N": null, "SYL_3N": null, "SYL_JN": null, "SYL_LN": -2.59 } ] } ``` ``` -------------------------------- ### GET /fundMNRank - Get Fund Rankings Source: https://github.com/kouchao/tiantianfundapi/blob/main/docs/apis/README.md Retrieves a list of fund rankings based on specified criteria. Supports extensive filtering and sorting options for various fund types. ```APIDOC ## GET /fundMNRank ### Description Retrieves a list of fund rankings based on specified criteria. Supports extensive filtering and sorting options for various fund types. ### Method GET ### Endpoint /fundMNRank ### Parameters #### Query Parameters - **FundType** (string) - Optional - Specifies the type of fund. Accepted values include '0' (All), '25' (Stock), '27' (Hybrid), '26' (Index), '31' (Bond), '35' (Currency), '6' (QDII), '3' (ETF), '33' (Interconnected), '15' (FOF), '4' (LOF), '50' (Commodity), '32' (Fixed-term Bond), '2949' (Wealth Management). - **SortColumn** (string) - Optional - Specifies the column to sort by. Examples include 'SYL_Z' (1-week return), 'SYL_Y' (1-month return), 'ENDNAV' (Scale), 'HLDWJZ' (Net value), 'RZDF' (Daily increase), 'DWJZ' (Ten thousand份收益), '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 ID of the fund company. - **CLTYPE** (string) - Optional - Filtering scheme, comma-separated. Examples: '0' (All), '022' (Golden Bull Award), '006' (Five-star rating), '042' (2020 Annual Return Ranking), '024' (2020 Annual Return Ranking), '029' (High dividend and bonus), '038' (High-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', 'false'. - **BUY** (boolean) - Optional - Open status. Accepted values: 'true' (Available for purchase), 'false' (All). - **DISCOUNT** (string) - Optional - Subscription fee rate, comma-separated. Examples: '0' (0% fee), '1' (10% discount). - **LevelOne** (string) - Optional - Stock type, comma-separated. Examples: 'N050' (Stock type), '050' (Stock index). - **ENDNAV** (string) - Optional - Fund scale in billions, comma-separated. Examples: '1' (<=2), '2' (2-10), '3' (10-50), '4' (50-100), '5' (>100). - **RLEVEL_SZ** (string) - Optional - Fund rating (Shanghai Securities rating), comma-separated. Examples: '5' (Five-star), '4' (Four-star), '3' (Three-star), '2' (Two-star), '1' (One-star). - **ESTABDATE** (string) - Optional - Establishment years, comma-separated. Examples: '1' (<=1), '2' (1-2), '3' (2-3), '4' (3-4), '5' (4-5), '6' (>5). - **TOPICAL** (string) - Optional - Fund theme, comma-separated. Reference: '/fundMNSubjectList'. - **RISKLEVEL** (string) - Optional - Risk type, comma-separated. Examples: '1' (Low risk), '2' (Medium-low risk), '3' (Medium risk), '4' (Medium-high risk), '5' (High risk). - **DataConstraintType** (string) - Optional - Used for error reporting, typically '0'. - **LevelTwo** (string) - Optional - Secondary level parameter, can be omitted. ### Response #### Success Response (200) - **data** (object) - Contains the fund ranking data. - **msg** (string) - Success message. - **code** (integer) - Response code, 0 for success. #### Response Example ```json { "data": { "list": [ { "fundName": "Example Fund", "fundCode": "000001", "nav": "1.5000", "increaseRate": "0.5%" } ], "total": 100 }, "msg": "Success", "code": 0 } ``` ``` -------------------------------- ### GET /companyApi2?action=fundcompanybaseinfo - Get Fund Company Basic Info Source: https://github.com/kouchao/tiantianfundapi/blob/main/docs/apis/README.md Retrieves basic information about a fund company, including its managed assets, number of funds, and fund manager count. ```APIDOC ## GET /companyApi2?action=fundcompanybaseinfo ### Description Retrieves basic information about a fund company, including its managed assets, number of funds, and fund manager count. ### Method GET ### Endpoint /companyApi2 ### Parameters #### Query Parameters - **cc** (string) - Required - Fund company ID. - **action** (string) - Required - Must be set to 'fundcompanybaseinfo'. ### Response #### Success Response (200) - **code** (string) - API response code (e.g., '1' for success). - **data** (object) - Fund company data. - **GLGM** (string) - Assets under management. - **Count** (string) - Total number of funds managed. - **FDMC** (string) - Fund company name. - **GSJJBName** (string) - Fund company's forum name on Tiantian Fund. - **ManagerCount** (string) - Number of fund managers. - **fundmaxsyl** (number) - Highest weekly return among its funds (%). - **NewFundList** (array) - List of newly issued funds. - **TypeName** (string) - Type of new fund. - **TypeCount** (string) - Number of new funds of this type. - **Filds** (string) - Fields available for new funds. - **fundlist** (array) - Details of individual new funds. - **FCODE** (string) - Fund code. - **FULLNAME** (string) - Full fund name. - **SHORTNAME** (string) - Fund short name. - **ISSBDATE** (string) - Subscription start date. - **ISSEDATE** (string) - Subscription end date. - **FUNDTYPE** (string) - Fund type code. - **MINSG** (string) - Minimum investment amount. - **FSRQ** (string) - Data date. - **DWJZ** (string) - Latest net asset value per unit. - **RZDF** (string) - Daily return rate. - **LJJZ** (string) - 7-day annualized yield. - **FTYPE** (string) - Fund category. - **ISBUY** (string) - Whether the fund is available for purchase. - **CompanyTopic** (object) - Related topics and their performance. - **MaxSYL** (number) - Maximum return among topics. - **MinSYL** (number) - Minimum return among topics. - **AvgSYL** (number) - Average return among topics. - **List** (array) - List of topics. - **TTYPENAME** (string) - Topic name. - **HY** (string) - Yearly return. - **Y** (string) - Annual return. - **TWY** (string) - Two-year return. - **TRY** (string) - Three-year return. - **FY** (string) - Five-year return. - **SY** (string) - Six-year return. ### Response Example ```json { "code": "1", "data": { "GLGM": "5161.31亿元", "Count": "245", "FDMC": "中欧基金管理有限公司", "GSJJBName": "中欧基金吧", "ManagerCount": "39", "fundmaxsyl": 9.37, "NewFundList": [ { "TypeName": "新发基金", "TypeCount": "2", "Filds": "基金名称,最新净值,日涨幅", "fundlist": [ { "FCODE": "014474", "FULLNAME": "中欧安悦一年定期开放债券型发起式证券投资基金", "SHORTNAME": "中欧安悦一年定开债券发起", "ISSBDATE": "2022-05-20 00:00:00", "ISSEDATE": "2022-08-19 15:00:00", "FUNDTYPE": "008", "MINSG": "10.0", "FSRQ": "2022-05-23", "DWJZ": "1.9845", "RZDF": "0.68", "LJJZ": "2.161", "FTYPE": "债券型-长债", "ISBUY": "" } ] } ], "CompanyTopic": { "MaxSYL": 38.7802, "MinSYL": -14.9017, "AvgSYL": -4.5434, "List": [ { "JJGSID": "80065113", "TTYPE": "97c97c61c8537bec", "TTYPENAME": "昨日触板", "PDATE": "2020-10-09", "D": "3.0825", "W": "3.0825", "M": "6.0612", "Q": "2.7567", "HY": "38.7802", "Y": "64.2868", "TWY": "112.1482", "TRY": "80.0929", "FY": "99.6487", "SY": "48.1734" } ] } } } ``` ``` -------------------------------- ### Get Stock K-line Data API (5-Minute) Source: https://context7.com/kouchao/tiantianfundapi/llms.txt Retrieves 5-minute interval K-line data for a stock. Use klt=5 for 5-minute intervals and set the limit. ```bash # 5分钟K线 curl "http://localhost:3000/stockKline?type=0&code=300750&klt=5&lmt=200&fqt=1&end=20230410" ``` -------------------------------- ### GET /fundVarietieValuationDetail - Get Real-time Fund Net Value Estimation Source: https://github.com/kouchao/tiantianfundapi/blob/main/docs/apis/README.md Retrieves real-time estimated net value for a fund. Note: Official restrictions may apply to non-index funds. ```APIDOC ## GET /fundVarietieValuationDetail ### Description Retrieves real-time estimated net value for a fund. Note: Official restrictions may apply to non-index funds. ### Method GET ### Endpoint /fundVarietieValuationDetail ### Parameters #### Query Parameters - **FCODE** (string) - Required - Fund code. ### Response #### Success Response (200) - **Datas** (array) - Array of estimated return strings (format: 'index, time, estimated return'). - **Expansion** (object) - Extended information about the fund's valuation. - **FCODE** (string) - Fund code. - **SHORTNAME** (string) - Fund short name. - **GZTIME** (string) - Valuation time. - **GZ** (string) - Estimated valuation. - **GSZZL** (string) - Estimated daily growth rate. - **GZZF** (string) - Estimated daily change. - **SGZT** (string) - Subscription status. - **SHZT** (string) - Redemption status. - **SOURCERATE** (string) - Original fee rate. - **rate** (string) - Discounted fee rate. - **DTZT** (string) - Other status. - **ISBUY** (string) - Whether it is buyable. - **JZRQ** (string) - Valuation date. - **DWJZ** (string) - Net asset value per unit. - **BUY** (boolean) - Indicates if buying is allowed. - **Market** (string) - Market identifier. ### Response Example ```json { "Datas": [ "1,09:30,0.1284" ], "Expansion": { "FCODE": "003834", "SHORTNAME": "华夏能源革新股票A", "GZTIME": "2022-05-25 15:00", "GZ": "3.1140", "GSZZL": "0.61", "GZZF": "0.0190", "SGZT": "限大额", "SHZT": "开放赎回", "SOURCERATE": "1.50%", "rate": "0.15%", "DTZT": "1", "ISBUY": "1", "JZRQ": "2022-05-24", "DWJZ": "3.0950", "BUY": true, "Market": "CN" } } ``` ``` -------------------------------- ### Use the fund search API in Node.js Source: https://github.com/kouchao/tiantianfundapi/blob/main/docs/guide/README.md Import the fundSearch function and call it with the required parameters. ```javascript const { fundSearch } = require('tiantian-fund-api') async function main() { const res = await fundSearch({ m: '1', key: '11' }) } ``` -------------------------------- ### Search Funds by Name Source: https://context7.com/kouchao/tiantianfundapi/llms.txt Query funds by name with support for pagination and sorting parameters. ```bash # 按名称搜索基金,支持分页 curl "http://localhost:3000/fundSearchInfoByName?key=华夏&orderType=1&pageindex=1&pagesize=20" ``` ```javascript const { fundSearchInfoByName } = require('tiantian-fund-api'); const result = await fundSearchInfoByName({ key: '华夏', orderType: '1', // 1=按热度, 2=默认 pageindex: '1', pagesize: '10' }); // 返回: { totalCount: 647, data: [{ fcode: "000075", shortname: "华夏恒生ETF联接现汇", ... }] } ``` -------------------------------- ### GET /fundMNPeriodIncrease Source: https://github.com/kouchao/tiantianfundapi/blob/main/docs/apis/README.md 获取基金在特定周期内的涨幅数据。 ```APIDOC ## GET /fundMNPeriodIncrease ### Description 获取基金阶段涨幅。 ### Method GET ### Endpoint /fundMNPeriodIncrease ### Parameters #### Query Parameters - **FCODE** (string) - Required - 基金代码 - **RANGE** (string) - Optional - 范围:'n'年度, 'y'月度 ### Response #### Success Response (200) - **Datas** (array) - 涨幅数据列表 #### Response Example { "Datas": [{ "title": "2021年度", "syl": "43.7292" }] } ``` -------------------------------- ### GET /bigDataList Source: https://github.com/kouchao/tiantianfundapi/blob/main/docs/apis/README.md 获取大数据榜单列表,支持按分类筛选。 ```APIDOC ## GET /bigDataList ### Description 获取大数据榜单列表。 ### Method GET ### Endpoint /bigDataList ### Parameters #### Query Parameters - **ClCategory** (string) - Required - 榜单分类:0(全部), 1(独家), 2(策略), 3(主题) ### Response #### Success Response (200) - **ClType** (string) - 榜单类型ID - **Title** (string) - 榜单标题 - **FundName** (string) - 基金名称 #### Response Example [{ "ClType": "001", "Title": "大家都在买", "FundName": "招商中证白酒指数(LOF)A" }] ``` -------------------------------- ### Get Stock Details API (US Stocks) Source: https://context7.com/kouchao/tiantianfundapi/llms.txt Retrieves real-time stock market data for US stocks. Use type=105 for US stocks. ```bash # 美股 (type=105) curl "http://localhost:3000/stockGet?type=105&code=AAPL" ``` -------------------------------- ### Get Stock K-line Data API (Daily) Source: https://context7.com/kouchao/tiantianfundapi/llms.txt Retrieves daily K-line data for a stock. Use klt=101 for daily, and specify the end date. ```bash # 日K线 curl "http://localhost:3000/stockKline?type=0&code=300750&klt=101&lmt=100&fqt=1&end=20230410" ```