US Stock Quotes
US Stock Quotes
Documentation
API Introduction
This API provides real-time quote data query service for the US stock market. By passing a stock trading symbol, you can obtain multi-dimensional financial information including real-time price, open price, high/low prices, trading volume, Price-to-Earnings ratio (PE), Earnings Per Share (EPS), total market capitalization, and after-hours trading data. The data covers mainstream US stock symbols and is suitable for business systems requiring integration of US stock market quotes.
Use Cases
- Financial News Applications: Display real-time trends and key financial indicators for individual US stocks in apps or on websites.
- Quantitative Trading Assistance: Provide fundamental price, trading volume, and historical high/low data references for strategy models.
- Portfolio Management: Monitor current market value, change amount, and 52-week price range of held stocks.
- Market Data Analysis: Analyze individual stock liquidity (trading volume) and valuation levels (PE ratio, dividend yield).
Request and Response Description
Request Method: POST Request Parameters:
symbol(Required): Stock symbol, supports single or multiple codes, separated by English commas (e.g.,INTC,AAPL).
Response Results: Upon successful response, the data field will contain a collection of objects keyed by stock symbol. Each object includes the following core fields:
- Price Information:
price(real-time price),open(open price),high/low(day's high/low),preclose(previous close). - Trading Data:
volume(trading volume),volume_avg10(10-day average volume),market_value(total market capitalization). - Financial Indicators:
pe(P/E ratio),eps(EPS),dividend(dividend yield),shares(total shares outstanding). - After-Hours Data:
after_price(after-hours price),after_volume(after-hours volume),after_change(after-hours change amount).
*Note: All numeric fields are returned as strings in the response. Frontend applications should convert them to numeric types as needed.*
Integration Suggestions
- Batch Query Optimization: The API supports querying multiple symbols separated by commas. It is recommended to combine multiple stock requests on the same page into a single call to reduce network overhead and improve loading speed.
- Data Refresh Frequency: Given the nature of real-time market data, please set a reasonable frontend polling interval according to business requirements to avoid excessive requests that could lead to resource waste or rate limiting.
- Error Handling: Always check the
codefield in the response body (200 indicates success) and properly handle error messages inmsgto ensure that individual symbol query failures do not affect overall page rendering. - Time Zone Consideration: Returned time fields (e.g.,
trade_time) are typically in US Eastern Time or UTC. It is recommended to perform time zone conversion when displaying to domestic users.
Integration Examples
Includes ready-to-use Shell, Python, Go, Java, and PHP examples for direct integration.
Request Example
{
"symbol": "品种代码,以英文逗号分割,如:INTC,AAPL"
}Response Example
{
"msg": "成功",
"code": 200,
"taskNo": "200966658220607506216602",
"data": {
"AAPL": {
"after_price": "221.0800",
"volume_avg10": "86695457",
"market_value": "3397265867100",
"trade_time": "2024-07-04 01:00:00",
"change": "1.2800",
"eps": "6.46",
"after_volume": "1132411",
"volume": "37369801",
"shares": "15334082000",
"after_change": "-0.47",
"high": "221.5500",
"update_time": "2024-07-04 09:45:24",
"low": "219.0300",
"pe": "34.300000",
"price": "221.5500",
"name": "苹果",
"dividend": "0.25",
"52week_low": "163.8300",
"after_changeRate": "-0.21",
"changeRate": "0.58",
"preclose": "220.2700",
"open": "220.0000",
"52week_high": "221.5500",
"after_time": "2024-07-04 05:00:00"
}
}
}Request Fields
The fields below are derived from example JSON for integration reference only.
| Path | Type | Sample |
|---|---|---|
| type | string | object |
| properties | object | {...} |
| properties.symbol | object | {...} |
| properties.symbol.type | string | string |
| properties.symbol.description | string | 品种代码,以英文逗号分割,如:INTC,AAPL |
| required | array | "symbol" |
| required[] | string | symbol |
Response Fields
The fields below are derived from example JSON for integration reference only.
| Path | Type | Sample |
|---|---|---|
| type | string | object |
| properties | object | {...} |
| properties.msg | object | {...} |
| properties.msg.type | string | string |
| properties.msg.example | string | 成功 |
| properties.msg.description | string | 返回码对应描述 |
| properties.code | object | {...} |