diff --git a/public/changelog.json b/public/changelog.json index fe19c73d76a..0c2389ad9bb 100644 --- a/public/changelog.json +++ b/public/changelog.json @@ -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", diff --git a/src/content/data-streams/reference/candlestick-api/index.mdx b/src/content/data-streams/reference/candlestick-api/index.mdx index 0149066cd4a..64478531221 100644 --- a/src/content/data-streams/reference/candlestick-api/index.mdx +++ b/src/content/data-streams/reference/candlestick-api/index.mdx @@ -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. | | +| Type | Description | Parameter(s) | +| :------- | :------------------------------------------------------- | :---------------------------------------------------------------------------------------------------------------------------------- | +| HTTP GET | Gets a list of all supported symbols on the environment. | | ##### Sample request @@ -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. | | +| Type | Description | Parameter(s) | +| :------- | :-------------------------------------- | :---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| HTTP GET | Gets candlestick data in column format. | | + +#### 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 @@ -193,9 +252,9 @@ curl -X GET \ **`/api/v1/history/rows`** -| Type | Description | Parameter(s) | -| :------- | :----------------------------------- | :-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -| HTTP GET | Gets candlestick data in row format. | | +| Type | Description | Parameter(s) | +| :------- | :----------------------------------- | :---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| HTTP GET | Gets candlestick data in row format. | | ##### Sample request