Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions public/changelog.json
Original file line number Diff line number Diff line change
Expand Up @@ -358,6 +358,13 @@
}
},
"data": [
{
"category": "release",
"date": "2025-12-29",
"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).",
"title": "Candlestick API: Groups endpoint and user resolution support",
"topic": "Data Streams"
},
{
"category": "integration",
"date": "2025-12-21",
Expand Down
95 changes: 77 additions & 18 deletions src/content/data-streams/reference/candlestick-api/index.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -82,9 +82,9 @@ curl -X POST \

**`/api/v1/symbol_info`**

| Type | Description | Parameter(s) |
| :------- | :------------------------------------------------------- | :----------------------------------------------------------------------------------------------- |
| 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> |
| Type | Description | Parameter(s) |
| :------- | :------------------------------------------------------- | :---------------------------------------------------------------------------------------------------------------------------------- |
| 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> |

##### Sample request

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

### Get list of supported groups

##### Endpoint

**`/api/v1/groups`**

| Type | Description | Parameter(s) |
| :------- | :-------------------------------------------------------------------------------------------------------------------------------------------- | :----------- |
| 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 |

##### Sample request

```bash
curl -X GET \
-H "Authorization: Bearer {YOUR_ACCESS_TOKEN}" \
https://priceapi.testnet-dataengine.chain.link/api/v1/groups
```

##### Response

- **Status**: `200`

```json
{
"s": "ok",
"d": {
"groups": [{ "id": "crypto" }, { "id": "equities" }, { "id": "forex" }, { "id": "equity" }]
}
}
```

| Field | Type | Description |
| :------- | :------- | :--------------------------------- |
| `s` | `string` | The status of the request. |
| `d` | `object` | The data returned by the API call. |
| `groups` | `array` | Array of supported groups. |

##### Error Responses

| Status Code | Error Message | Description |
| :---------- | :-------------------------------------------------------------------------------------------------------------------------------------------------------- | :----------------------------------------------- |
| `401` | `Unauthorized - Authorization header is required \|\| Invalid authorization header format \|\| token signature is invalid: signature is invalid \|\| ...` | The authorization header was missing or invalid. |
| `500` | `Error - Something went wrong` | An unexpected server error occurred. |

### Get candlestick data (column format)

##### Endpoint

**`/api/v1/history`**

| Type | Description | Parameter(s) |
| :------- | :-------------------------------------- | :-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| 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> |
| Type | Description | Parameter(s) |
| :------- | :-------------------------------------- | :---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| 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> |

#### Supported resolutions

The resolution you provide must be within the supported boundaries for the given time window size:

| Time window size | Supported resolutions |
| :------------------------ | :------------------------------- |
| 1 min - 24 hours | 1 minute - 24 hours (1m - 24h) |
| 1 - 5 days | 5 minutes - 5 days (5m - 5d) |
| 5 - 30 days | 30 minutes - 30 days (30m - 30d) |
| 30 - 90 days | 1 hour - 90 days (1h - 90d) |
| 90 - 180 days | 2 hours - 180 days (2h - 6M) |
| 180 - 365 days | 24 hours - 365 days (24h - 1y) |
| 365 - 1825 days (1-5 yrs) | 1 week - 5 years (1w - 5y) |
| Over 1825 days (> 5 yrs) | Over 1 month |

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

| Max time window size | Resolution of candles |
| :------------------- | :-------------------- |
| \<= 24 hours | 1 minute |
| \<= 5 days | 5 minutes |
| \<= 30 days | 30 minutes |
| \<= 90 days | 1 hour |
| \<= 6 months | 2 hours |
| > 6 months | 1 day |
| Name | Unit | Example |
| :------ | :--- | :------ |
| minutes | m | 5m |
| hours | h | 3h |
| days | d | 1d |
| weeks | w | 2w |
| months | M | 6M |
| years | y | 2y |

##### Sample request

Expand Down Expand Up @@ -193,9 +252,9 @@ curl -X GET \

**`/api/v1/history/rows`**

| Type | Description | Parameter(s) |
| :------- | :----------------------------------- | :-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| 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> |
| Type | Description | Parameter(s) |
| :------- | :----------------------------------- | :---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| 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> |

##### Sample request

Expand Down
Loading