Pagination
All list-based endpoints follow a unified pagination convention.
Request Parameters
| Parameter | Type | Description |
|---|---|---|
next_key | string | Pagination cursor. Leave empty "" for the first page. Pass back pagination.next_key from the previous response to fetch the next page. |
limit | int | Page size (each endpoint has its own default and maximum). |
Response
Pagination info is placed in the top-level pagination object (not inside data):
| Field | Type | Description |
|---|---|---|
has_more | bool | Whether there is a next page. Use has_more=false as the only signal to stop paginating. |
next_key | string | Next page cursor; "-1" when no more pages. |
total | int (optional) | Total count of matching items. Only returned by some endpoints (e.g. screening, rating summary, insider list, valuation list, plate constituent stocks). |
TIP
The next_key cursor is opaque to callers — do not parse or construct it manually.
Example
Request first page:
bash
curl -s -X POST "https://webapi.moomoo.com/api/v1.0/quote/plate/HK.BK1001/stock" \
-H "Content-Type: application/json" \
-H "Authorization: Bearer <AccessToken>" \
-d '{"next_key":"","limit":2}' | jqResponse:
json
{
"ret_code": 0,
"ret_msg": "success",
"data": { "stock_list": [{ "code": "HK.02337" }, { "code": "HK.01193" }] },
"pagination": {
"has_more": true,
"next_key": "2",
"total": 22
}
}Request next page:
bash
curl -s -X POST "https://webapi.moomoo.com/api/v1.0/quote/plate/HK.BK1001/stock" \
-H "Content-Type: application/json" \
-H "Authorization: Bearer <AccessToken>" \
-d '{"next_key":"2","limit":2}' | jqExceptions
A few endpoints that fetch by date range (get_capital_flow_history, request_history_kline) use pagination.has_more to indicate whether earlier data exists. Callers paginate backward by adjusting the date range (capital uses end; history-kline uses data.next_time as the next end), rather than using next_key.
See Also
- Quote API Overview — Quote API summary.
- Getting Started — Make your first request in 5 minutes.