US Stock Rankings
US Stock Rankings
Documentation
API Introduction
This API provides a real-time ranking data query service for the US stock market. Developers can specify sorting fields (e.g., change rate, trading volume, turnover, total market cap) and market categories (all, tech stocks, China concept stocks, etc.) to retrieve list data containing core fields such as stock code, name, real-time price, change, high/low/open/close prices, and market capitalization.
Use Cases
- Financial News Applications: Display popular US stock sectors, gainers, or losers lists to enhance user engagement.
- Quantitative Trading Assistance: Monitor capital flows and volatility in specific sectors (e.g., tech stocks, China concept stocks).
- Investment Research Data Analysis: Track market performance of high-volume or high-market-cap individual stocks to aid investment decisions.
Request and Response Description
Request Method: POST Key Parameters:
sort(Required): Sorting basis, options includechangeRate(change rate),volume(trading volume),value(turnover),totalShare(total market capitalization).market(Required): Market scope, options includeall(all),tech(tech stocks),china(China concept stocks),star(star stocks).asc: Sort order,0for descending (default),1for ascending.page/limit: Pagination control, maximum 100 items returned per page.
Response Results: Returns JSON formatted data, where the data.list array contains detailed individual stock information, including fields such as symbol (code), name (name), price (current price), changeRate (change rate), volume (trading volume).
Integration Suggestions
- Caching Strategy: Ranking data updates frequently. It is recommended for the frontend to set short-term caching (e.g., 1-5 minutes) to reduce API call frequency.
- Error Handling: Please validate the returned
code. If the status code is not 200, refer to themsgfield for error messages. - Data Display: Note that numeric fields are returned as strings. Frontend display requires formatting amounts and percentages according to business requirements.
Integration Examples
Includes ready-to-use Shell, Python, Go, Java, and PHP examples for direct integration.
Request Example
{
"sort": "排序字段,可选:changeRate 涨跌率排序,volume 成交量排序,value 成交额排序 , totalShare 总市值排序",
"asc": "排序顺序,0 倒序(由大到小), 1正序(由小到大),默认0",
"page": "页码,默认1",
"limit": "每页条数,最大100条,默认10",
"market": "市场代码,可选:all 全部美股 ,tech 科技股,china 中概股,star 明星股"
}Response Example
{
"msg": "成功",
"code": 200,
"taskNo": "309443174209760778124907",
"data": {
"list": [
{
"volume": "215748955",
"symbol": "NVDA",
"high": "128.2800",
"low": "121.3600",
"price": "128.2800",
"change": "5.61",
"name": "英伟达",
"preclose": "122.6700",
"changeRate": "4.57",
"value": "27018856766.0000",
"open": "121.6600",
"totalShare": "3155475307911"
}
]
}
}Request Fields
The fields below are derived from example JSON for integration reference only.
| Path | Type | Sample |
|---|---|---|
| type | string | object |
| properties | object | {...} |
| properties.sort | object | {...} |
| properties.sort.type | string | string |
| properties.sort.description | string | 排序字段,可选:changeRate 涨跌率排序,volume 成交量排序,value 成交额排序 , totalShare 总市值排序 |
| properties.asc | object | {...} |
| properties.asc.type | string |
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 | {...} |