Klines
Candlestick (OHLCV) data for a US-listed symbol over a given time range and interval.
Endpoint
GET /stock/v1/klines
Authentication: Standard plan. Requires a valid platform API key (X-Primit-API-Key) tied to an active Standard plan (标准套餐) subscription or above. See Authentication.
Query parameters
| Name | Type | Required | Default | Notes |
|---|---|---|---|---|
symbol | string | Yes | — | Ticker, e.g. AAPL. |
interval | string | No | 1d | One of 1m, 5m, 15m, 30m, 1h, 1d, 1w, 1M. |
limit | integer | No | 100 | Number of bars to return. |
startTime | integer | No | — | Inclusive start, Unix milliseconds. |
endTime | integer | No | — | Inclusive end, Unix milliseconds. |
adjusted | boolean | No | true | Whether prices are adjusted for splits/dividends. |
If neither startTime nor endTime is provided, the most recent limit bars are returned, in ascending open_time order.
Response — 200 OK
2D array. Each row is positional (standard Binance kline format):
[
[
1773705600000,
"5013.59",
"5043.75",
"4978.40",
"5003.54",
"145553.554",
1773791999999,
"729468735.70852",
431830,
"72156.345",
"361615976.65469",
"0"
]
]
| Index | Field | Type | Description |
|---|---|---|---|
| 0 | open_time | integer (ms) | Bar open time. |
| 1 | open | string (decimal) | Open price. |
| 2 | high | string (decimal) | High price. |
| 3 | low | string (decimal) | Low price. |
| 4 | close | string (decimal) | Close price. |
| 5 | volume | string (decimal) | Base-asset volume. |
| 6 | close_time | integer (ms) | Bar close time. |
| 7 | quote_volume | string (decimal) | Quote-asset volume. |
| 8 | trades | integer | Trade count. |
| 9 | taker_buy_volume | string (decimal) | Base-asset volume bought by takers. |
| 10 | taker_buy_quote_volume | string (decimal) | Quote-asset volume bought by takers. |
| 11 | ignore | string | Reserved by Binance. |
Errors
| HTTP | Cause |
|---|---|
401 | Missing or invalid X-Primit-API-Key. |
403 | No active Standard plan (subscription expired or never purchased). |
404 | symbol not found. |
422 | interval not in the allowed set. |
Example
curl -s "https://api.pipai.org/stock/v1/klines?symbol=AAPL&interval=1d&limit=250" \
-H "X-Primit-API-Key: $PRIMIT_API_KEY"