Skip to content

Commit f9429aa

Browse files
committed
candlestick updates
1 parent 3d7c7ae commit f9429aa

File tree

2 files changed

+84
-18
lines changed

2 files changed

+84
-18
lines changed

public/changelog.json

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -358,6 +358,13 @@
358358
}
359359
},
360360
"data": [
361+
{
362+
"category": "release",
363+
"date": "2025-12-29",
364+
"description": "The Data Streams Candlestick API now offers a new [`/groups` endpoint](https://docs.chain.link/data-streams/reference/candlestick-api#get-list-of-supported-groups) that returns a list of all supported symbol types (crypto, equities, forex, equity) which can be used as a filter in the `/symbol_info` endpoint. Additionally, the `/history` and `/history/rows` endpoints now support [user-specified resolutions](https://docs.chain.link/data-streams/reference/candlestick-api#supported-resolutions) with flexible time units (minutes, hours, days, weeks, months, years).",
365+
"title": "Candlestick API: Groups endpoint and user resolution support",
366+
"topic": "Data Streams"
367+
},
361368
{
362369
"category": "integration",
363370
"date": "2025-12-21",

src/content/data-streams/reference/candlestick-api/index.mdx

Lines changed: 77 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -82,9 +82,9 @@ curl -X POST \
8282

8383
**`/api/v1/symbol_info`**
8484

85-
| Type | Description | Parameter(s) |
86-
| :------- | :------------------------------------------------------- | :----------------------------------------------------------------------------------------------- |
87-
| HTTP GET | Gets a list of all supported symbols on the environment. | <ul><li>`group` (optional): Filter symbols by group. Currently only supports "crypto".</li></ul> |
85+
| Type | Description | Parameter(s) |
86+
| :------- | :------------------------------------------------------- | :---------------------------------------------------------------------------------------------------------------------------------- |
87+
| HTTP GET | Gets a list of all supported symbols on the environment. | <ul><li>`group` (optional): Filter symbols by group. See [`/groups`](#get-list-of-supported-groups) for available groups.</li></ul> |
8888

8989
##### Sample request
9090

@@ -121,26 +121,85 @@ curl -X GET \
121121
| `401` | `Unauthorized - Authorization header is required \|\| Invalid authorization header format \|\| token signature is invalid: signature is invalid \|\| ...` | The authorization header was missing or invalid. |
122122
| `500` | `Error - Something went wrong` | An unexpected server error occurred. |
123123

124+
### Get list of supported groups
125+
126+
##### Endpoint
127+
128+
**`/api/v1/groups`**
129+
130+
| Type | Description | Parameter(s) |
131+
| :------- | :-------------------------------------------------------------------------------------------------------------------------------------------- | :----------- |
132+
| HTTP GET | Gets a list of all supported symbol types on the environment. Any group name returned can be used as a filter in the `/symbol_info` endpoint. | None |
133+
134+
##### Sample request
135+
136+
```bash
137+
curl -X GET \
138+
-H "Authorization: Bearer {YOUR_ACCESS_TOKEN}" \
139+
https://priceapi.testnet-dataengine.chain.link/api/v1/groups
140+
```
141+
142+
##### Response
143+
144+
- **Status**: `200`
145+
146+
```json
147+
{
148+
"s": "ok",
149+
"d": {
150+
"groups": [{ "id": "crypto" }, { "id": "equities" }, { "id": "forex" }, { "id": "equity" }]
151+
}
152+
}
153+
```
154+
155+
| Field | Type | Description |
156+
| :------- | :------- | :--------------------------------- |
157+
| `s` | `string` | The status of the request. |
158+
| `d` | `object` | The data returned by the API call. |
159+
| `groups` | `array` | Array of supported groups. |
160+
161+
##### Error Responses
162+
163+
| Status Code | Error Message | Description |
164+
| :---------- | :-------------------------------------------------------------------------------------------------------------------------------------------------------- | :----------------------------------------------- |
165+
| `401` | `Unauthorized - Authorization header is required \|\| Invalid authorization header format \|\| token signature is invalid: signature is invalid \|\| ...` | The authorization header was missing or invalid. |
166+
| `500` | `Error - Something went wrong` | An unexpected server error occurred. |
167+
124168
### Get candlestick data (column format)
125169

126170
##### Endpoint
127171

128172
**`/api/v1/history`**
129173

130-
| Type | Description | Parameter(s) |
131-
| :------- | :-------------------------------------- | :-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
132-
| HTTP GET | Gets candlestick data in column format. | <ul><li>`symbol`: The symbol to query.</li><li>`resolution`: Resolution of the data (required but not used, use "1m").</li><li>`from`: Unix timestamp of the leftmost required bar (inclusive).</li><li>`to`: Unix timestamp of the rightmost required bar (inclusive).</li></ul> |
174+
| Type | Description | Parameter(s) |
175+
| :------- | :-------------------------------------- | :---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
176+
| HTTP GET | Gets candlestick data in column format. | <ul><li>`symbol`: The symbol to query.</li><li>`resolution`: Resolution of the data. E.g., "1m". Must match [supported resolutions](#supported-resolutions).</li><li>`from`: Unix timestamp of the leftmost required bar (inclusive).</li><li>`to`: Unix timestamp of the rightmost required bar (inclusive).</li></ul> |
177+
178+
#### Supported resolutions
179+
180+
The resolution you provide must be within the supported boundaries for the given time window size:
181+
182+
| Time window size | Supported resolutions |
183+
| :------------------------ | :------------------------------- |
184+
| 1 min - 24 hours | 1 minute - 24 hours (1m - 24h) |
185+
| 1 - 5 days | 5 minutes - 5 days (5m - 5d) |
186+
| 5 - 30 days | 30 minutes - 30 days (30m - 30d) |
187+
| 30 - 90 days | 1 hour - 90 days (1h - 90d) |
188+
| 90 - 180 days | 2 hours - 180 days (2h - 6M) |
189+
| 180 - 365 days | 24 hours - 365 days (24h - 1y) |
190+
| 365 - 1825 days (1-5 yrs) | 1 week - 5 years (1w - 5y) |
191+
| Over 1825 days (> 5 yrs) | Over 1 month |
133192

134-
**Note**: The resolution of the data is currently based on the size of the time window:
193+
Resolutions can be provided in the following units:
135194

136-
| Max time window size | Resolution of candles |
137-
| :------------------- | :-------------------- |
138-
| \<= 24 hours | 1 minute |
139-
| \<= 5 days | 5 minutes |
140-
| \<= 30 days | 30 minutes |
141-
| \<= 90 days | 1 hour |
142-
| \<= 6 months | 2 hours |
143-
| > 6 months | 1 day |
195+
| Name | Unit | Example |
196+
| :------ | :--- | :------ |
197+
| minutes | m | 5m |
198+
| hours | h | 3h |
199+
| days | d | 1d |
200+
| weeks | w | 2w |
201+
| months | M | 6M |
202+
| years | y | 2y |
144203

145204
##### Sample request
146205

@@ -193,9 +252,9 @@ curl -X GET \
193252

194253
**`/api/v1/history/rows`**
195254

196-
| Type | Description | Parameter(s) |
197-
| :------- | :----------------------------------- | :-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
198-
| HTTP GET | Gets candlestick data in row format. | <ul><li>`symbol`: The symbol to query.</li><li>`resolution`: Resolution of the data (required but not used, use "1m").</li><li>`from`: Unix timestamp of the leftmost required bar (inclusive).</li><li>`to`: Unix timestamp of the rightmost required bar (inclusive).</li></ul> |
255+
| Type | Description | Parameter(s) |
256+
| :------- | :----------------------------------- | :---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
257+
| HTTP GET | Gets candlestick data in row format. | <ul><li>`symbol`: The symbol to query.</li><li>`resolution`: Resolution of the data. E.g., "1m". Must match [supported resolutions](#supported-resolutions).</li><li>`from`: Unix timestamp of the leftmost required bar (inclusive).</li><li>`to`: Unix timestamp of the rightmost required bar (inclusive).</li></ul> |
199258

200259
##### Sample request
201260

0 commit comments

Comments
 (0)