Maintainers
Pricing
Enterprise
More
More
Documentation
Try Live
Rankings
Install
Blog
Docs7
Ask
New
Add Docs
智兔数服金融数据API
https://www.zhituapi.com
Admin
智兔数服金融数据API为全球用户提供实时、准确、全面、专业的金融数据API接口服务,涵盖沪深A股、沪深指数、京市A股、港股主板、科创行情及基金行情等多种金融产品。
Tokens:
77,889
Snippets:
272
Trust Score:
4.9
Update:
9 months ago
Context
Chat
Benchmark
Latest
Show doc for...
Code
Info
Show Results
Tokens:
Raw
Copy
Link
Tokens:
Raw
Copy
Link
### GET /hs/pool/qsgc/交易日期 Source: https://www.zhituapi.com/hsstockapi Retrieves a list of strong stocks for a given trading date, sorted by gain percentage in descending order. The date should be in 'yyyy-MM-dd' format, starting from 2019-11-28. ```APIDOC ## GET /hs/pool/qsgc/交易日期 ### Description Retrieves a list of strong stocks for a given trading date, sorted by gain percentage in descending order. The date should be in 'yyyy-MM-dd' format, starting from 2019-11-28. ### Method GET ### Endpoint https://api.zhituapi.com/hs/pool/qsgc/交易日期?token=token证书 ### Parameters #### Query Parameters - **交易日期** (string) - Required - The trading date in 'yyyy-MM-dd' format. - **token** (string) - Required - Your authentication token. ### Request Example ```json { "example": "https://api.zhituapi.com/hs/pool/qsgc/2023-10-26?token=YOUR_TOKEN_HERE" } ``` ### Response #### Success Response (200) - **dm** (string) - Stock code. - **mc** (string) - Stock name. - **p** (number) - Price (Yuan). - **ztp** (number) - Limit-up price (Yuan). - **zf** (number) - Gain percentage (%). - **cje** (number) - Turnover (Yuan). - **lt** (number) - Circulating market cap (Yuan). - **zsz** (number) - Total market cap (Yuan). - **zs** (number) - Speed of gain (%). - **nh** (number) - New high (0: No, 1: Yes). - **lb** (number) - Volume ratio. - **hs** (number) - Turnover rate (%). - **tj** (string) - Limit-up statistics (x days/y boards). #### Response Example ```json [ { "dm": "sh603333", "mc": "尚纬股份", "p": 6.67, "ztp": 6.67, "zf": 10.07, "cje": 790927376.0, "lt": 4145588998.62, "zsz": 4145588985.28, "zs": 0.0, "nh": 0, "lb": 1.22, "hs": 20.47, "tj": "9/6" }, { "dm": "sz002641", "mc": "公元股份", "p": 5.91, "ztp": 5.91, "zf": 10.06, "cje": 349813616.0, "lt": 6704161267.59, "zsz": 7263944783.52, "zs": 0.0, "nh": 1, "lb": 4.19, "hs": 5.43, "tj": "2/2" } ] ``` ``` -------------------------------- ### Get Stock Listed Indices API Python Example Source: https://www.zhituapi.com/hsstockapi This snippet demonstrates how to fetch the listed indices for a given stock code using the Zhituapi. It utilizes the `requests` library in Python to make a GET request to the specified API endpoint. The response is expected in JSON format. ```Python import requests url = "https://api.zhituapi.com/hs/gs/sszs/股票代码?token=token证书" response = requests.get(url) data = response.json() print(data) ``` -------------------------------- ### GET /tech/list/all Source: https://www.zhituapi.com/kcdataapi 获取基础的科创股票代码和名称列表,用于后续接口参数传入。 ```APIDOC ## GET /tech/list/all ### Description 获取基础的股票代码和名称,用于后续接口的参数传入。 ### Method GET ### Endpoint https://api.zhituapi.com/tech/list/all ### Query Parameters - **token** (string) - Required - 认证证书 ### Response #### Success Response (200) - **dm** (string) - 股票代码,如:688001.SH - **mc** (string) - 股票名称,如:华兴源创 - **jys** (string) - 交易所 #### Response Example ```json [ { "dm":"688411", "mc":"N海博", "jys":"sh" }, { "dm":"001395", "mc":"N亚联", "jys":"sz" }, { "dm":"300766", "mc":"每日互动", "jys":"sz" }, { "dm":"301248", "mc":"杰创智能", "jys":"sz" }, { "dm":"301299", "mc":"卓创资讯", "jys":"sz" }, { "dm":"300229", "mc":"拓尔思", "jys":"sz" }, { "dm":"300996", "mc":"普联软件", "jys":"sz" }, { "dm":"300697", "mc":"电工合金", "jys":"sz" } ] ``` ``` -------------------------------- ### Fetch Stock Balance Sheet Data with Python Source: https://www.zhituapi.com/hsstockapi This Python snippet demonstrates how to fetch balance sheet data using the `requests` library. It makes a GET request to the Zhituapi balance sheet endpoint with placeholder parameters for stock code, token, start time, and end time. The response is then parsed as JSON. ```python import requests url = "https://api.zhituapi.com/hs/fin/balance/股票代码(如000001.SZ)?token=token证书&st=开始时间&et=结束时间" response = requests.get(url) data = response.json() print(data) ``` -------------------------------- ### GET /hz/list/hszs Source: https://www.zhituapi.com/hsindexapi 获取沪深两市主要的指数代码和名称,用于后续接口的参数传入。 ```APIDOC ## 沪深主要指数列表接口 ### Description 获取沪深两市主要的指数代码和名称,用于后续接口的参数传入。 ### Method GET ### Endpoint http://api.zhituapi.com/hz/list/hszs ### Query Parameters - **token** (string) - Required - 认证令牌 ### Response #### Success Response (200) - **dm** (string) - 指数代码,如:000001.SH - **mc** (string) - 指数名称,如:上证指数 - **jys** (string) - 交易所,"sh"表示上证,"sz"表示深证 ### Request Example ```python import requests url = "http://api.zhituapi.com/hz/list/hszs?token=token证书" response = requests.get(url) data = response.json() print(data) ``` ### Response Example ```json { "data": [ { "dm": "000001.SH", "mc": "上证指数", "jys": "sh" } // ... more indices ] } ``` ``` -------------------------------- ### GET /hz/real/ssjy/{indexCode} Source: https://www.zhituapi.com/hsindexapi 根据指数代码获取实时交易数据,即当日的最新数据。 ```APIDOC ## 实时交易数据 ### Description 根据《指数列表》得到的股票代码获取实时交易数据(您可以理解为日线的最新数据)。 ### Method GET ### Endpoint https://api.zhituapi.com/hz/real/ssjy/{indexCode} ### Path Parameters - **indexCode** (string) - Required - 指数代码,例如:000001.SH ### Query Parameters - **token** (string) - Required - 认证令牌 ### Response #### Success Response (200) - **p** (number) - 最新价 - **o** (number) - 开盘价 - **h** (number) - 最高价 - **l** (number) - 最低价 - **yc** (number) - 前收盘价 - **cje** (number) - 成交总额 - **v** (number) - 成交总量 - **pv** (number) - 原始成交总量 - **ud** (float) - 涨跌额 - **pc** (float) - 涨跌幅 - **zf** (float) - 振幅 - **t** (string) - 更新时间 ### Request Example ```python import requests index_code = "000001.SH" # Example index code url = f"https://api.zhituapi.com/hz/real/ssjy/{index_code}?token=token证书" response = requests.get(url) data = response.json() print(data) ``` ### Response Example ```json { "p": 3000.50, "o": 2990.00, "h": 3010.00, "l": 2985.00, "yc": 2995.00, "cje": 1500000000, "v": 300000000, "pv": 300000000, "ud": 5.50, "pc": 0.18, "zf": 1.20, "t": "2024-06-15 15:00:00" } ``` ``` -------------------------------- ### GET /hz/latest/fsjy/{indexCode.market}/{timeframe} Source: https://www.zhituapi.com/hsindexapi 根据指数代码和分时级别获取最新的交易数据。 ```APIDOC ## 最新分时交易 ### Description 根据《指数列表》得到的指数代码和分时级别获取最新交易数据,交易时间升序。目前分时级别支持5分钟、15分钟、30分钟、60分钟、日线、周线、月线、年线,对应的请求参数分别为5、15、30、60、d、w、m、y。 ### Method GET ### Endpoint https://api.zhituapi.com/hz/latest/fsjy/{indexCode.market}/{timeframe} ### Path Parameters - **indexCode.market** (string) - Required - 指数代码.市场,例如:000001.SH - **timeframe** (string) - Required - 分时级别,支持:5, 15, 30, 60, d (日线), w (周线), m (月线), y (年线) ### Query Parameters - **token** (string) - Required - 认证令牌 - **limit** (integer) - Optional - 最新条数,例如:2 ### Response #### Success Response (200) - **t** (string) - 交易时间 - **o** (float) - 开盘价 - **h** (float) - 最高价 - **l** (float) - 最低价 - **c** (float) - 收盘价 - **v** (float) - 成交量 - **a** (float) - 成交额 - **pc** (float) - 前收盘价 ### Request Example ```python import requests index_code_market = "000001.SH" # Example index code.market timeframe = "d" # Example timeframe (daily) limit = 2 # Example limit url = f"https://api.zhituapi.com/hz/latest/fsjy/{index_code_market}/{timeframe}?token=token证书&limit={limit}" response = requests.get(url) data = response.json() print(data) ``` ### Response Example ```json [ { "t": "2024-06-15 09:30:00", "o": 2990.00, "h": 2995.00, "l": 2988.00, "c": 2992.00, "v": 100000000, "a": 500000000, "pc": 2995.00 } // ... more data points ] ``` ``` -------------------------------- ### GET /hs/fin/balance/{stock_code} Source: https://www.zhituapi.com/hsstockapi Fetches the balance sheet for a specified stock code. You can include start and end dates to filter the results. The stock code should be in the format like '000001.SZ'. Dates are in 'YYYYMMDD' format. If start and end times are omitted, all data is returned. ```APIDOC ## GET /hs/fin/balance/{stock_code} ### Description Retrieves the balance sheet data for a given stock code. Supports filtering by start and end dates. ### Method GET ### Endpoint `/hs/fin/balance/{stock_code}` ### Parameters #### Path Parameters - **stock_code** (string) - Required - The stock code, e.g., '000001.SZ'. #### Query Parameters - **token** (string) - Required - Your authentication token. - **st** (string) - Optional - The start date in 'YYYYMMDD' format. - **et** (string) - Optional - The end date in 'YYYYMMDD' format. ### Request Example ```python import requests stock_code = "000001.SZ" token = "YOUR_TOKEN" start_date = "20230101" end_date = "20231231" url = f"https://api.zhituapi.com/hs/fin/balance/{stock_code}?token={token}&st={start_date}&et={end_date}" response = requests.get(url) data = response.json() print(data) ``` ### Response #### Success Response (200) - **jzrq** (string) - Closing date - **plrq** (string) - Disclosure date - **nbysk** (float) - Internal accounts receivable - **gdzcql** (float) - Fixed assets in liquidation - **yffbzk** (float) - Reinsurance payables - **jsbfj** (float) - Settlement reserve - **ysbf** (float) - Premiums receivable - **ysfbzk** (float) - Reinsurance receivables - **ysfbhtzbj** (float) - Reinsurance contract reserves receivable - **ysgl** (float) - Dividends receivable - **ysckts** (float) - Export tax refund receivable - **ysbtk** (float) - Subsidy receivable - **ysbzj** (float) - Margin receivable - **dfy** (float) - Deferred expenses - **dclldzcsy** (float) - Deferred current assets profit and loss - **ynndqdfldzc** (float) - Non-current assets due within one year - **cqysk** (float) - Long-term receivables - **qtcqtz** (float) - Other long-term investments - **gdzcyz** (float) - Original value of fixed assets - **gdzcjz** (float) - Net value of fixed assets - **gdzcjzzbj** (float) - Impairment provision for fixed assets - **scxswzc** (float) - Productive biological assets - **gyxswzc** (float) - Non-public welfare biological assets - **yqzc** (float) - Oil and gas assets - **kfzc** (float) - Development expenditure - **gqfzltq** (float) - Equity-based circulation rights - **qtfldzc** (float) - Other non-current assets - **yfsxfyj** (float) - Fees and commissions payable - **qtjyk** (float) - Other payables - **yfbzj** (float) - Margin payable - **nbyfk** (float) - Internal accounts payable - **ytfy** (float) - Accrued expenses - **bxhtzbj** (float) - Insurance contract reserves - **dlmmzqk** (float) - Securities for agency trading - **dlcxzqk** (float) - Securities for agency underwriting - **gjpjjs** (float) - International bill settlement - **gnpjjs** (float) - Domestic bill settlement - **dysr** (float) - Deferred income - **yfdqzq** (float) - Short-term bonds payable - **cqdysr** (float) - Long-term deferred income - **wqddtzss** (float) - Undetermined investment losses - **nfpxjgl** (float) - Proposed cash dividends - **yjfz** (float) - Provisions for liabilities - **xsckjtycf** (float) - Deposits from customers and interbank placements - **yjldfz** (float) - Provisions for current liabilities - **j_kcg** (float) - Less: Treasury stock - **hbzj** (float) - Monetary funds - **cczj** (float) - Funds lent out - **jyxjrzc** (float) - Financial assets for trading - **ysjrzc** (float) - Derivative financial assets - **yspj** (float) - Notes receivable - **yszk** (float) - Accounts receivable - **yfkx** (float) - Prepayments - **yslx** (float) - Interest receivable - **qtysk** (float) - Other receivables - **mrfsjrzck** (float) - Purchased financial assets with resale agreement - **gyjzjzbdqjsrdq** (float) - Financial assets measured at fair value whose changes are included in current gains and losses - **ch** (float) - Inventory - **qtldzc** (float) - Other current assets - **ldzchj** (float) - Total current assets - **ffdkjjd** (float) - Loans and advances to customers - **kkgsjrzc** (float) - Available-for-sale financial assets - **cyzdqtz** (float) - Held-to-maturity investments - **cqgqtz** (float) - Long-term equity investments - **tzxfd** (float) - Investment properties - **ljzj** (float) - Accumulated depreciation - **gdzc** (float) - Fixed assets - **zjgc** (float) - Construction in progress - **gcwz** (float) - Construction materials - **cqfz** (float) - Long-term liabilities - **wxzc** (float) - Intangible assets - **sy** (float) - Goodwill - **cqdtfy** (float) - Long-term deferred expenses - **dysdszc** (float) - Deferred income tax assets - **fldzchj** (float) - Total non-current assets - **zczj** (float) - Total assets - **dqjk** (float) - Short-term borrowings - **xzyhyhk** (float) - Borrowings from central bank - **crzj** (float) - Funds borrowed - **jyxjrfz** (float) - Financial liabilities for trading - **ysjrfz** (float) - Derivative financial liabilities - **yfpj** (float) - Notes payable - **yfzk** (float) - Accounts payable - **ysk** (float) - Advance receipts - **mchgjrzck** (float) - Sold financial assets with repurchase agreement - **yfgzxc** (float) - Employee benefits payable - **yjsf** (float) - Taxes and dues payable - **yflx** (float) - Interest payable - **yfgl** (float) - Dividends payable - **qtfzk** (float) - Other accounts payable - **ynndqdfldfz** (float) - Non-current liabilities due within one year - **qtldfz** (float) - Other current liabilities - **ldfzhj** (float) - Total current liabilities - **cqjk** (float) - Long-term borrowings - **yfzq** (float) - Bonds payable - **cqyfk** (float) - Long-term payables - **zxyfk** (float) - Special payables - **dysdsfz** (float) - Deferred income tax liabilities - **qtfldfz** (float) - Other non-current liabilities - **fldfzhj** (float) - Total non-current liabilities - **fzhj** (float) - Total liabilities - **sszb** (float) - Paid-in capital (or share capital) - **zbgj** (float) - Capital reserve - **zxzb** (float) - Special reserve - **ylgj** (float) - Surplus reserve - **ybfxzb** (float) - General risk reserve - **wfplr** (float) - Undistributed profits - **wbbzbzhc** (float) - Foreign currency statement translation difference - **gsmgdqsyhj** (float) - Equity attributable to parent company shareholders - **ssgdqy** (float) - Minority interests - **syzqyhj** (float) - Total owners' equity - **fzhgdqyzj** (float) - Total liabilities and owners' equity #### Response Example ```json { "data": [ { "jzrq": "20231231", "plrq": "20240101", "nbysk": 100000.00, "gdzcql": 0.00, "yffbzk": 50000.00, "jsbfj": 20000.00, "ysbf": 15000.00, "ysfbzk": 8000.00, "ysfbhtzbj": 2000.00, "ysgl": 1000.00, "ysckts": 500.00, "ysbtk": 700.00, "ysbzj": 3000.00, "dfy": 10000.00, "dclldzcsy": 0.00, "ynndqdfldzc": 50000.00, "cqysk": 25000.00, "qtcqtz": 30000.00, "gdzcyz": 1000000.00, "gdzcjz": 750000.00, "gdzcjzzbj": 25000.00, "scxswzc": 0.00, "gyxswzc": 0.00, "yqzc": 0.00, "kfzc": 15000.00, "gqfzltq": 0.00, "qtfldzc": 20000.00, "yfsxfyj": 6000.00, "qtjyk": 4000.00, "yfbzj": 9000.00, "nbyfk": 30000.00, "ytfy": 12000.00, "bxhtzbj": 60000.00, "dlmmzqk": 0.00, "dlcxzqk": 0.00, "gjpjjs": 0.00, "gnpjjs": 0.00, "dysr": 8000.00, "yfdqzq": 10000.00, "cqdysr": 0.00, "wqddtzss": 0.00, "nfpxjgl": 0.00, "yjfz": 18000.00, "xsckjtycf": 40000.00, "yjldfz": 5000.00, "j_kcg": 0.00, "hbzj": 500000.00, "cczj": 100000.00, "jyxjrzc": 0.00, "ysjrzc": 0.00, "yspj": 12000.00, "yszk": 200000.00, "yfkx": 80000.00, "yslx": 3000.00, "qtysk": 45000.00, "mrfsjrzck": 0.00, "gyjzjzbdqjsrdq": 0.00, "ch": 90000.00, "qtldzc": 22000.00, "ldzchj": 1009500.00, "ffdkjjd": 0.00, "kkgsjrzc": 0.00, "cyzdqtz": 0.00, "cqgqtz": 300000.00, "tzxfd": 0.00, "ljzj": 0.00, "gdzc": 750000.00, "zjgc": 50000.00, "gcwz": 10000.00, "cqfz": 0.00, "wxzc": 60000.00, "sy": 0.00, "cqdtfy": 5000.00, "dysdszc": 15000.00, "fldzchj": 1190000.00, "zczj": 2200000.00, "dqjk": 150000.00, "xzyhyhk": 0.00, "crzj": 50000.00, "jyxjrfz": 0.00, "ysjrfz": 0.00, "yfpj": 15000.00, "yfzk": 190000.00, "ysk": 7000.00, "mchgjrzck": 0.00, "yfgzxc": 50000.00, "yjsf": 25000.00, "yflx": 8000.00, "yfgl": 10000.00, "qtfzk": 60000.00, "ynndqdfldfz": 20000.00, "qtldfz": 10000.00, "ldfzhj": 798000.00, "cqjk": 300000.00, "yfzq": 400000.00, "cqyfk": 150000.00, "zxyfk": 0.00, "dysdsfz": 20000.00, "qtfldfz": 10000.00, "fldfzhj": 990000.00, "fzhj": 1788000.00, "sszb": 200000.00, "zbgj": 150000.00, "zxzb": 0.00, "ylgj": 50000.00, "ybfxzb": 0.00, "wfplr": 0.00, "wbbzbzhc": 0.00, "gsmgdqsyhj": 350000.00, "ssgdqy": 62000.00, "syzqyhj": 412000.00, "fzhgdqyzj": 2200000.00 } ], "message": "success" } ``` ``` -------------------------------- ### GET /hs/fin/income/{stock_code} Source: https://www.zhituapi.com/hsstockapi Fetches the profit statement for a specific stock code. You can include start and end dates to filter the results. The stock code should be in the format '000001.SZ'. ```APIDOC ## GET /hs/fin/income/{stock_code} ### Description Retrieves the profit statement for a given stock code. You can specify optional start and end dates (YYYYMMDD format) to filter the data. If no dates are provided, all available data is returned. ### Method GET ### Endpoint `https://api.zhituapi.com/hs/fin/income/{stock_code}` ### Parameters #### Path Parameters - **stock_code** (string) - Required - The stock code to query (e.g., '000001.SZ'). #### Query Parameters - **token** (string) - Required - Your authentication token. - **st** (string) - Optional - The start date in 'YYYYMMDD' format (e.g., '20240101'). - **et** (string) - Optional - The end date in 'YYYYMMDD' format (e.g., '20240101'). ### Request Example ```json { "request": "GET https://api.zhituapi.com/hs/fin/income/000001.SZ?token=YOUR_TOKEN&st=20230101&et=20231231" } ``` ### Response #### Success Response (200) - **jzrq** (string) - Closing date - **plrq** (string) - Disclosure date - **yysr** (float) - Operating revenue - **yzbf** (float) - Earned premium - **fdczssr** (float) - Real estate sales revenue - **yyzcb** (float) - Total operating cost - **fdczscb** (float) - Real estate sales cost - **yffy** (float) - R&D expenses - **tbj** (float) - Surrender value - **pczjje** (float) - Net claims paid - **tqbxhtzbjje** (float) - Net increase in insurance contract reserves - **bdhlzc** (float) - Policy dividend expenditure - **fbfy** (float) - Reinsurance premium - **gyjzbdsy** (float) - Fair value change gains - **qhsy** (float) - Futures gains/losses - **tgsy** (float) - Custody income - **btsr** (float) - Subsidy income - **qtywlr** (float) - Other business profit - **bhbfzhbqsljlr** (float) - Net profit attributable to the merged entity before consolidation - **lxsr** (float) - Interest income - **sxfjyjsr** (float) - Fee and commission income - **sxfjyjzc** (float) - Fee and commission expenses - **qtywsr** (float) - Other business revenue - **qtywcb** (float) - Other business cost - **hdsy** (float) - Exchange gain/loss - **fldzcczsy** (float) - Non-current asset disposal gain/loss - **sdsfy** (float) - Income tax expense - **wqrtzss** (float) - Unrealized investment loss - **gsmgsyzzdjlr** (float) - Net profit attributable to parent company owners - **lxzc** (float) - Interest expense - **qtywsr** (float) - Other revenue - **yyzsr** (float) - Total operating revenue - **yycb** (float) - Operating cost - **yysjjfj** (float) - Taxes and surcharges on operating revenue - **xsfy** (float) - Selling expenses - **glfy** (float) - Administrative expenses - **cwfy** (float) - Financial expenses - **zcjzss** (float) - Asset impairment loss - **tzsy** (float) - Investment income - **lyqyhhhqydtzsy** (float) - Investment income from joint ventures and associates - **yylr** (float) - Operating profit - **ywsr** (float) - Non-operating income - **ywzc** (float) - Non-operating expenses - **lrze** (float) - Total profit - **jlr** (float) - Net profit - **jlrhfcjcx** (float) - Net profit (after deducting non-recurring items) - **ssgdsy** (float) - Minority interests - **jbmgsy** (float) - Basic earnings per share - **xsmgsy** (float) - Diluted earnings per share - **zhsyz** (float) - Total comprehensive income - **gsssgdzhsyz** (float) - Minority interests in total comprehensive income - **qtsy** (float) - Other income #### Response Example ```json { "data": [ { "jzrq": "20231231", "plrq": "20240126", "yysr": 1000000.00, "yzbf": 500000.00, "fdczssr": 200000.00, "yyzcb": 700000.00, "fdczscb": 150000.00, "yffy": 50000.00, "tbj": 10000.00, "pczjje": 400000.00, "tqbxhtzbjje": 30000.00, "bdhlzc": 5000.00, "fbfy": 20000.00, "gyjzbdsy": 15000.00, "qhsy": 0.00, "tgsy": 0.00, "btsr": 2000.00, "qtywlr": 10000.00, "bhbfzhbqsljlr": 0.00, "lxsr": 5000.00, "sxfjyjsr": 0.00, "sxfjyjzc": 0.00, "qtywsr": 0.00, "qtywcb": 0.00, "hdsy": 0.00, "fldzcczsy": 0.00, "sdsfy": 100000.00, "wqrtzss": 0.00, "gsmgsyzzdjlr": 300000.00, "lxzc": 10000.00, "qtywsr": 0.00, "yyzsr": 1200000.00, "yycb": 850000.00, "yysjjfj": 30000.00, "xsfy": 40000.00, "glfy": 60000.00, "cwfy": 10000.00, "zcjzss": 20000.00, "tzsy": 0.00, "lyqyhhhqydtzsy": 0.00, "yylr": 150000.00, "ywsr": 5000.00, "ywzc": 2000.00, "lrze": 153000.00, "jlr": 120000.00, "jlrhfcjcx": 118000.00, "ssgdsy": 2000.00, "jbmgsy": 0.50, "xsmgsy": 0.48, "zhsyz": 130000.00, "gsssgdzhsyz": 2500.00, "qtsy": 1000.00 } ] } ``` ``` -------------------------------- ### Fetch Financial Ratios using Python Source: https://www.zhituapi.com/hsstockapi This Python snippet shows how to retrieve key financial ratios for a stock. It utilizes the `requests` library to query the Zhituapi endpoint for financial ratios, providing the stock code, token, and date range. The output is a JSON object containing the requested data. ```Python import requests url = "https://api.zhituapi.com/hs/fin/ratios/股票代码(如000001.SZ)?token=token证书&st=开始时间&et=结束时间" response = requests.get(url) data = response.json() print(data) ``` -------------------------------- ### Get Quarterly Profit Data (Python) Source: https://www.zhituapi.com/hsstockapi Fetches the quarterly profit data for a company over the past year, sorted by the end date in descending order. A valid token is necessary for API access. The response contains the ending date, operating income, operating expenses, operating profit, total profit, net profit, basic earnings per share, diluted earnings per share, other comprehensive income, and total comprehensive income. ```python import requests url = "https://api.zhituapi.com/hs/gs/jdlr/股票代码?token=token证书" response = requests.get(url) data = response.json() print(data) ``` -------------------------------- ### GET /hs/custom/realall Source: https://www.zhituapi.com/hsstockapi Retrieves real-time trading data for all stocks in the list. Requires premium subscription. ```APIDOC ## GET /hs/custom/realall ### Description Retrieves real-time trading data for all stocks in the list. This interface is limited to premium subscription tokens and requests once per minute. ### Method GET ### Endpoint https://api.zhituapi.com/hs/custom/realall?token=token证书 ### Parameters #### Query Parameters - **token** (string) - Required - Your API token for authentication. ### Request Example ```python import requests url = "https://api.zhituapi.com/hs/custom/realall?token=token证书" response = requests.get(url) data = response.json() print(data) ``` ### Response #### Success Response (200) - **dm** (string) - Stock code. - **p** (number) - Latest price. - **o** (number) - Opening price. - **h** (number) - Highest price. - **l** (number) - Lowest price. - **yc** (number) - Previous closing price. - **cje** (number) - Total transaction amount. - **v** (number) - Total transaction volume. - **pv** (number) - Original total transaction volume. - **ud** (float) - Amount of increase or decrease. - **pc** (float) - Percentage of increase or decrease. - **zf** (float) - Amplitude. - **t** (string) - Update time. - **pe** (number) - Price-to-earnings ratio. - **tr** (number) - Turnover rate. - **pb_ratio** (number) - Price-to-book ratio. - **tv** (number) - Transaction volume. #### Response Example ```json [ { "dm": "000001.SZ", "p": 10.5, "o": 10.0, "h": 10.6, "l": 9.9, "yc": 9.8, "cje": 1000000, "v": 100000, "pv": 110000, "ud": 0.7, "pc": 7.14, "zf": 8.18, "t": "2023-10-27 10:00:00", "pe": 25.5, "tr": 5.2, "pb_ratio": 3.1, "tv": 120000 } ] ``` ``` -------------------------------- ### GET /hs/fin/hm/{stock_code} Source: https://www.zhituapi.com/hsstockapi Retrieves the company's shareholder count for a given stock code. The start and end time parameters are optional and should be in 'YYYYMMDD' format. If not provided, all data is returned. ```APIDOC ## Company Shareholder Count ### Description Retrieves the company's shareholder count for a given stock code. The start and end time parameters are optional and should be in 'YYYYMMDD' format. If not provided, all data is returned. ### Method GET ### Endpoint /hs/fin/hm/{stock_code} ### Query Parameters - **token** (string) - Required - Your API token. - **st** (string) - Optional - Start date in YYYYMMDD format. - **et** (string) - Optional - End date in YYYYMMDD format. ### Request Example ```python import requests url = "https://api.zhituapi.com/hs/fin/hm/000001.SZ?token=your_token&st=20230101&et=20231231" response = requests.get(url) data = response.json() print(data) ``` ### Response #### Success Response (200) - **jzrq** (string) - As of date. - **gdzs** (string) - Total number of shareholders. - **agdhs** (string) - Number of A-share shareholders. - **bgdhs** (string) - Number of B-share shareholders. - **hgdhs** (string) - Number of H-share shareholders. - **yltgdhs** (string) - Number of tradable shareholders. - **wltgdhs** (string) - Number of non-tradable shareholders. #### Response Example ```json { "data": [ { "jzrq": "20231231", "gdzs": "50000", "agdhs": "48000", "bgdhs": "1000", "hgdhs": "1000", "yltgdhs": "40000", "wltgdhs": "10000" } ] } ``` ``` -------------------------------- ### Get Historical Executive Members API Python Example Source: https://www.zhituapi.com/hsstockapi This snippet shows how to retrieve historical executive member information for a stock code via the Zhituapi. It uses the `requests` library in Python to send a GET request to the API. The API returns data in JSON format, detailing the names, titles, and tenure of past executives. ```Python import requests url = "https://api.zhituapi.com/hs/gs/ljgg/股票代码?token=token证书" response = requests.get(url) data = response.json() print(data) ``` -------------------------------- ### Fetch Historical 1-Minute Stock Data (Enterprise Edition) Source: https://www.zhituapi.com/hsstockapi Retrieves historical minute-level stock trading data for enterprise users. Supports various time granularities (1m, 5m, 15m, 30m, 60m, daily, weekly, monthly, yearly) and adjustment types (none, forward, backward). Data is limited to the last 3 years for minute-level and all historical data for daily and above. Requires a valid token. ```python import requests url = "http://专属子域名.zhituapi.com/hs/hsstock/vip/股票代码.市场(如000001.SZ)/分时级别(如d)/除权方式(如n)?token=token证书&st=开始时间(如20240601)&et=结束时间(如20250430)<=最新条数(如100)" response = requests.get(url) data = response.json() print(data) ```