From a170200b501b2fff4a86a9a459702723dec7cc81 Mon Sep 17 00:00:00 2001 From: Devin DiStefano Date: Tue, 29 Jul 2025 15:25:29 -0500 Subject: [PATCH 01/14] init --- .../data-streams/reference/price-api.mdx | 214 ++++++++++++++++++ 1 file changed, 214 insertions(+) create mode 100644 src/content/data-streams/reference/price-api.mdx diff --git a/src/content/data-streams/reference/price-api.mdx b/src/content/data-streams/reference/price-api.mdx new file mode 100644 index 00000000000..ca9a4991de8 --- /dev/null +++ b/src/content/data-streams/reference/price-api.mdx @@ -0,0 +1,214 @@ +--- +section: dataStreams +date: Last Modified +title: "Data Streams Price API" +metadata: + title: "Data Streams Price API Reference | Chainlink Documentation" + description: "Reference for the Chainlink Data Streams Price API. Learn how to authenticate, list available symbols, query historical candlestick (OHLC) data, and stream live price updates over HTTP." + keywords: ["Candlestick API", "Price API", "OHLC", "HTTP Rest API", "API Client", "Trading View API"] +--- + +import DataStreams from "@features/data-streams/common/DataStreams.astro" + + + +PriceAPI is designed and implemented to satisfy the [TradingView implementation spec](https://www.tradingview.com/broker-api-docs/rest-api-spec/#tag/Data-Integration), the industry standard to share aggregated trading data. + +Alignment to the TradingView spec allows for trading view integration and direct customer access to prices without resorting to consuming and decoding reports for non-transactional use cases, like dashboards, analytics platforms, portfolio trackers, research tools, and more. + +{/* TODO: specify mainnet and testnet domains */} + +## Domains + +| Description | Testnet URL | Mainnet URL | +| ------------------ | ----------- | ----------- | +| Price API endpoint | TBD | TBD | + +## API Endpoints + +### Authorize and get token + +##### Endpoint + +**`/api/v1/authorize`** + +| Type | Description | Parameter(s) | +| :-------- | :------------------------------------------------ | :------------------------------------------------------------------------------ | +| HTTP POST | Authorizes a user and returns a JWT access token. | | + +##### Sample request + +```bash +curl -X POST \ + -H "Content-Type: application/x-www-form-urlencoded" \ + -d "login={YOUR_USER_ID}&password={YOUR_API_KEY}" \ + [API_BASE]/api/v1/authorize +``` + +##### Sample response + +```json +{ + "d": { + "access_token": "[ACCESS_TOKEN]", // JWT token for subsequent requests + "expiration": 1747203979 + }, + "s": "ok" +} +``` + +### Get list of supported symbols + +##### Endpoint + +**`/api/v1/symbol_info`** + +| Type | Description | Parameter(s) | +| :------- | :------------------------------------------------------- | :----------------------------------------------------------------------------------------------- | +| HTTP GET | Gets a list of all supported symbols on the environment. | | + +##### Sample request + +```bash +curl -X GET \ + -H "Authorization: Bearer {YOUR_ACCESS_TOKEN}" \ + [API_BASE]/api/v1/symbol_info +``` + +##### Sample response + +```json +{ + "s": "ok", + "symbol": ["ETHUSD", "BTCUSD"], + "currency": ["USD", "USD"], + "base-currency": ["ETH", "BTC"] +} +``` + +### Get candlestick data (column format) + +##### Endpoint + +**`/api/v1/history`** + +| Type | Description | Parameter(s) | +| :------- | :-------------------------------------- | :-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| HTTP GET | Gets candlestick data in column format. | | + +**Note**: The resolution of the data is based on the size of the time window: + +| 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 | + +##### Sample request + +```bash +curl -X GET \ + -H "Authorization: Bearer {YOUR_ACCESS_TOKEN}" \ + "[API_BASE]/api/v1/history?symbol=ETHUSD&resolution=1m&from=1746072068&to=1746158468" +``` + +##### Sample response + +```json +{ + "s": "ok", + "t": [1746158460, 1746158400, 1746158340], + "c": [1.84685e21, 1.848515087189567e21, 1.8490380305e21, 1.8481266e21], + "o": [1.8483674e21, 1.848602513e21, 1.8481267e21], + "h": [1.8498753129131415e21, 1.848875387e21, 1.8490380305e21], + "l": [1.8468008021426886e21, 1.848243519e21, 1.8475677870725296e21], + "v": [] +} +``` + +### Get candlestick data (row format) + +##### Endpoint + +**`/api/v1/history/rows`** + +| Type | Description | Parameter(s) | +| :------- | :----------------------------------- | :-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| HTTP GET | Gets candlestick data in row format. | | + +##### Sample request + +```bash +curl -X GET \ + -H "Authorization: Bearer {YOUR_ACCESS_TOKEN}" \ + "[API_BASE]/api/v1/history/rows?symbol=ETHUSD&resolution=1m&from=1746072068&to=1746158468" +``` + +##### Sample response + +```json +{ + "s": "ok", + "candles": [ + [1746158460, 1.8483674e21, 1.8498753129131415e21, 1.8468008021426886e21, 1.84685e21, 0], + [1746158400, 1.848602513e21, 1.848875387e21, 1.848243519e21, 1.848515087189567e21, 0], + [1746158340, 1.8481267e21, 1.8490380305e21, 1.8475677870725296e21, 1.8490380305e21, 0] + ] +} +``` + +### Get streaming price updates + +##### Endpoint + +**`/api/v1/streaming`** + +| Type | Description | Parameter(s) | +| :------- | :-------------------------------------------------------- | :----------------------------------------------------------------------------------------------- | +| HTTP GET | Gets streaming price updates using HTTP chunked encoding. | | + +##### Sample request + +```bash +curl -X GET \ + -H "Authorization: Bearer {YOUR_ACCESS_TOKEN}" \ + -H "Connection: keep-alive" \ + "[API_BASE]/api/v1/streaming?symbol=ETHUSD,BTCUSD" +``` + +##### Sample response (Streaming) + +A stream of JSON objects. + +**Trade Response:** + +```json +{ + "f": "t", + "i": "ETHUSD", + "fid": "[FEED_ID]", // Hex encoded feed ID + "p": 2.68312e21, + "t": 1748525526, + "s": 1 +} +``` + +**Heartbeat (sent every 5 seconds):** + +```json +{ "heartbeat": 1748525528 } +``` + +--- + +## Error Response Codes + +| Status Code | Description | +| :---------------------- | :---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| **400 Bad Request** | This error is triggered when: | +| **401 Unauthorized** | This error is triggered when: | +| **404 Not Found** | This error is triggered when: | +| **500 Internal Server** | Indicates an unexpected condition was encountered by the server, preventing it from fulfilling the request. This error typically points to issues on the server side. | From 583c28fd7f07996a4895d8fb94aa491716eb3ad2 Mon Sep 17 00:00:00 2001 From: Devin DiStefano Date: Wed, 30 Jul 2025 08:42:52 -0700 Subject: [PATCH 02/14] updated base url --- src/content/data-streams/reference/price-api.mdx | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/src/content/data-streams/reference/price-api.mdx b/src/content/data-streams/reference/price-api.mdx index ca9a4991de8..c1c29a1d099 100644 --- a/src/content/data-streams/reference/price-api.mdx +++ b/src/content/data-streams/reference/price-api.mdx @@ -20,9 +20,9 @@ Alignment to the TradingView spec allows for trading view integration and direct ## Domains -| Description | Testnet URL | Mainnet URL | -| ------------------ | ----------- | ----------- | -| Price API endpoint | TBD | TBD | +| Description | Testnet URL | Mainnet URL | +| ------------------ | ------------------------------------------------ | ---------------------------------------- | +| Price API endpoint | `https://priceapi.testnet-dataengine.chain.link` | `https://priceapi.dataengine.chain.link` | ## API Endpoints @@ -42,7 +42,7 @@ Alignment to the TradingView spec allows for trading view integration and direct curl -X POST \ -H "Content-Type: application/x-www-form-urlencoded" \ -d "login={YOUR_USER_ID}&password={YOUR_API_KEY}" \ - [API_BASE]/api/v1/authorize + https://priceapi.testnet-dataengine.chain.link/api/v1/authorize ``` ##### Sample response @@ -72,7 +72,7 @@ curl -X POST \ ```bash curl -X GET \ -H "Authorization: Bearer {YOUR_ACCESS_TOKEN}" \ - [API_BASE]/api/v1/symbol_info + https://priceapi.testnet-dataengine.chain.link/api/v1/symbol_info ``` ##### Sample response @@ -112,7 +112,7 @@ curl -X GET \ ```bash curl -X GET \ -H "Authorization: Bearer {YOUR_ACCESS_TOKEN}" \ - "[API_BASE]/api/v1/history?symbol=ETHUSD&resolution=1m&from=1746072068&to=1746158468" + "https://priceapi.testnet-dataengine.chain.link/api/v1/history?symbol=ETHUSD&resolution=1m&from=1746072068&to=1746158468" ``` ##### Sample response @@ -144,7 +144,7 @@ curl -X GET \ ```bash curl -X GET \ -H "Authorization: Bearer {YOUR_ACCESS_TOKEN}" \ - "[API_BASE]/api/v1/history/rows?symbol=ETHUSD&resolution=1m&from=1746072068&to=1746158468" + "https://priceapi.testnet-dataengine.chain.link/api/v1/history/rows?symbol=ETHUSD&resolution=1m&from=1746072068&to=1746158468" ``` ##### Sample response @@ -176,7 +176,7 @@ curl -X GET \ curl -X GET \ -H "Authorization: Bearer {YOUR_ACCESS_TOKEN}" \ -H "Connection: keep-alive" \ - "[API_BASE]/api/v1/streaming?symbol=ETHUSD,BTCUSD" + "https://priceapi.testnet-dataengine.chain.link/api/v1/streaming?symbol=ETHUSD,BTCUSD" ``` ##### Sample response (Streaming) From b945c37f22920b043159058a8cbe5384eb58db9d Mon Sep 17 00:00:00 2001 From: Devin DiStefano Date: Wed, 30 Jul 2025 10:15:24 -0700 Subject: [PATCH 03/14] updated docs and added to sidebar --- src/config/sidebar.ts | 6 +- .../reference/candlestick-api.mdx | 300 ++++++++++++++++++ .../data-streams/reference/price-api.mdx | 214 ------------- 3 files changed, 305 insertions(+), 215 deletions(-) create mode 100644 src/content/data-streams/reference/candlestick-api.mdx delete mode 100644 src/content/data-streams/reference/price-api.mdx diff --git a/src/config/sidebar.ts b/src/config/sidebar.ts index b86099f1240..335910bac5e 100644 --- a/src/config/sidebar.ts +++ b/src/config/sidebar.ts @@ -434,9 +434,13 @@ export const SIDEBAR: Partial> = { url: "data-streams/reference/overview", }, { - title: "REST API", + title: "Data Streams REST API", url: "data-streams/reference/interface-api", }, + { + title: "Candlestick REST API", + url: "data-streams/reference/candlestick-api", + }, { title: "WebSocket", url: "data-streams/reference/interface-ws", diff --git a/src/content/data-streams/reference/candlestick-api.mdx b/src/content/data-streams/reference/candlestick-api.mdx new file mode 100644 index 00000000000..25ee0d76390 --- /dev/null +++ b/src/content/data-streams/reference/candlestick-api.mdx @@ -0,0 +1,300 @@ +--- +section: dataStreams +date: July 30, 2025 +title: "Data Streams Candlestick API" +metadata: + title: "Data Streams Candlestick API Reference | Chainlink Documentation" + description: "Reference for the Chainlink Data Streams Candlestick API. Learn how to authenticate, list available symbols, query historical candlestick (OHLC) data, and stream live price updates over HTTP." + keywords: ["Candlestick API", "OHLC", "HTTP Rest API", "API Client", "Trading View API"] +--- + +import DataStreams from "@features/data-streams/common/DataStreams.astro" + + + +The Candlestick API is designed and implemented to satisfy the [TradingView implementation spec](https://www.tradingview.com/broker-api-docs/rest-api-spec/#tag/Data-Integration), the industry standard for sharing aggregated trading data. + +Alignment with the TradingView spec allows for TradingView integration and direct customer access to prices without resorting to consuming and decoding reports for non-transactional use cases, like dashboards, analytics platforms, portfolio trackers, research tools, and more. + +## Domains + +| Description | Testnet URL | Mainnet URL | +| :----------------------- | :----------------------------------------------- | :--------------------------------------- | +| Candlestick API endpoint | `https://priceapi.testnet-dataengine.chain.link` | `https://priceapi.dataengine.chain.link` | + +## API Endpoints + +### Authorize and get token + +##### Endpoint + +**`/api/v1/authorize`** + +| Type | Description | Parameter(s) | +| :-------- | :------------------------------------------------ | :------------------------------------------------------------------------------ | +| HTTP POST | Authorizes a user and returns a JWT access token. |
  • `login`: The user ID.
  • `password`: The user's API key.
| + +##### Sample request + +```bash +curl -X POST \ + -H "Content-Type: application/x-www-form-urlencoded" \ + -d "login={YOUR_USER_ID}&password={YOUR_API_KEY}" \ + https://priceapi.testnet-dataengine.chain.link/api/v1/authorize +``` + +##### Response + +- **Status**: `200` + + ```json + { + "d": { + "access_token": "[ACCESS_TOKEN]", + "expiration": 1747203979 + }, + "s": "ok" + } + ``` + + | Field | Type | Description | + | :------------- | :------- | :---------------------------------------- | + | `s` | `string` | The status of the request. | + | `d` | `object` | The data returned by the API call. | + | `access_token` | `string` | The JWT token for subsequent requests. | + | `expiration` | `number` | The expiry timestamp (unix) of the token. | + +##### Error Responses + +| Status Code | Error Message | Description | +| :---------- | :------------------------------------------------------------------------------ | :---------------------------------------- | +| `400` | `Parse error - Login: missing required field, Password: missing required field` | A required field was missing. | +| `401` | `Unauthorized - Invalid credentials` | The user password (API key) is incorrect. | +| `404` | `Not found - user not found for id {USER_ID}` | The user login was not found. | +| `500` | `Error - Failed to generate token` | The server failed to create a token. | + +### Get list of supported symbols + +##### Endpoint + +**`/api/v1/symbol_info`** + +| Type | Description | Parameter(s) | +| :------- | :------------------------------------------------------- | :----------------------------------------------------------------------------------------------- | +| HTTP GET | Gets a list of all supported symbols on the environment. |
  • `group` (optional): Filter symbols by group. Currently only supports "crypto".
| + +##### Sample request + +```bash +curl -X GET \ + -H "Authorization: Bearer {YOUR_ACCESS_TOKEN}" \ + https://priceapi.testnet-dataengine.chain.link/api/v1/symbol_info +``` + +##### Response + +- **Status**: `200` + + ```json + { + "s": "ok", + "symbol": ["ETHUSD", "BTCUSD"], + "currency": ["USD", "USD"], + "base-currency": ["ETH", "BTC"] + } + ``` + + | Field | Type | Description | + | :-------------- | :------- | :------------------------------- | + | `s` | `string` | The status of the request. | + | `symbol` | `array` | Array of supported symbols. | + | `currency` | `array` | Array of symbol currencies. | + | `base-currency` | `array` | Array of symbol base currencies. | + +##### 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. |
  • `symbol`: The symbol to query.
  • `resolution`: Resolution of the data (required but not used, use "1m").
  • `from`: Unix timestamp of the leftmost required bar (inclusive).
  • `to`: Unix timestamp of the rightmost required bar (inclusive).
| + +**Note**: The resolution of the data is based on the size of the time window: + +| 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 | + +##### Sample request + +```bash +curl -X GET \ + -H "Authorization: Bearer {YOUR_ACCESS_TOKEN}" \ + "https://priceapi.testnet-dataengine.chain.link/api/v1/history?symbol=ETHUSD&resolution=1m&from=1746072068&to=1746158468" +``` + +##### Response + +- **Status**: `200` + + ```json + { + "s": "ok", + "t": [1746158460, 1746158400, 1746158340], + "c": [1.84685e21, 1.848515087189567e21, 1.8490380305e21, 1.8481266e21], + "o": [1.8483674e21, 1.848602513e21, 1.8481267e21], + "h": [1.8498753129131415e21, 1.848875387e21, 1.8490380305e21], + "l": [1.8468008021426886e21, 1.848243519e21, 1.8475677870725296e21], + "v": [] + } + ``` + + | Field | Type | Description | + | :---- | :------- | :--------------------------------------------------------------------- | + | `s` | `string` | The status of the request. | + | `t` | `array` | Array of unix timestamps (the time of each candle). | + | `c` | `array` | Array of numbers (the close (last) value of each candle). | + | `o` | `array` | Array of numbers (the open (first) value of each candle). | + | `h` | `array` | Array of numbers (the high (max) value of each candle). | + | `l` | `array` | Array of numbers (the low (min) value of each candle). | + | `v` | `array` | Array of numbers (the volume of each candle. Not currently supported). | + + > **Note**: If candles cannot be found for the given symbol/time period, a response with empty arrays will be provided. eg: `{ "s": "ok", "t": [], "c": [], "o": [], "h": [], "l": [], "v": [] }` + +##### Error Responses + +| Status Code | Error Message | Description | +| :---------- | :-------------------------------------------------------------------------------------------------------------------------------------------------------- | :----------------------------------------------- | +| `400` | `Parse error xxx: missing required field` | A required parameter was missing. | +| `401` | `Unauthorized - Authorization header is required \|\| Invalid authorization header format \|\| token signature is invalid: signature is invalid \|\| ...` | The authorization header was missing or invalid. | +| `404` | `Not found- Could not find feedID for symbol` | The provided symbol is not supported. | +| `500` | `Something went wrong. Please try again later.` | An unexpected server error occurred. | + +### Get candlestick data (row format) + +##### Endpoint + +**`/api/v1/history/rows`** + +| Type | Description | Parameter(s) | +| :------- | :----------------------------------- | :-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| HTTP GET | Gets candlestick data in row format. |
  • `symbol`: The symbol to query.
  • `resolution`: Resolution of the data (required but not used, use "1m").
  • `from`: Unix timestamp of the leftmost required bar (inclusive).
  • `to`: Unix timestamp of the rightmost required bar (inclusive).
| + +##### Sample request + +```bash +curl -X GET \ + -H "Authorization: Bearer {YOUR_ACCESS_TOKEN}" \ + "https://priceapi.testnet-dataengine.chain.link/api/v1/history/rows?symbol=ETHUSD&resolution=1m&from=1746072068&to=1746158468" +``` + +##### Response + +- **Status**: `200` + + ```json + { + "s": "ok", + "candles": [ + [1746158460, 1.8483674e21, 1.8498753129131415e21, 1.8468008021426886e21, 1.84685e21, 0], + [1746158400, 1.848602513e21, 1.848875387e21, 1.848243519e21, 1.848515087189567e21, 0], + [1746158340, 1.8481267e21, 1.8490380305e21, 1.8475677870725296e21, 1.8490380305e21, 0] + ] + } + ``` + + | Field | Type | Description | + | :-------- | :------- | :-------------------------------------------------------------------------------------------------- | + | `s` | `string` | The status of the request. | + | `candles` | `array` | Array of arrays of numbers. Each array candle contains: `[ time, open, high, low, close, volume ]`. | + + > **Note**: If candles cannot be found for the given symbol/time period, a response with an empty `candles` array is provided. eg: `{ "s": "ok", "candles": [] }` + +##### Error Responses + +| Status Code | Error Message | Description | +| :---------- | :-------------------------------------------------------------------------------------------------------------------------------------------------------- | :----------------------------------------------- | +| `400` | `Parse error xxx: missing required field` | A required parameter was missing. | +| `401` | `Unauthorized - Authorization header is required \|\| Invalid authorization header format \|\| token signature is invalid: signature is invalid \|\| ...` | The authorization header was missing or invalid. | +| `404` | `Not found- Could not find feedID for symbol` | The provided symbol is not supported. | +| `500` | `Something went wrong. Please try again later.` | An unexpected server error occurred. | + +### Get streaming price updates + +##### Endpoint + +**`/api/v1/streaming`** + +| Type | Description | Parameter(s) | +| :------- | :-------------------------------------------------------- | :----------------------------------------------------------------------------------------------- | +| HTTP GET | Gets streaming price updates using HTTP chunked encoding. |
  • `symbol` or `feedId`: A comma-separated list of symbols or feed IDs to stream.
| + +##### Sample request + +```bash +curl -X GET \ + -H "Authorization: Bearer {YOUR_ACCESS_TOKEN}" \ + -H "Connection: keep-alive" \ + "https://priceapi.testnet-dataengine.chain.link/api/v1/streaming?symbol=ETHUSD,BTCUSD" +``` + +##### Response + +- **Status**: `200` (Streaming) + + A stream of JSON objects. + + **Trade Response:** + + ```json + { + "f": "t", + "i": "ETHUSD", + "fid": "[FEED_ID]", + "p": 2.68312e21, + "t": 1748525526, + "s": 1 + } + ``` + + | Field | Type | Description | + | :---- | :-------- | :------------------------------------------------------------- | + | `f` | `string` | Message type. Will always be “t” to indicate a trade response. | + | `i` | `string` | Identifier. The symbol for this response. | + | `fid` | `string` | The hex-encoded feed ID for this response. | + | `p` | `float64` | The latest price update for the symbol/feedId. | + | `t` | `float64` | The time of the price as a unix timestamp. | + | `s` | `float64` | Size of the trade. This will always be 1. | + + **Heartbeat (sent every 5 seconds):** + + ```json + { "heartbeat": 1748525528 } + ``` + + | Field | Type | Description | + | :---------- | :-------- | :----------------------------------------------------- | + | `heartbeat` | `float64` | The time of the heartbeat message as a unix timestamp. | + +##### Error Responses + +| Status Code | Error Message | Description | +| :---------- | :-------------------------------------------------------------------------------------------------------------------------------------------------------- | :----------------------------------------------- | +| `400` | `Parse error xxx: One of symbol or feedId must be provided` | A required parameter was missing. | +| `401` | `Unauthorized - Authorization header is required \|\| Invalid authorization header format \|\| token signature is invalid: signature is invalid \|\| ...` | The authorization header was missing or invalid. | +| `404` | `Not found- Could not find feedID for symbol` | The provided symbol is not supported. | +| `500` | `Something went wrong. Please try again later.` | An unexpected server error occurred. | diff --git a/src/content/data-streams/reference/price-api.mdx b/src/content/data-streams/reference/price-api.mdx deleted file mode 100644 index c1c29a1d099..00000000000 --- a/src/content/data-streams/reference/price-api.mdx +++ /dev/null @@ -1,214 +0,0 @@ ---- -section: dataStreams -date: Last Modified -title: "Data Streams Price API" -metadata: - title: "Data Streams Price API Reference | Chainlink Documentation" - description: "Reference for the Chainlink Data Streams Price API. Learn how to authenticate, list available symbols, query historical candlestick (OHLC) data, and stream live price updates over HTTP." - keywords: ["Candlestick API", "Price API", "OHLC", "HTTP Rest API", "API Client", "Trading View API"] ---- - -import DataStreams from "@features/data-streams/common/DataStreams.astro" - - - -PriceAPI is designed and implemented to satisfy the [TradingView implementation spec](https://www.tradingview.com/broker-api-docs/rest-api-spec/#tag/Data-Integration), the industry standard to share aggregated trading data. - -Alignment to the TradingView spec allows for trading view integration and direct customer access to prices without resorting to consuming and decoding reports for non-transactional use cases, like dashboards, analytics platforms, portfolio trackers, research tools, and more. - -{/* TODO: specify mainnet and testnet domains */} - -## Domains - -| Description | Testnet URL | Mainnet URL | -| ------------------ | ------------------------------------------------ | ---------------------------------------- | -| Price API endpoint | `https://priceapi.testnet-dataengine.chain.link` | `https://priceapi.dataengine.chain.link` | - -## API Endpoints - -### Authorize and get token - -##### Endpoint - -**`/api/v1/authorize`** - -| Type | Description | Parameter(s) | -| :-------- | :------------------------------------------------ | :------------------------------------------------------------------------------ | -| HTTP POST | Authorizes a user and returns a JWT access token. |
  • `login`: The user ID.
  • `password`: The user's API key.
| - -##### Sample request - -```bash -curl -X POST \ - -H "Content-Type: application/x-www-form-urlencoded" \ - -d "login={YOUR_USER_ID}&password={YOUR_API_KEY}" \ - https://priceapi.testnet-dataengine.chain.link/api/v1/authorize -``` - -##### Sample response - -```json -{ - "d": { - "access_token": "[ACCESS_TOKEN]", // JWT token for subsequent requests - "expiration": 1747203979 - }, - "s": "ok" -} -``` - -### Get list of supported symbols - -##### Endpoint - -**`/api/v1/symbol_info`** - -| Type | Description | Parameter(s) | -| :------- | :------------------------------------------------------- | :----------------------------------------------------------------------------------------------- | -| HTTP GET | Gets a list of all supported symbols on the environment. |
  • `group` (optional): Filter symbols by group. Currently only supports "crypto".
| - -##### Sample request - -```bash -curl -X GET \ - -H "Authorization: Bearer {YOUR_ACCESS_TOKEN}" \ - https://priceapi.testnet-dataengine.chain.link/api/v1/symbol_info -``` - -##### Sample response - -```json -{ - "s": "ok", - "symbol": ["ETHUSD", "BTCUSD"], - "currency": ["USD", "USD"], - "base-currency": ["ETH", "BTC"] -} -``` - -### Get candlestick data (column format) - -##### Endpoint - -**`/api/v1/history`** - -| Type | Description | Parameter(s) | -| :------- | :-------------------------------------- | :-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -| HTTP GET | Gets candlestick data in column format. |
  • `symbol`: The symbol to query.
  • `resolution`: Resolution of the data (required but not used, use "1m").
  • `from`: Unix timestamp of the leftmost required bar (inclusive).
  • `to`: Unix timestamp of the rightmost required bar (inclusive).
| - -**Note**: The resolution of the data is based on the size of the time window: - -| 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 | - -##### Sample request - -```bash -curl -X GET \ - -H "Authorization: Bearer {YOUR_ACCESS_TOKEN}" \ - "https://priceapi.testnet-dataengine.chain.link/api/v1/history?symbol=ETHUSD&resolution=1m&from=1746072068&to=1746158468" -``` - -##### Sample response - -```json -{ - "s": "ok", - "t": [1746158460, 1746158400, 1746158340], - "c": [1.84685e21, 1.848515087189567e21, 1.8490380305e21, 1.8481266e21], - "o": [1.8483674e21, 1.848602513e21, 1.8481267e21], - "h": [1.8498753129131415e21, 1.848875387e21, 1.8490380305e21], - "l": [1.8468008021426886e21, 1.848243519e21, 1.8475677870725296e21], - "v": [] -} -``` - -### Get candlestick data (row format) - -##### Endpoint - -**`/api/v1/history/rows`** - -| Type | Description | Parameter(s) | -| :------- | :----------------------------------- | :-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -| HTTP GET | Gets candlestick data in row format. |
  • `symbol`: The symbol to query.
  • `resolution`: Resolution of the data (required but not used, use "1m").
  • `from`: Unix timestamp of the leftmost required bar (inclusive).
  • `to`: Unix timestamp of the rightmost required bar (inclusive).
| - -##### Sample request - -```bash -curl -X GET \ - -H "Authorization: Bearer {YOUR_ACCESS_TOKEN}" \ - "https://priceapi.testnet-dataengine.chain.link/api/v1/history/rows?symbol=ETHUSD&resolution=1m&from=1746072068&to=1746158468" -``` - -##### Sample response - -```json -{ - "s": "ok", - "candles": [ - [1746158460, 1.8483674e21, 1.8498753129131415e21, 1.8468008021426886e21, 1.84685e21, 0], - [1746158400, 1.848602513e21, 1.848875387e21, 1.848243519e21, 1.848515087189567e21, 0], - [1746158340, 1.8481267e21, 1.8490380305e21, 1.8475677870725296e21, 1.8490380305e21, 0] - ] -} -``` - -### Get streaming price updates - -##### Endpoint - -**`/api/v1/streaming`** - -| Type | Description | Parameter(s) | -| :------- | :-------------------------------------------------------- | :----------------------------------------------------------------------------------------------- | -| HTTP GET | Gets streaming price updates using HTTP chunked encoding. |
  • `symbol` or `feedId`: A comma-separated list of symbols or feed IDs to stream.
| - -##### Sample request - -```bash -curl -X GET \ - -H "Authorization: Bearer {YOUR_ACCESS_TOKEN}" \ - -H "Connection: keep-alive" \ - "https://priceapi.testnet-dataengine.chain.link/api/v1/streaming?symbol=ETHUSD,BTCUSD" -``` - -##### Sample response (Streaming) - -A stream of JSON objects. - -**Trade Response:** - -```json -{ - "f": "t", - "i": "ETHUSD", - "fid": "[FEED_ID]", // Hex encoded feed ID - "p": 2.68312e21, - "t": 1748525526, - "s": 1 -} -``` - -**Heartbeat (sent every 5 seconds):** - -```json -{ "heartbeat": 1748525528 } -``` - ---- - -## Error Response Codes - -| Status Code | Description | -| :---------------------- | :---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -| **400 Bad Request** | This error is triggered when:
  • Required parameters are missing or malformed.
  • Invalid parameter values are provided.
| -| **401 Unauthorized** | This error is triggered when:
  • The authorization header is missing or invalid.
  • The access token is expired or malformed.
  • Invalid credentials were provided during authorization.
| -| **404 Not Found** | This error is triggered when:
  • The requested symbol is not supported.
  • A user is not found during authorization.
| -| **500 Internal Server** | Indicates an unexpected condition was encountered by the server, preventing it from fulfilling the request. This error typically points to issues on the server side. | From 5875785e8634b59fdc69b0fcb4f8becdd4a0b393 Mon Sep 17 00:00:00 2001 From: Devin DiStefano Date: Fri, 1 Aug 2025 10:16:15 -0700 Subject: [PATCH 04/14] nit --- src/content/data-streams/reference/candlestick-api.mdx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/content/data-streams/reference/candlestick-api.mdx b/src/content/data-streams/reference/candlestick-api.mdx index 25ee0d76390..0592acad2a5 100644 --- a/src/content/data-streams/reference/candlestick-api.mdx +++ b/src/content/data-streams/reference/candlestick-api.mdx @@ -12,7 +12,7 @@ import DataStreams from "@features/data-streams/common/DataStreams.astro" -The Candlestick API is designed and implemented to satisfy the [TradingView implementation spec](https://www.tradingview.com/broker-api-docs/rest-api-spec/#tag/Data-Integration), the industry standard for sharing aggregated trading data. +The Candlestick API is designed and implemented to satisfy the [TradingView implementation spec](https://www.tradingview.com/broker-api-docs/rest-api-spec/#tag/Data-Integration), the industry standard for sharing open-high-low-close (OHLC) aggregated trading data. Alignment with the TradingView spec allows for TradingView integration and direct customer access to prices without resorting to consuming and decoding reports for non-transactional use cases, like dashboards, analytics platforms, portfolio trackers, research tools, and more. From 132bdabd108294e41f0217ade70b06f2f384ce8d Mon Sep 17 00:00:00 2001 From: Devin DiStefano Date: Fri, 1 Aug 2025 10:27:09 -0700 Subject: [PATCH 05/14] NIT --- src/content/data-streams/reference/candlestick-api.mdx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/content/data-streams/reference/candlestick-api.mdx b/src/content/data-streams/reference/candlestick-api.mdx index 0592acad2a5..5d8eefb9266 100644 --- a/src/content/data-streams/reference/candlestick-api.mdx +++ b/src/content/data-streams/reference/candlestick-api.mdx @@ -128,7 +128,7 @@ curl -X GET \ | :------- | :-------------------------------------- | :-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | | HTTP GET | Gets candlestick data in column format. |
  • `symbol`: The symbol to query.
  • `resolution`: Resolution of the data (required but not used, use "1m").
  • `from`: Unix timestamp of the leftmost required bar (inclusive).
  • `to`: Unix timestamp of the rightmost required bar (inclusive).
| -**Note**: The resolution of the data is based on the size of the time window: +**Note**: The resolution of the data is currently based on the size of the time window: | Max time window size | Resolution of candles | | :------------------- | :-------------------- | From 6a5e856535d9e38dce51a481898b918595a40345 Mon Sep 17 00:00:00 2001 From: Devin DiStefano Date: Fri, 1 Aug 2025 11:51:38 -0700 Subject: [PATCH 06/14] reorganize sidebar: isolate candlestick + data streams api for clarity --- src/config/sidebar.ts | 64 ++++++++++--------- src/content/data-streams/architecture.mdx | 2 +- .../developer-responsibilities.mdx | 4 +- src/content/data-streams/index.mdx | 8 +-- .../index.mdx} | 2 +- .../authentication/go-examples.mdx | 8 +-- .../authentication/index.mdx | 25 ++++---- .../authentication/javascript-examples.mdx | 4 +- .../authentication/rust-examples.mdx | 8 +-- .../authentication/typescript-examples.mdx | 4 +- .../{ => data-streams-api}/go-sdk.mdx | 8 +-- .../reference/data-streams-api/index.mdx | 43 +++++++++++++ .../{ => data-streams-api}/interface-api.mdx | 4 +- .../{ => data-streams-api}/interface-ws.mdx | 4 +- .../onchain-verification.mdx | 0 .../data-streams/reference/overview.mdx | 41 ++++++------ .../data-streams/reference/rust-sdk.mdx | 4 +- src/content/data-streams/tutorials/api-go.mdx | 8 +-- .../data-streams/tutorials/api-rust.mdx | 4 +- .../data-streams/tutorials/api-rwa-go.mdx | 8 +-- .../data-streams/tutorials/api-rwa-rust.mdx | 4 +- .../evm-onchain-report-verification.mdx | 2 +- .../data-streams/tutorials/overview.mdx | 11 ++-- src/content/data-streams/tutorials/ws-go.mdx | 10 +-- .../data-streams/tutorials/ws-rust.mdx | 4 +- .../data-streams/tutorials/ws-rwa-go.mdx | 10 +-- .../data-streams/tutorials/ws-rwa-rust.mdx | 4 +- .../common/asideOnChainVerification.mdx | 2 +- src/features/redirects/redirects.json | 30 +++++++++ 29 files changed, 203 insertions(+), 127 deletions(-) rename src/content/data-streams/reference/{candlestick-api.mdx => candlestick-api/index.mdx} (98%) rename src/content/data-streams/reference/{ => data-streams-api}/authentication/go-examples.mdx (96%) rename src/content/data-streams/reference/{ => data-streams-api}/authentication/index.mdx (86%) rename src/content/data-streams/reference/{ => data-streams-api}/authentication/javascript-examples.mdx (98%) rename src/content/data-streams/reference/{ => data-streams-api}/authentication/rust-examples.mdx (97%) rename src/content/data-streams/reference/{ => data-streams-api}/authentication/typescript-examples.mdx (98%) rename src/content/data-streams/reference/{ => data-streams-api}/go-sdk.mdx (97%) create mode 100644 src/content/data-streams/reference/data-streams-api/index.mdx rename src/content/data-streams/reference/{ => data-streams-api}/interface-api.mdx (98%) rename src/content/data-streams/reference/{ => data-streams-api}/interface-ws.mdx (97%) rename src/content/data-streams/reference/{ => data-streams-api}/onchain-verification.mdx (100%) diff --git a/src/config/sidebar.ts b/src/config/sidebar.ts index 335910bac5e..d73439b0b05 100644 --- a/src/config/sidebar.ts +++ b/src/config/sidebar.ts @@ -434,47 +434,53 @@ export const SIDEBAR: Partial> = { url: "data-streams/reference/overview", }, { - title: "Data Streams REST API", - url: "data-streams/reference/interface-api", - }, - { - title: "Candlestick REST API", - url: "data-streams/reference/candlestick-api", - }, - { - title: "WebSocket", - url: "data-streams/reference/interface-ws", - }, - { - title: "Authentication", - url: "data-streams/reference/authentication", + title: "Data Streams API", + url: "data-streams/reference/data-streams-api", children: [ { - title: "JavaScript examples", - url: "data-streams/reference/authentication/javascript-examples", + title: "Authentication", + url: "data-streams/reference/data-streams-api/authentication", + children: [ + { + title: "JavaScript examples", + url: "data-streams/reference/data-streams-api/authentication/javascript-examples", + }, + { + title: "TypeScript examples", + url: "data-streams/reference/data-streams-api/authentication/typescript-examples", + }, + { + title: "Go examples", + url: "data-streams/reference/data-streams-api/authentication/go-examples", + }, + { + title: "Rust examples", + url: "data-streams/reference/data-streams-api/authentication/rust-examples", + }, + ], + }, + { + title: "API Reference", + url: "data-streams/reference/data-streams-api/interface-api", }, { - title: "TypeScript examples", - url: "data-streams/reference/authentication/typescript-examples", + title: "WebSocket Reference", + url: "data-streams/reference/data-streams-api/interface-ws", }, { - title: "Go examples", - url: "data-streams/reference/authentication/go-examples", + title: "SDK References", + url: "data-streams/reference/data-streams-api/go-sdk", + highlightAsCurrent: ["data-streams/reference/data-streams-api/rust-sdk"], }, { - title: "Rust examples", - url: "data-streams/reference/authentication/rust-examples", + title: "Onchain report verification (EVM chains)", + url: "data-streams/reference/data-streams-api/onchain-verification", }, ], }, { - title: "SDK References", - url: "data-streams/reference/go-sdk", - highlightAsCurrent: ["data-streams/reference/rust-sdk"], - }, - { - title: "Onchain report verification (EVM chains)", - url: "data-streams/reference/onchain-verification", + title: "Candlestick API", + url: "data-streams/reference/candlestick-api", }, ], }, diff --git a/src/content/data-streams/architecture.mdx b/src/content/data-streams/architecture.mdx index 47ad5909dae..231f03df117 100644 --- a/src/content/data-streams/architecture.mdx +++ b/src/content/data-streams/architecture.mdx @@ -123,7 +123,7 @@ Read the [Getting Started](/data-streams/getting-started) guide to learn how to Active-active is a system configuration strategy where redundant systems remain active simultaneously to serve requests. Incoming requests are distributed across all active resources and load-balanced to provide high availability, scalability, and fault tolerance. This strategy is the opposite of active-passive where a secondary system remains inactive until the primary system fails. -The Data Streams API services use an active-active setup as a highly available and resilient architecture across multiple distributed and fully isolated origins. This setup ensures that the services are operational even if one origin fails, which provides robust fault tolerance and high availability. This configuration applies to both the [REST API](/data-streams/reference/interface-api) and the [WebSocket API](/data-streams/reference/interface-ws). A global load balancer seamlessly manages the system to provide automated and transparent failovers. For advanced use cases, the service publishes available origins using HTTP headers, which enables you to interact directly with specific origin locations if necessary. +The Data Streams API services use an active-active setup as a highly available and resilient architecture across multiple distributed and fully isolated origins. This setup ensures that the services are operational even if one origin fails, which provides robust fault tolerance and high availability. This configuration applies to both the [REST API](/data-streams/reference/data-streams-api/interface-api) and the [WebSocket API](/data-streams/reference/data-streams-api/interface-ws). A global load balancer seamlessly manages the system to provide automated and transparent failovers. For advanced use cases, the service publishes available origins using HTTP headers, which enables you to interact directly with specific origin locations if necessary. ### Active-Active Setup diff --git a/src/content/data-streams/developer-responsibilities.mdx b/src/content/data-streams/developer-responsibilities.mdx index db352e26ccd..2ccb68ee2b2 100644 --- a/src/content/data-streams/developer-responsibilities.mdx +++ b/src/content/data-streams/developer-responsibilities.mdx @@ -85,8 +85,8 @@ Developers implementing Chainlink Data Streams are solely responsible for instit - **Code dependencies and imports:** Developers are responsible for ensuring the quality, reliability, and security of any dependencies or imported packages that they use with Chainlink Data Streams, and review and audit these dependencies and packages. - **Implementing Contingency Logic:** In extreme circumstances, including situations beyond the control of Chainlink node operators, Chainlink Data Streams may experience periods of unavailability or performance degradation. When a WebSocket connection is dropped, user systems must manage reconnections effectively. Developers are responsible for creating contingency plans tailored to their specific application needs, such as: - Implementing the [Data Streams Architecture](/data-streams/architecture), - - Adopting an [active-active](/data-streams/architecture#active-active-multi-site-deployment) deployment strategy and [configuring the SDK](/data-streams/reference/go-sdk#config-struct) to support multiple concurrent WebSocket connections, - - Retrieving any potentially missing reports via the [REST API](/data-streams/reference/interface-api). + - Adopting an [active-active](/data-streams/architecture#active-active-multi-site-deployment) deployment strategy and [configuring the SDK](/data-streams/reference/data-streams-api/go-sdk#config-struct) to support multiple concurrent WebSocket connections, + - Retrieving any potentially missing reports via the [REST API](/data-streams/reference/data-streams-api/interface-api). ### Additional Considerations on Data Usage and Verification diff --git a/src/content/data-streams/index.mdx b/src/content/data-streams/index.mdx index d74fd0662a3..f126bd2b511 100644 --- a/src/content/data-streams/index.mdx +++ b/src/content/data-streams/index.mdx @@ -78,9 +78,9 @@ You can access Chainlink Data Streams through SDKs and APIs, allowing you to bui Access data directly through REST APIs or WebSocket connections using our SDKs: -- **[Go SDK](/data-streams/reference/go-sdk)** - Full-featured SDK with comprehensive examples -- **[Rust SDK](/data-streams/reference/rust-sdk)** - High-performance SDK for Rust applications -- **[REST API](/data-streams/reference/interface-api)** or **[WebSocket](/data-streams/reference/interface-ws)** - Direct access to Data Streams endpoints +- **[Go SDK](/data-streams/reference/data-streams-api/go-sdk)** - Full-featured SDK with comprehensive examples +- **[Rust SDK](/data-streams/reference/data-streams-api/rust-sdk)** - High-performance SDK for Rust applications +- **[REST API](/data-streams/reference/data-streams-api/interface-api)** or **[WebSocket](/data-streams/reference/data-streams-api/interface-ws)** - Direct access to Data Streams endpoints ### Getting started @@ -90,7 +90,7 @@ Access data directly through REST APIs or WebSocket connections using our SDKs: 1. Try the API: Follow our [hands-on tutorial](/data-streams/tutorials/api-go) to fetch and decode your first report. -1. Implement Verification: Add [onchain verification](/data-streams/reference/onchain-verification) to ensure data authenticity in your smart contracts. +1. Implement Verification: Add [onchain verification](/data-streams/reference/data-streams-api/onchain-verification) to ensure data authenticity in your smart contracts. ### Streams Trade: An alternative implementation diff --git a/src/content/data-streams/reference/candlestick-api.mdx b/src/content/data-streams/reference/candlestick-api/index.mdx similarity index 98% rename from src/content/data-streams/reference/candlestick-api.mdx rename to src/content/data-streams/reference/candlestick-api/index.mdx index 5d8eefb9266..0e06902869e 100644 --- a/src/content/data-streams/reference/candlestick-api.mdx +++ b/src/content/data-streams/reference/candlestick-api/index.mdx @@ -12,7 +12,7 @@ import DataStreams from "@features/data-streams/common/DataStreams.astro" -The Candlestick API is designed and implemented to satisfy the [TradingView implementation spec](https://www.tradingview.com/broker-api-docs/rest-api-spec/#tag/Data-Integration), the industry standard for sharing open-high-low-close (OHLC) aggregated trading data. +The Candlestick API is designed and implemented to satisfy [TradingView data integration specifications](https://www.tradingview.com/broker-api-docs/rest-api-spec/#tag/Data-Integration), the industry standard for sharing open-high-low-close (OHLC) aggregated trading data. Alignment with the TradingView spec allows for TradingView integration and direct customer access to prices without resorting to consuming and decoding reports for non-transactional use cases, like dashboards, analytics platforms, portfolio trackers, research tools, and more. diff --git a/src/content/data-streams/reference/authentication/go-examples.mdx b/src/content/data-streams/reference/data-streams-api/authentication/go-examples.mdx similarity index 96% rename from src/content/data-streams/reference/authentication/go-examples.mdx rename to src/content/data-streams/reference/data-streams-api/authentication/go-examples.mdx index 13b9b6a54de..e51d4aec446 100644 --- a/src/content/data-streams/reference/authentication/go-examples.mdx +++ b/src/content/data-streams/reference/data-streams-api/authentication/go-examples.mdx @@ -15,9 +15,9 @@ import DataStreams from "@features/data-streams/common/DataStreams.astro" Below are complete examples for authenticating with the Data Streams API in Go. Each example shows how to properly generate the required headers and make a request. -To learn more about the Data Streams API authentication, see the [Data Streams Authentication](/data-streams/reference/authentication) page. +To learn more about the Data Streams API authentication, see the [Data Streams Authentication](/data-streams/reference/data-streams-api/authentication) page. -**Note**: The Data Streams SDKs handle authentication automatically. If you're using the [Go SDK](/data-streams/reference/go-sdk) or [Rust SDK](/data-streams/reference/rust-sdk), you don't need to implement the authentication logic manually. +**Note**: The Data Streams SDKs handle authentication automatically. If you're using the [Go SDK](/data-streams/reference/data-streams-api/go-sdk) or [Rust SDK](/data-streams/reference/data-streams-api/rust-sdk), you don't need to implement the authentication logic manually. ## API Authentication Example @@ -223,7 +223,7 @@ While this example demonstrates the authentication mechanism, production applica - **Error types**: Define custom error types for better error handling - **Testing**: Add unit tests for HMAC generation and integration tests -For production use, consider using the [Go SDK](/data-streams/reference/go-sdk) which handles authentication automatically and provides built-in fault tolerance. +For production use, consider using the [Go SDK](/data-streams/reference/data-streams-api/go-sdk) which handles authentication automatically and provides built-in fault tolerance. ## WebSocket Authentication Example @@ -508,4 +508,4 @@ While this example already includes many production-ready features (keepalive, t - **Health checks**: Expose WebSocket connection status for monitoring systems - **Testing**: Add unit tests for HMAC generation and mock WebSocket server for integration tests -For production use, consider using the [Go SDK](/data-streams/reference/go-sdk) which handles authentication automatically and provides built-in fault tolerance for streaming connections. +For production use, consider using the [Go SDK](/data-streams/reference/data-streams-api/go-sdk) which handles authentication automatically and provides built-in fault tolerance for streaming connections. diff --git a/src/content/data-streams/reference/authentication/index.mdx b/src/content/data-streams/reference/data-streams-api/authentication/index.mdx similarity index 86% rename from src/content/data-streams/reference/authentication/index.mdx rename to src/content/data-streams/reference/data-streams-api/authentication/index.mdx index dbc96df440d..1d754cbeb85 100644 --- a/src/content/data-streams/reference/authentication/index.mdx +++ b/src/content/data-streams/reference/data-streams-api/authentication/index.mdx @@ -8,10 +8,10 @@ metadata: keywords: ["Authentication", "HMAC", "API Key", "API Secret", "Signature", "Security", "Data Streams"] whatsnext: { - "Learn about the REST API Interface": "/data-streams/reference/interface-api", - "Learn about the WebSocket Interface": "/data-streams/reference/interface-ws", - "Explore the Go SDK": "/data-streams/reference/go-sdk", - "Explore the Rust SDK": "/data-streams/reference/rust-sdk", + "Learn about the REST API Interface": "/data-streams/reference/data-streams-api/interface-api", + "Learn about the WebSocket Interface": "/data-streams/reference/data-streams-api/interface-ws", + "Explore the Go SDK": "/data-streams/reference/data-streams-api/go-sdk", + "Explore the Rust SDK": "/data-streams/reference/data-streams-api/rust-sdk", } isIndex: true --- @@ -26,8 +26,9 @@ This page explains how to authenticate with the Chainlink Data Streams API, cove ## Authentication Requirements @@ -114,10 +115,10 @@ Even for GET requests and WebSocket connections, you need to include a body hash Below are complete examples for authenticating with the Data Streams API in various languages. Each example shows how to properly generate the required headers and make a request. -- [JavaScript examples](/data-streams/reference/authentication/javascript-examples) -- [TypeScript examples](/data-streams/reference/authentication/typescript-examples) -- [Go examples](/data-streams/reference/authentication/go-examples) -- [Rust examples](/data-streams/reference/authentication/rust-examples) +- [JavaScript examples](/data-streams/reference/data-streams-api/authentication/javascript-examples) +- [TypeScript examples](/data-streams/reference/data-streams-api/authentication/typescript-examples) +- [Go examples](/data-streams/reference/data-streams-api/authentication/go-examples) +- [Rust examples](/data-streams/reference/data-streams-api/authentication/rust-examples) ## Common Authentication Errors @@ -130,8 +131,8 @@ When working with the Data Streams API, the most common authentication issues in For complete information on all possible error responses: -- [REST API Error Response Codes](/data-streams/reference/interface-api#error-response-codes) -- [WebSocket Error Response Codes](/data-streams/reference/interface-ws#error-response-codes) +- [REST API Error Response Codes](/data-streams/reference/data-streams-api/interface-api#error-response-codes) +- [WebSocket Error Response Codes](/data-streams/reference/data-streams-api/interface-ws#error-response-codes) ## Troubleshooting Authentication diff --git a/src/content/data-streams/reference/authentication/javascript-examples.mdx b/src/content/data-streams/reference/data-streams-api/authentication/javascript-examples.mdx similarity index 98% rename from src/content/data-streams/reference/authentication/javascript-examples.mdx rename to src/content/data-streams/reference/data-streams-api/authentication/javascript-examples.mdx index f0b5384435d..ed71c834d58 100644 --- a/src/content/data-streams/reference/authentication/javascript-examples.mdx +++ b/src/content/data-streams/reference/data-streams-api/authentication/javascript-examples.mdx @@ -15,9 +15,9 @@ import DataStreams from "@features/data-streams/common/DataStreams.astro" Below are complete examples for authenticating with the Data Streams API in JavaScript, using Node.js. Each example shows how to properly generate the required headers and make a request. -To learn more about the Data Streams API authentication, see the [Data Streams Authentication](/data-streams/reference/authentication) page. +To learn more about the Data Streams API authentication, see the [Data Streams Authentication](/data-streams/reference/data-streams-api/authentication) page. -**Note**: The Data Streams SDKs handle authentication automatically. If you're using the [Go SDK](/data-streams/reference/go-sdk) or [Rust SDK](/data-streams/reference/rust-sdk), you don't need to implement the authentication logic manually. +**Note**: The Data Streams SDKs handle authentication automatically. If you're using the [Go SDK](/data-streams/reference/data-streams-api/go-sdk) or [Rust SDK](/data-streams/reference/data-streams-api/rust-sdk), you don't need to implement the authentication logic manually. ## API Authentication Example diff --git a/src/content/data-streams/reference/authentication/rust-examples.mdx b/src/content/data-streams/reference/data-streams-api/authentication/rust-examples.mdx similarity index 97% rename from src/content/data-streams/reference/authentication/rust-examples.mdx rename to src/content/data-streams/reference/data-streams-api/authentication/rust-examples.mdx index 05dd5f2628f..cb5ce048b26 100644 --- a/src/content/data-streams/reference/authentication/rust-examples.mdx +++ b/src/content/data-streams/reference/data-streams-api/authentication/rust-examples.mdx @@ -15,9 +15,9 @@ import DataStreams from "@features/data-streams/common/DataStreams.astro" Below are complete examples for authenticating with the Data Streams API in Rust. Each example shows how to properly generate the required headers and make a request. -To learn more about the Data Streams API authentication, see the [Data Streams Authentication](/data-streams/reference/authentication) page. +To learn more about the Data Streams API authentication, see the [Data Streams Authentication](/data-streams/reference/data-streams-api/authentication) page. -**Note**: The Data Streams SDKs handle authentication automatically. If you're using the [Go SDK](/data-streams/reference/go-sdk) or [Rust SDK](/data-streams/reference/rust-sdk), you don't need to implement the authentication logic manually. +**Note**: The Data Streams SDKs handle authentication automatically. If you're using the [Go SDK](/data-streams/reference/data-streams-api/go-sdk) or [Rust SDK](/data-streams/reference/data-streams-api/rust-sdk), you don't need to implement the authentication logic manually. ## API Authentication Example @@ -229,7 +229,7 @@ While this example demonstrates the authentication mechanism, production applica - **Resource management**: Implement graceful shutdown for long-running connections - **Testing**: Add unit tests for HMAC generation and integration tests for API calls -For production use, consider using the [Rust SDK](/data-streams/reference/rust-sdk) which handles authentication automatically and provides built-in fault tolerance. +For production use, consider using the [Rust SDK](/data-streams/reference/data-streams-api/rust-sdk) which handles authentication automatically and provides built-in fault tolerance. ## WebSocket Authentication Example @@ -530,4 +530,4 @@ While this example demonstrates WebSocket authentication, production application - **Graceful shutdown**: Properly close WebSocket connections with close frames - **Testing**: Add tests for connection handling and message parsing -For production use, consider using the [Rust SDK](/data-streams/reference/rust-sdk) which handles authentication automatically and provides built-in fault tolerance. +For production use, consider using the [Rust SDK](/data-streams/reference/data-streams-api/rust-sdk) which handles authentication automatically and provides built-in fault tolerance. diff --git a/src/content/data-streams/reference/authentication/typescript-examples.mdx b/src/content/data-streams/reference/data-streams-api/authentication/typescript-examples.mdx similarity index 98% rename from src/content/data-streams/reference/authentication/typescript-examples.mdx rename to src/content/data-streams/reference/data-streams-api/authentication/typescript-examples.mdx index 7045a8746e8..ca48796733e 100644 --- a/src/content/data-streams/reference/authentication/typescript-examples.mdx +++ b/src/content/data-streams/reference/data-streams-api/authentication/typescript-examples.mdx @@ -15,9 +15,9 @@ import DataStreams from "@features/data-streams/common/DataStreams.astro" Below are complete examples for authenticating with the Data Streams API in TypeScript, using Node.js. Each example shows how to properly generate the required headers and make a request. -To learn more about the Data Streams API authentication, see the [Data Streams Authentication](/data-streams/reference/authentication) page. +To learn more about the Data Streams API authentication, see the [Data Streams Authentication](/data-streams/reference/data-streams-api/authentication) page. -**Note**: The Data Streams SDKs handle authentication automatically. If you're using the [Go SDK](/data-streams/reference/go-sdk) or [Rust SDK](/data-streams/reference/rust-sdk), you don't need to implement the authentication logic manually. +**Note**: The Data Streams SDKs handle authentication automatically. If you're using the [Go SDK](/data-streams/reference/data-streams-api/go-sdk) or [Rust SDK](/data-streams/reference/data-streams-api/rust-sdk), you don't need to implement the authentication logic manually. ## API Authentication Example diff --git a/src/content/data-streams/reference/go-sdk.mdx b/src/content/data-streams/reference/data-streams-api/go-sdk.mdx similarity index 97% rename from src/content/data-streams/reference/go-sdk.mdx rename to src/content/data-streams/reference/data-streams-api/go-sdk.mdx index d8d35a725b6..9cdadc65606 100644 --- a/src/content/data-streams/reference/go-sdk.mdx +++ b/src/content/data-streams/reference/data-streams-api/go-sdk.mdx @@ -24,12 +24,12 @@ import { PageTabs } from "@components" pages={[ { name: "Go SDK", - url: "/data-streams/reference/go-sdk", + url: "/data-streams/reference/data-streams-api/go-sdk", icon: "/images/tutorial-icons/go_logo_black.png", }, { name: "Rust SDK", - url: "/data-streams/reference/rust-sdk", + url: "/data-streams/reference/data-streams-api/rust-sdk", icon: "/images/tutorial-icons/rust_logo_blk.svg", }, ]} @@ -49,7 +49,7 @@ import streams "github.com/smartcontractkit/data-streams-sdk/go" #### `Client` interface -[Interface](https://github.com/smartcontractkit/data-streams-sdk/blob/main/go/client.go#L21) for interacting with the Data Streams API. Use the [`New`](/data-streams/reference/go-sdk#new) function to create a new instance of the client. +[Interface](https://github.com/smartcontractkit/data-streams-sdk/blob/main/go/client.go#L21) for interacting with the Data Streams API. Use the [`New`](/data-streams/reference/data-streams-api/go-sdk#new) function to create a new instance of the client. ###### Interface Methods @@ -141,7 +141,7 @@ type ReportPage struct { #### `ReportResponse` struct -Implements the report envelope that contains the full report payload, its stream ID and timestamps. Use the [`Decode`](/data-streams/reference/go-sdk#decode) function to decode the report payload. +Implements the report envelope that contains the full report payload, its stream ID and timestamps. Use the [`Decode`](/data-streams/reference/data-streams-api/go-sdk#decode) function to decode the report payload. ```go type ReportResponse struct { diff --git a/src/content/data-streams/reference/data-streams-api/index.mdx b/src/content/data-streams/reference/data-streams-api/index.mdx new file mode 100644 index 00000000000..632a323211f --- /dev/null +++ b/src/content/data-streams/reference/data-streams-api/index.mdx @@ -0,0 +1,43 @@ +--- +section: dataStreams +date: Last Modified +title: "Data Streams Reference" +isIndex: true +metadata: + title: "Data Streams Reference | API, SDK, and Integration Guide" + description: "Access comprehensive reference documentation for Chainlink Data Streams including API interfaces, SDK libraries, authentication guides, and report schemas." + keywords: ["Data Streams", "API Reference", "SDK", "WebSocket", "REST API", "Integration Guide"] +--- + +import DataStreams from "@features/data-streams/common/DataStreams.astro" + + + +### API Interfaces + +- [REST API](/data-streams/reference/data-streams-api/interface-api) - HTTP-based interface for simple integrations +- [WebSocket](/data-streams/reference/data-streams-api/interface-ws) - Real-time data streaming via WebSocket connection + +### SDK Integration + +- [Go SDK](/data-streams/reference/data-streams-api/go-sdk) - Native Go language integration +- [Rust SDK](/data-streams/reference/data-streams-api/rust-sdk) - Native Rust language integration + +### Authentication + +- [Authentication](/data-streams/reference/data-streams-api/authentication) - Learn how to authenticate with the Data Streams API (not required if using the SDKs) + - [JavaScript examples](/data-streams/reference/data-streams-api/authentication/javascript-examples) + - [TypeScript examples](/data-streams/reference/data-streams-api/authentication/typescript-examples) + - [Go examples](/data-streams/reference/data-streams-api/authentication/go-examples) + - [Rust examples](/data-streams/reference/data-streams-api/authentication/rust-examples) + +### Verification + +#### EVM chains + +- [Onchain report data verification](/data-streams/reference/data-streams-api/onchain-verification) - Verify the authenticity of received data on EVM chains + +#### Solana + +- [Verify reports using the onchain integration method](/data-streams/tutorials/solana-onchain-report-verification) +- [Verify reports using the offchain integration method](/data-streams/tutorials/solana-offchain-report-verification) diff --git a/src/content/data-streams/reference/interface-api.mdx b/src/content/data-streams/reference/data-streams-api/interface-api.mdx similarity index 98% rename from src/content/data-streams/reference/interface-api.mdx rename to src/content/data-streams/reference/data-streams-api/interface-api.mdx index 9507efeab0f..8ed0e63b881 100644 --- a/src/content/data-streams/reference/interface-api.mdx +++ b/src/content/data-streams/reference/data-streams-api/interface-api.mdx @@ -20,9 +20,9 @@ import DataStreams from "@features/data-streams/common/DataStreams.astro" ## Authentication -All requests to the Data Streams REST API require authentication. For comprehensive documentation on generating authentication headers and implementing the HMAC authentication process, please refer to the [Data Streams Authentication](/data-streams/reference/authentication) page. +All requests to the Data Streams REST API require authentication. For comprehensive documentation on generating authentication headers and implementing the HMAC authentication process, please refer to the [Data Streams Authentication](/data-streams/reference/data-streams-api/authentication) page. -**Note**: If you're using a [Data Streams SDK](/data-streams/reference/go-sdk), you don't need to manually generate authentication headers. +**Note**: If you're using a [Data Streams SDK](/data-streams/reference/data-streams-api/go-sdk), you don't need to manually generate authentication headers. ### Headers diff --git a/src/content/data-streams/reference/interface-ws.mdx b/src/content/data-streams/reference/data-streams-api/interface-ws.mdx similarity index 97% rename from src/content/data-streams/reference/interface-ws.mdx rename to src/content/data-streams/reference/data-streams-api/interface-ws.mdx index e9d15e0ac92..a642ace1f2c 100644 --- a/src/content/data-streams/reference/interface-ws.mdx +++ b/src/content/data-streams/reference/data-streams-api/interface-ws.mdx @@ -21,9 +21,9 @@ import DataStreams from "@features/data-streams/common/DataStreams.astro" ## Authentication -All connections to the Data Streams WebSocket API require authentication. For comprehensive documentation on generating authentication headers and implementing the HMAC authentication process, please refer to the [Data Streams Authentication](/data-streams/reference/authentication) page. +All connections to the Data Streams WebSocket API require authentication. For comprehensive documentation on generating authentication headers and implementing the HMAC authentication process, please refer to the [Data Streams Authentication](/data-streams/reference/data-streams-api/authentication) page. -**Note**: If you're using a [Data Streams SDK](/data-streams/reference/go-sdk), you don't need to manually generate authentication headers. +**Note**: If you're using a [Data Streams SDK](/data-streams/reference/data-streams-api/go-sdk), you don't need to manually generate authentication headers. ### Headers diff --git a/src/content/data-streams/reference/onchain-verification.mdx b/src/content/data-streams/reference/data-streams-api/onchain-verification.mdx similarity index 100% rename from src/content/data-streams/reference/onchain-verification.mdx rename to src/content/data-streams/reference/data-streams-api/onchain-verification.mdx diff --git a/src/content/data-streams/reference/overview.mdx b/src/content/data-streams/reference/overview.mdx index 32a5bc9e69c..067bf2f012f 100644 --- a/src/content/data-streams/reference/overview.mdx +++ b/src/content/data-streams/reference/overview.mdx @@ -4,40 +4,35 @@ date: Last Modified title: "Data Streams Reference" isIndex: true metadata: - title: "Data Streams Reference | API, SDK, and Integration Guide" + title: "Data Streams Reference" description: "Access comprehensive reference documentation for Chainlink Data Streams including API interfaces, SDK libraries, authentication guides, and report schemas." keywords: ["Data Streams", "API Reference", "SDK", "WebSocket", "REST API", "Integration Guide"] --- -import DataStreams from "@features/data-streams/common/DataStreams.astro" +Chainlink Data Streams offers two distinct APIs for accessing low-latency market data. Choose the API that best fits your use case. - +### Which API should I use? -### API Interfaces +| Feature | [Data Streams API](./data-streams-api) | [Candlestick API](./candlestick-api) | +| ----------------------- | ------------------------------------------- | --------------------------------------------- | +| **Primary Use Case** | **On-chain** consumption by smart contracts | **Off-chain** analytics, charting, dashboards | +| **Data Format** | Signed, verifiable data reports | Aggregated OHLC (candlestick) data | +| **Interfaces** | REST API & WebSocket | REST API (including a streaming endpoint) | +| **Authentication** | HMAC Signature | JWT (token-based) | +| **Cryptographic Proof** | ✅ Yes (`fullReport` blob) | ❌ No | -- [REST API](/data-streams/reference/interface-api) - HTTP-based interface for simple integrations -- [WebSocket](/data-streams/reference/interface-ws) - Real-time data streaming via WebSocket connection - -### SDK Integration - -- [Go SDK](/data-streams/reference/go-sdk) - Native Go language integration -- [Rust SDK](/data-streams/reference/rust-sdk) - Native Rust language integration +--- -### Authentication +### Data Streams API -- [Authentication](/data-streams/reference/authentication) - Learn how to authenticate with the Data Streams API (not required if using the SDKs) - - [JavaScript examples](/data-streams/reference/authentication/javascript-examples) - - [TypeScript examples](/data-streams/reference/authentication/typescript-examples) - - [Go examples](/data-streams/reference/authentication/go-examples) - - [Rust examples](/data-streams/reference/authentication/rust-examples) +Use the [Data Streams API](./data-streams-api) for applications that require high-frequency, verifiable data for **on-chain** execution. It provides access to cryptographically signed data reports that can be verified and used by smart contracts. This API is designed for applications that depend on low-latency, tamper-proof data. -### Verification +**[View the Data Streams API Reference](./data-streams-api/interface-api)** -#### EVM chains +--- -- [Onchain report data verification](/data-streams/reference/onchain-verification) - Verify the authenticity of received data on EVM chains +### Candlestick API -#### Solana +Use the [Candlestick API](./candlestick-api) for **off-chain** applications. It provides historical open-high-low-close (OHLC) data and real-time price updates in a format compatible with the [TradingView data integration specification](https://www.tradingview.com/broker-api-docs/rest-api-spec/#tag/Data-Integration). This is ideal for building dashboards, analytics platforms, portfolio trackers, and research tools. -- [Verify reports using the onchain integration method](/data-streams/tutorials/solana-onchain-report-verification) -- [Verify reports using the offchain integration method](/data-streams/tutorials/solana-offchain-report-verification) +**[View the Candlestick API Reference](./candlestick-api)** diff --git a/src/content/data-streams/reference/rust-sdk.mdx b/src/content/data-streams/reference/rust-sdk.mdx index 5e1277e4856..a57e34cc929 100644 --- a/src/content/data-streams/reference/rust-sdk.mdx +++ b/src/content/data-streams/reference/rust-sdk.mdx @@ -24,12 +24,12 @@ import { PageTabs } from "@components" pages={[ { name: "Go SDK", - url: "/data-streams/reference/go-sdk", + url: "/data-streams/reference/data-streams-api/go-sdk", icon: "/images/tutorial-icons/go_logo_black.png", }, { name: "Rust SDK", - url: "/data-streams/reference/rust-sdk", + url: "/data-streams/reference/data-streams-api/rust-sdk", icon: "/images/tutorial-icons/rust_logo_blk.svg", }, ]} diff --git a/src/content/data-streams/tutorials/api-go.mdx b/src/content/data-streams/tutorials/api-go.mdx index b6b6bdd7b4c..e762b7807d6 100644 --- a/src/content/data-streams/tutorials/api-go.mdx +++ b/src/content/data-streams/tutorials/api-go.mdx @@ -9,7 +9,7 @@ metadata: whatsnext: { "Learn how to stream and decode reports via a WebSocket connection": "/data-streams/tutorials/ws-go", - "Learn how to verify your data onchain": "/data-streams/reference/onchain-verification", + "Learn how to verify your data onchain": "/data-streams/reference/data-streams-api/onchain-verification", "Find the list of available Stream IDs": "/data-streams/crypto-streams", } --- @@ -44,7 +44,7 @@ import DataStreams from "@features/data-streams/common/DataStreams.astro" ]} /> -In this tutorial, you'll learn how to use the [Data Streams SDK](/data-streams/reference/go-sdk) for Go to fetch and decode [V3 reports](/data-streams/reference/report-schema-v3) for [Crypto streams](/data-streams/crypto-streams) from the Data Streams Aggregation Network. You'll set up your Go project, retrieve reports, decode them, and log their attributes. +In this tutorial, you'll learn how to use the [Data Streams SDK](/data-streams/reference/data-streams-api/go-sdk) for Go to fetch and decode [V3 reports](/data-streams/reference/report-schema-v3) for [Crypto streams](/data-streams/crypto-streams) from the Data Streams Aggregation Network. You'll set up your Go project, retrieve reports, decode them, and log their attributes. @@ -214,9 +214,9 @@ You'll start with the set up of your Go project. Next, you'll fetch and decode r Replace `` and `` with your API credentials. - - `RestURL` is the REST endpoint to poll for specific reports. See the [Data Streams Interface](/data-streams/reference/interface-api#domains) page for more information. + - `RestURL` is the REST endpoint to poll for specific reports. See the [Data Streams Interface](/data-streams/reference/data-streams-api/interface-api#domains) page for more information. - See the [SDK Reference](/data-streams/reference/go-sdk#config-struct) page for more configuration options. + See the [SDK Reference](/data-streams/reference/data-streams-api/go-sdk#config-struct) page for more configuration options. 1. For this example, you will read from the ETH/USD crypto stream. This stream ID is . See the [Stream Addresses](/data-streams/crypto-streams) page for a complete list of available crypto assets. diff --git a/src/content/data-streams/tutorials/api-rust.mdx b/src/content/data-streams/tutorials/api-rust.mdx index d63e42d7f60..21710985e7f 100644 --- a/src/content/data-streams/tutorials/api-rust.mdx +++ b/src/content/data-streams/tutorials/api-rust.mdx @@ -9,7 +9,7 @@ metadata: whatsnext: { "Learn how to stream and decode reports via a WebSocket connection": "/data-streams/tutorials/ws-rust", - "Learn how to verify your data onchain": "/data-streams/reference/onchain-verification", + "Learn how to verify your data onchain": "/data-streams/reference/data-streams-api/onchain-verification", "Find the list of available Stream IDs": "/data-streams/crypto-streams", } --- @@ -44,7 +44,7 @@ import DataStreams from "@features/data-streams/common/DataStreams.astro" ]} /> -In this tutorial, you'll learn how to use the [Data Streams SDK](/data-streams/reference/rust-sdk) for Rust to fetch and decode [V3 reports](/data-streams/reference/report-schema-v3) for [Crypto streams](/data-streams/crypto-streams) from the Data Streams Aggregation Network. You'll set up your Rust project, retrieve reports, decode them, and log their attributes. +In this tutorial, you'll learn how to use the [Data Streams SDK](/data-streams/reference/data-streams-api/rust-sdk) for Rust to fetch and decode [V3 reports](/data-streams/reference/report-schema-v3) for [Crypto streams](/data-streams/crypto-streams) from the Data Streams Aggregation Network. You'll set up your Rust project, retrieve reports, decode them, and log their attributes. diff --git a/src/content/data-streams/tutorials/api-rwa-go.mdx b/src/content/data-streams/tutorials/api-rwa-go.mdx index a683ff3df5d..66d1502c3d4 100644 --- a/src/content/data-streams/tutorials/api-rwa-go.mdx +++ b/src/content/data-streams/tutorials/api-rwa-go.mdx @@ -9,7 +9,7 @@ metadata: whatsnext: { "Learn how to stream and decode reports via a WebSocket connection": "/data-streams/tutorials/ws-rwa-go", - "Learn how to verify your data onchain": "/data-streams/reference/onchain-verification", + "Learn how to verify your data onchain": "/data-streams/reference/data-streams-api/onchain-verification", "Find the list of available Stream IDs": "/data-streams/rwa-streams", } --- @@ -44,7 +44,7 @@ import DataStreams from "@features/data-streams/common/DataStreams.astro" ]} /> -In this tutorial, you'll learn how to use the [Data Streams SDK](/data-streams/reference/go-sdk) for Go to fetch and decode [V8 reports](/data-streams/reference/report-schema-v8) for [Real World Assets (RWAs) streams](/data-streams/rwa-streams) from the Data Streams Aggregation Network. You'll set up your Go project, retrieve reports, decode them, and log their attributes. +In this tutorial, you'll learn how to use the [Data Streams SDK](/data-streams/reference/data-streams-api/go-sdk) for Go to fetch and decode [V8 reports](/data-streams/reference/report-schema-v8) for [Real World Assets (RWAs) streams](/data-streams/rwa-streams) from the Data Streams Aggregation Network. You'll set up your Go project, retrieve reports, decode them, and log their attributes. @@ -216,9 +216,9 @@ You'll start with the set up of your Go project. Next, you'll fetch and decode r Replace `` and `` with your API credentials. - - `RestURL` is the REST endpoint to poll for specific reports. See the [Data Streams Interface](/data-streams/reference/interface-api#domains) page for more information. + - `RestURL` is the REST endpoint to poll for specific reports. See the [Data Streams Interface](/data-streams/reference/data-streams-api/interface-api#domains) page for more information. - See the [SDK Reference](/data-streams/reference/go-sdk#config-struct) page for more configuration options. + See the [SDK Reference](/data-streams/reference/data-streams-api/go-sdk#config-struct) page for more configuration options. 1. For this example, you will read from an RWA stream. See the [Data Streams RWA streams](/data-streams/rwa-streams) page for a complete list of available Real World Assets. diff --git a/src/content/data-streams/tutorials/api-rwa-rust.mdx b/src/content/data-streams/tutorials/api-rwa-rust.mdx index 269ffef79f6..61e0702bee1 100644 --- a/src/content/data-streams/tutorials/api-rwa-rust.mdx +++ b/src/content/data-streams/tutorials/api-rwa-rust.mdx @@ -10,7 +10,7 @@ metadata: whatsnext: { "Learn how to stream and decode reports via a WebSocket connection": "/data-streams/tutorials/ws-rwa-rust", - "Learn how to verify your data onchain": "/data-streams/reference/onchain-verification", + "Learn how to verify your data onchain": "/data-streams/reference/data-streams-api/onchain-verification", "Find the list of available Stream IDs": "/data-streams/rwa-streams", } --- @@ -45,7 +45,7 @@ import DataStreams from "@features/data-streams/common/DataStreams.astro" ]} /> -In this tutorial, you'll learn how to use the [Data Streams SDK](/data-streams/reference/rust-sdk) for Rust to fetch and decode [V8 reports](/data-streams/reference/report-schema-v8) for [Real World Assets (RWAs) streams](/data-streams/rwa-streams) from the Data Streams Aggregation Network. You'll set up your Rust project, retrieve reports, decode them, and log their attributes. +In this tutorial, you'll learn how to use the [Data Streams SDK](/data-streams/reference/data-streams-api/rust-sdk) for Rust to fetch and decode [V8 reports](/data-streams/reference/report-schema-v8) for [Real World Assets (RWAs) streams](/data-streams/rwa-streams) from the Data Streams Aggregation Network. You'll set up your Rust project, retrieve reports, decode them, and log their attributes. diff --git a/src/content/data-streams/tutorials/evm-onchain-report-verification.mdx b/src/content/data-streams/tutorials/evm-onchain-report-verification.mdx index 7bd0e8cad66..dcffb29b792 100644 --- a/src/content/data-streams/tutorials/evm-onchain-report-verification.mdx +++ b/src/content/data-streams/tutorials/evm-onchain-report-verification.mdx @@ -42,7 +42,7 @@ In this tutorial, you'll learn how to verify onchain the integrity of reports by ## Before you begin -Make sure you understand how to fetch reports via the [REST API](/data-streams/reference/interface-api) or [WebSocket](/data-streams/reference/interface-ws) connection. Refer to the following tutorials for more information: +Make sure you understand how to fetch reports via the [REST API](/data-streams/reference/data-streams-api/interface-api) or [WebSocket](/data-streams/reference/data-streams-api/interface-ws) connection. Refer to the following tutorials for more information: - [Fetch and decode reports via a REST API](/data-streams/tutorials/api-go) - [Stream and decode reports via WebSocket](/data-streams/tutorials/ws-go) diff --git a/src/content/data-streams/tutorials/overview.mdx b/src/content/data-streams/tutorials/overview.mdx index 956f15d3ebe..b1f1227f053 100644 --- a/src/content/data-streams/tutorials/overview.mdx +++ b/src/content/data-streams/tutorials/overview.mdx @@ -18,14 +18,15 @@ Explore several tutorials to learn how to use the Data Streams. ## Fetch, Stream, and Decode Reports -- [Fetch and decode reports](/data-streams/tutorials/api-go): Learn how to fetch and decode reports from the Data Streams Aggregation Network, using the [Go](/data-streams/reference/go-sdk) or [Rust](/data-streams/reference/rust-sdk) SDKs. -- [Stream and decode reports (WebSocket)](/data-streams/tutorials/ws-go): Learn how to listen for real-time reports from the Data Streams Aggregation Network, decode the report data, and log their attributes, using the [Go](/data-streams/reference/go-sdk) or [Rust](/data-streams/reference/rust-sdk) SDKs. +- [Fetch and decode reports](/data-streams/tutorials/api-go): Learn how to fetch and decode reports from the Data Streams Aggregation Network, using the [Go](/data-streams/reference/data-streams-api/go-sdk) or [Rust](/data-streams/reference/data-streams-api/rust-sdk) SDKs. +- [Stream and decode reports (WebSocket)](/data-streams/tutorials/ws-go): Learn how to listen for real-time reports from the Data Streams Aggregation Network, decode the report data, and log their attributes, using the [Go](/data-streams/reference/data-streams-api/go-sdk) or [Rust](/data-streams/reference/data-streams-api/rust-sdk) SDKs. ## Verify Reports diff --git a/src/content/data-streams/tutorials/ws-go.mdx b/src/content/data-streams/tutorials/ws-go.mdx index 4e2fd2027a2..fc53afb53f9 100644 --- a/src/content/data-streams/tutorials/ws-go.mdx +++ b/src/content/data-streams/tutorials/ws-go.mdx @@ -8,7 +8,7 @@ metadata: keywords: ["WebSocket", "Go SDK", "Golang", "Real-time", "Streaming", "Crypto Data", "V3 Reports", "Data Streams"] whatsnext: { - "Learn how to verify your data onchain": "/data-streams/reference/onchain-verification", + "Learn how to verify your data onchain": "/data-streams/reference/data-streams-api/onchain-verification", "Find the list of available Stream IDs": "/data-streams/crypto-streams", } --- @@ -43,7 +43,7 @@ import DataStreams from "@features/data-streams/common/DataStreams.astro" ]} /> -In this tutorial, you'll learn how to use the [Data Streams SDK](/data-streams/reference/go-sdk) for Go to subscribe to real-time [V3 reports](/data-streams/reference/report-schema-v3) for [Crypto streams](/data-streams/crypto-streams) via a [WebSocket connection](/data-streams/reference/interface-ws). You'll set up your Go project, listen for real-time reports from the Data Streams Aggregation Network, decode the report data, and log their attributes to your terminal. +In this tutorial, you'll learn how to use the [Data Streams SDK](/data-streams/reference/data-streams-api/go-sdk) for Go to subscribe to real-time [V3 reports](/data-streams/reference/report-schema-v3) for [Crypto streams](/data-streams/crypto-streams) via a [WebSocket connection](/data-streams/reference/data-streams-api/interface-ws). You'll set up your Go project, listen for real-time reports from the Data Streams Aggregation Network, decode the report data, and log their attributes to your terminal. @@ -219,9 +219,9 @@ In this tutorial, you'll learn how to use the [Data Streams SDK](/data-streams/r Replace `` and `` with your API credentials. - - `WsURL` is the [WebSocket URL](/data-streams/reference/interface-ws#domains) for the Data Streams Aggregation Network. Use for the testnet environment. + - `WsURL` is the [WebSocket URL](/data-streams/reference/data-streams-api/interface-ws#domains) for the Data Streams Aggregation Network. Use for the testnet environment. - See the [SDK Reference](/data-streams/reference/go-sdk#config-struct) page for more configuration options. + See the [SDK Reference](/data-streams/reference/data-streams-api/go-sdk#config-struct) page for more configuration options. 1. For this example, you'll subscribe to the ETH/USD Data Streams crypto stream. This stream ID is . See the [Crypto Streams](/data-streams/crypto-streams) page for a complete list of available crypto assets. @@ -323,7 +323,7 @@ production environment, you should verify the data to ensure its integrity and a ### Establishing a WebSocket connection and listening for reports -Your application uses the [Stream](https://github.com/smartcontractkit/data-streams-sdk/blob/main/go/client.go#L98) function in the [Data Streams SDK](/data-streams/reference/go-sdk)'s client package to establish a real-time WebSocket connection with the Data Streams Aggregation Network. +Your application uses the [Stream](https://github.com/smartcontractkit/data-streams-sdk/blob/main/go/client.go#L98) function in the [Data Streams SDK](/data-streams/reference/data-streams-api/go-sdk)'s client package to establish a real-time WebSocket connection with the Data Streams Aggregation Network. Once the WebSocket connection is established, your application subscribes to one or more streams by passing an array of `feed.IDs` to the `Stream` function. This subscription lets the client receive real-time updates whenever new report data is available for the specified streams. diff --git a/src/content/data-streams/tutorials/ws-rust.mdx b/src/content/data-streams/tutorials/ws-rust.mdx index ff49af1f018..06216ec73af 100644 --- a/src/content/data-streams/tutorials/ws-rust.mdx +++ b/src/content/data-streams/tutorials/ws-rust.mdx @@ -8,7 +8,7 @@ metadata: keywords: ["WebSocket", "Rust SDK", "Data Streams", "Real-time data", "Crypto pricing", "Tutorial"] whatsnext: { - "Learn how to verify your data onchain": "/data-streams/reference/onchain-verification", + "Learn how to verify your data onchain": "/data-streams/reference/data-streams-api/onchain-verification", "Find the list of available Stream IDs": "/data-streams/crypto-streams", } --- @@ -43,7 +43,7 @@ import DataStreams from "@features/data-streams/common/DataStreams.astro" ]} /> -In this tutorial, you'll learn how to use the [Data Streams SDK](/data-streams/reference/rust-sdk) for Rust to subscribe to real-time [V3 reports](/data-streams/reference/report-schema-v3) for [Crypto streams](/data-streams/crypto-streams) via a [WebSocket connection](/data-streams/reference/interface-ws). You'll set up your Rust project, listen for real-time reports from the Data Streams Aggregation Network, decode the report data, and log their attributes to your terminal. +In this tutorial, you'll learn how to use the [Data Streams SDK](/data-streams/reference/data-streams-api/rust-sdk) for Rust to subscribe to real-time [V3 reports](/data-streams/reference/report-schema-v3) for [Crypto streams](/data-streams/crypto-streams) via a [WebSocket connection](/data-streams/reference/data-streams-api/interface-ws). You'll set up your Rust project, listen for real-time reports from the Data Streams Aggregation Network, decode the report data, and log their attributes to your terminal. diff --git a/src/content/data-streams/tutorials/ws-rwa-go.mdx b/src/content/data-streams/tutorials/ws-rwa-go.mdx index 95441edf9fa..bad7bba4a44 100644 --- a/src/content/data-streams/tutorials/ws-rwa-go.mdx +++ b/src/content/data-streams/tutorials/ws-rwa-go.mdx @@ -8,7 +8,7 @@ metadata: keywords: ["WebSocket", "Go SDK", "Real World Assets", "RWA", "V8 reports", "Data Streams", "Real-time data"] whatsnext: { - "Learn how to verify your data onchain": "/data-streams/reference/onchain-verification", + "Learn how to verify your data onchain": "/data-streams/reference/data-streams-api/onchain-verification", "Find the list of available Stream IDs": "/data-streams/rwa-streams", } --- @@ -43,7 +43,7 @@ import DataStreams from "@features/data-streams/common/DataStreams.astro" ]} /> -In this tutorial, you'll learn how to use the [Data Streams SDK](/data-streams/reference/go-sdk) for Go to subscribe to real-time [V8 reports](/data-streams/reference/report-schema-v8) for [Real World Assets (RWAs) streams](/data-streams/rwa-streams) via a [WebSocket connection](/data-streams/reference/interface-ws). You'll set up your Go project, listen for real-time reports from the Data Streams Aggregation Network, decode the report data, and log their attributes to your terminal. +In this tutorial, you'll learn how to use the [Data Streams SDK](/data-streams/reference/data-streams-api/go-sdk) for Go to subscribe to real-time [V8 reports](/data-streams/reference/report-schema-v8) for [Real World Assets (RWAs) streams](/data-streams/rwa-streams) via a [WebSocket connection](/data-streams/reference/data-streams-api/interface-ws). You'll set up your Go project, listen for real-time reports from the Data Streams Aggregation Network, decode the report data, and log their attributes to your terminal. @@ -217,9 +217,9 @@ In this tutorial, you'll learn how to use the [Data Streams SDK](/data-streams/r Replace `` and `` with your API credentials. - - `WsURL` is the [WebSocket URL](/data-streams/reference/interface-ws#domains) for the Data Streams Aggregation Network. Use for the testnet environment. + - `WsURL` is the [WebSocket URL](/data-streams/reference/data-streams-api/interface-ws#domains) for the Data Streams Aggregation Network. Use for the testnet environment. - See the [SDK Reference](/data-streams/reference/go-sdk#config-struct) page for more configuration options. + See the [SDK Reference](/data-streams/reference/data-streams-api/go-sdk#config-struct) page for more configuration options. 1. For this example, you'll subscribe to an RWA stream. See the [RWA Streams](/data-streams/rwa-streams) page for a complete list of available Real World Assets. @@ -321,7 +321,7 @@ production environment, you should verify the data to ensure its integrity and a ### Establishing a WebSocket connection and listening for reports -Your application uses the [Stream](https://github.com/smartcontractkit/data-streams-sdk/blob/main/go/client.go#L98) function in the [Data Streams SDK](/data-streams/reference/go-sdk)'s client package to establish a real-time WebSocket connection with the Data Streams Aggregation Network. +Your application uses the [Stream](https://github.com/smartcontractkit/data-streams-sdk/blob/main/go/client.go#L98) function in the [Data Streams SDK](/data-streams/reference/data-streams-api/go-sdk)'s client package to establish a real-time WebSocket connection with the Data Streams Aggregation Network. Once the WebSocket connection is established, your application subscribes to one or more streams by passing an array of `feed.IDs` to the `Stream` function. This subscription lets the client receive real-time updates whenever new report data is available for the specified streams. diff --git a/src/content/data-streams/tutorials/ws-rwa-rust.mdx b/src/content/data-streams/tutorials/ws-rwa-rust.mdx index da0a79a843e..7856a1db2ba 100644 --- a/src/content/data-streams/tutorials/ws-rwa-rust.mdx +++ b/src/content/data-streams/tutorials/ws-rwa-rust.mdx @@ -8,7 +8,7 @@ metadata: keywords: ["WebSocket", "Rust SDK", "Real World Assets", "RWA", "V8 reports", "Data Streams"] whatsnext: { - "Learn how to verify your data onchain": "/data-streams/reference/onchain-verification", + "Learn how to verify your data onchain": "/data-streams/reference/data-streams-api/onchain-verification", "Find the list of available Stream IDs": "/data-streams/rwa-streams", } --- @@ -43,7 +43,7 @@ import DataStreams from "@features/data-streams/common/DataStreams.astro" ]} /> -In this tutorial, you'll learn how to use the [Data Streams SDK](/data-streams/reference/rust-sdk) for Rust to subscribe to real-time [V8 reports](/data-streams/reference/report-schema-v8) for [Real World Assets (RWA) streams](/data-streams/rwa-streams) via a [WebSocket connection](/data-streams/reference/interface-ws). You'll set up your Rust project, listen for real-time reports from the Data Streams Aggregation Network, decode the report data, and log their attributes to your terminal. +In this tutorial, you'll learn how to use the [Data Streams SDK](/data-streams/reference/data-streams-api/rust-sdk) for Rust to subscribe to real-time [V8 reports](/data-streams/reference/report-schema-v8) for [Real World Assets (RWA) streams](/data-streams/rwa-streams) via a [WebSocket connection](/data-streams/reference/data-streams-api/interface-ws). You'll set up your Rust project, listen for real-time reports from the Data Streams Aggregation Network, decode the report data, and log their attributes to your terminal. diff --git a/src/features/data-streams/common/asideOnChainVerification.mdx b/src/features/data-streams/common/asideOnChainVerification.mdx index 9c3bb209e7d..4b7c5c9abc4 100644 --- a/src/features/data-streams/common/asideOnChainVerification.mdx +++ b/src/features/data-streams/common/asideOnChainVerification.mdx @@ -3,5 +3,5 @@ import { Aside } from "@components" diff --git a/src/features/redirects/redirects.json b/src/features/redirects/redirects.json index 51a93f5fcab..65438d9da8e 100644 --- a/src/features/redirects/redirects.json +++ b/src/features/redirects/redirects.json @@ -1870,6 +1870,36 @@ "destination": "data-streams/reference/streams-direct/streams-direct-onchain-verification", "statuscode": 301 }, + { + "source": "data-streams/reference/interface-api", + "destination": "data-streams/reference/data-streams-api/interface-api", + "statusCode": 301 + }, + { + "source": "data-streams/reference/interface-ws", + "destination": "data-streams/reference/data-streams-api/interface-ws", + "statusCode": 301 + }, + { + "source": "data-streams/reference/onchain-verification", + "destination": "data-streams/reference/data-streams-api/onchain-verification", + "statusCode": 301 + }, + { + "source": "data-streams/reference/authentication", + "destination": "data-streams/reference/data-streams-api/authentication", + "statusCode": 301 + }, + { + "source": "data-streams/reference/go-sdk", + "destination": "data-streams/reference/data-streams-api/go-sdk", + "statusCode": 301 + }, + { + "source": "data-streams/reference/rust-sdk", + "destination": "data-streams/reference/data-streams-api/rust-sdk", + "statusCode": 301 + }, { "source": "chainlink-nodes/oracle-jobs/v1/job-specifications", "destination": "chainlink-nodes/oracle-jobs/migration-v1-v2", From 97cd9afad201700d26d5406ff8e63b570d73f60f Mon Sep 17 00:00:00 2001 From: Devin DiStefano Date: Fri, 1 Aug 2025 12:08:45 -0700 Subject: [PATCH 07/14] rust sdk moved to data-streams-api categoryA --- .../data-streams/reference/{ => data-streams-api}/rust-sdk.mdx | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename src/content/data-streams/reference/{ => data-streams-api}/rust-sdk.mdx (100%) diff --git a/src/content/data-streams/reference/rust-sdk.mdx b/src/content/data-streams/reference/data-streams-api/rust-sdk.mdx similarity index 100% rename from src/content/data-streams/reference/rust-sdk.mdx rename to src/content/data-streams/reference/data-streams-api/rust-sdk.mdx From c77a383454bc307fa3b91d129567b0a5c7b1a213 Mon Sep 17 00:00:00 2001 From: Devin DiStefano Date: Mon, 4 Aug 2025 12:24:24 -0700 Subject: [PATCH 08/14] description update --- src/content/data-streams/reference/candlestick-api/index.mdx | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/content/data-streams/reference/candlestick-api/index.mdx b/src/content/data-streams/reference/candlestick-api/index.mdx index 0e06902869e..8a32421d0e1 100644 --- a/src/content/data-streams/reference/candlestick-api/index.mdx +++ b/src/content/data-streams/reference/candlestick-api/index.mdx @@ -14,7 +14,9 @@ import DataStreams from "@features/data-streams/common/DataStreams.astro" The Candlestick API is designed and implemented to satisfy [TradingView data integration specifications](https://www.tradingview.com/broker-api-docs/rest-api-spec/#tag/Data-Integration), the industry standard for sharing open-high-low-close (OHLC) aggregated trading data. -Alignment with the TradingView spec allows for TradingView integration and direct customer access to prices without resorting to consuming and decoding reports for non-transactional use cases, like dashboards, analytics platforms, portfolio trackers, research tools, and more. +OHLC data is provdided in two formats: [the standard OHLCV format](##get-candlestick-data-row-format), widely used by retail crypto exchanges, ideal for human readability and compatibility; [and the columnar format](#get-candlestick-data-column-format), preferred by HFT systems, optimized for efficient, large-scale data processing. + +The API provides both historical candlestick data through the [history endpoints](#get-candlestick-data-column-format) (updated every minute) and live price updates through the [streaming endpoint](#get-streaming-price-updates) (updated every second). ## Domains From abf12507f2016f12c02e7b509752de0d4c462059 Mon Sep 17 00:00:00 2001 From: Devin DiStefano Date: Mon, 4 Aug 2025 12:42:13 -0700 Subject: [PATCH 09/14] fix --- src/content/data-streams/reference/candlestick-api/index.mdx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/content/data-streams/reference/candlestick-api/index.mdx b/src/content/data-streams/reference/candlestick-api/index.mdx index 8a32421d0e1..ac7d78fe7e7 100644 --- a/src/content/data-streams/reference/candlestick-api/index.mdx +++ b/src/content/data-streams/reference/candlestick-api/index.mdx @@ -14,7 +14,7 @@ import DataStreams from "@features/data-streams/common/DataStreams.astro" The Candlestick API is designed and implemented to satisfy [TradingView data integration specifications](https://www.tradingview.com/broker-api-docs/rest-api-spec/#tag/Data-Integration), the industry standard for sharing open-high-low-close (OHLC) aggregated trading data. -OHLC data is provdided in two formats: [the standard OHLCV format](##get-candlestick-data-row-format), widely used by retail crypto exchanges, ideal for human readability and compatibility; [and the columnar format](#get-candlestick-data-column-format), preferred by HFT systems, optimized for efficient, large-scale data processing. +OHLC data is provdided in two formats: [the standard OHLCV format](#get-candlestick-data-row-format), widely used by retail crypto exchanges, ideal for human readability and compatibility; [and the columnar format](#get-candlestick-data-column-format), preferred by HFT systems, optimized for efficient, large-scale data processing. The API provides both historical candlestick data through the [history endpoints](#get-candlestick-data-column-format) (updated every minute) and live price updates through the [streaming endpoint](#get-streaming-price-updates) (updated every second). From 730329fd73330234f9b8981820df6b2f3f4954e8 Mon Sep 17 00:00:00 2001 From: Karim <98668332+khadni@users.noreply.github.com> Date: Wed, 6 Aug 2025 10:10:03 -0500 Subject: [PATCH 10/14] nit --- .../reference/candlestick-api/index.mdx | 19 ++++++++-------- .../data-streams-api/interface-api.mdx | 7 +++--- .../data-streams-api/interface-ws.mdx | 7 +++--- .../data-streams/reference/overview.mdx | 22 +++++++++---------- 4 files changed, 29 insertions(+), 26 deletions(-) diff --git a/src/content/data-streams/reference/candlestick-api/index.mdx b/src/content/data-streams/reference/candlestick-api/index.mdx index ac7d78fe7e7..90a11f949ae 100644 --- a/src/content/data-streams/reference/candlestick-api/index.mdx +++ b/src/content/data-streams/reference/candlestick-api/index.mdx @@ -9,6 +9,7 @@ metadata: --- import DataStreams from "@features/data-streams/common/DataStreams.astro" +import { CopyText } from "@components" @@ -20,9 +21,9 @@ The API provides both historical candlestick data through the [history endpoints ## Domains -| Description | Testnet URL | Mainnet URL | -| :----------------------- | :----------------------------------------------- | :--------------------------------------- | -| Candlestick API endpoint | `https://priceapi.testnet-dataengine.chain.link` | `https://priceapi.dataengine.chain.link` | +|
Description
| Testnet URL | Mainnet URL | +| :------------------------------------------- | :---------------------------------------------------------------------- | :-------------------------------------------------------------- | +| Candlestick API endpoint | | | ## API Endpoints @@ -175,7 +176,7 @@ curl -X GET \ | `l` | `array` | Array of numbers (the low (min) value of each candle). | | `v` | `array` | Array of numbers (the volume of each candle. Not currently supported). | - > **Note**: If candles cannot be found for the given symbol/time period, a response with empty arrays will be provided. eg: `{ "s": "ok", "t": [], "c": [], "o": [], "h": [], "l": [], "v": [] }` + > **Note**: If candles cannot be found for the given symbol/time period, a response with empty arrays will be provided. E.g., `{ "s": "ok", "t": [], "c": [], "o": [], "h": [], "l": [], "v": [] }` ##### Error Responses @@ -219,12 +220,12 @@ curl -X GET \ } ``` - | Field | Type | Description | - | :-------- | :------- | :-------------------------------------------------------------------------------------------------- | - | `s` | `string` | The status of the request. | - | `candles` | `array` | Array of arrays of numbers. Each array candle contains: `[ time, open, high, low, close, volume ]`. | + |
Field
|
Type
| Description | + | :------------------------------------ | :----------------------------------- | :-------------------------------------------------------------------------------------------------- | + | `s` | `string` | The status of the request. | + | `candles` | `array` | Array of arrays of numbers. Each array candle contains: `[ time, open, high, low, close, volume ]`. | - > **Note**: If candles cannot be found for the given symbol/time period, a response with an empty `candles` array is provided. eg: `{ "s": "ok", "candles": [] }` + > **Note**: If candles cannot be found for the given symbol/time period, a response with an empty `candles` array is provided. E.g., `{ "s": "ok", "candles": [] }` ##### Error Responses diff --git a/src/content/data-streams/reference/data-streams-api/interface-api.mdx b/src/content/data-streams/reference/data-streams-api/interface-api.mdx index 8ed0e63b881..15968e84401 100644 --- a/src/content/data-streams/reference/data-streams-api/interface-api.mdx +++ b/src/content/data-streams/reference/data-streams-api/interface-api.mdx @@ -9,14 +9,15 @@ metadata: --- import DataStreams from "@features/data-streams/common/DataStreams.astro" +import { CopyText } from "@components" ## Domains -| Description | Testnet URL | Mainnet URL | -| --------------------------------------- | ----------------------------------------- | --------------------------------- | -| REST endpoint to query specific reports | https://api.testnet-dataengine.chain.link | https://api.dataengine.chain.link | +| Description | Testnet URL | Mainnet URL | +| :------------ | :----------------------------------------------------------------- | :--------------------------------------------------------- | +| REST endpoint | | | ## Authentication diff --git a/src/content/data-streams/reference/data-streams-api/interface-ws.mdx b/src/content/data-streams/reference/data-streams-api/interface-ws.mdx index a642ace1f2c..43355395f54 100644 --- a/src/content/data-streams/reference/data-streams-api/interface-ws.mdx +++ b/src/content/data-streams/reference/data-streams-api/interface-ws.mdx @@ -10,14 +10,15 @@ metadata: --- import DataStreams from "@features/data-streams/common/DataStreams.astro" +import { CopyText } from "@components" ## Domains -| Description | Testnet URL | Mainnet URL | -| ------------------------------------------------ | -------------------------------------- | ------------------------------ | -| WebSocket endpoint to subscribe to price updates | wss://ws.testnet-dataengine.chain.link | wss://ws.dataengine.chain.link | +| Description | Testnet URL | Mainnet URL | +| :----------------- | :-------------------------------------------------------------- | :------------------------------------------------------ | +| WebSocket endpoint | | | ## Authentication diff --git a/src/content/data-streams/reference/overview.mdx b/src/content/data-streams/reference/overview.mdx index 067bf2f012f..ab7b1e3224e 100644 --- a/src/content/data-streams/reference/overview.mdx +++ b/src/content/data-streams/reference/overview.mdx @@ -13,26 +13,26 @@ Chainlink Data Streams offers two distinct APIs for accessing low-latency market ### Which API should I use? -| Feature | [Data Streams API](./data-streams-api) | [Candlestick API](./candlestick-api) | -| ----------------------- | ------------------------------------------- | --------------------------------------------- | -| **Primary Use Case** | **On-chain** consumption by smart contracts | **Off-chain** analytics, charting, dashboards | -| **Data Format** | Signed, verifiable data reports | Aggregated OHLC (candlestick) data | -| **Interfaces** | REST API & WebSocket | REST API (including a streaming endpoint) | -| **Authentication** | HMAC Signature | JWT (token-based) | -| **Cryptographic Proof** | ✅ Yes (`fullReport` blob) | ❌ No | +| Feature | [Data Streams API](/data-streams/reference/data-streams-api) | [Candlestick API](/data-streams/reference/candlestick-api) | +| ----------------------- | ------------------------------------------------------------ | ---------------------------------------------------------- | +| **Primary Use Case** | **Onchain** consumption by smart contracts | **Offchain** analytics, charting, dashboards | +| **Data Format** | Signed, verifiable data reports | Aggregated OHLC (candlestick) data | +| **Interfaces** | REST API & WebSocket | REST API (including a streaming endpoint) | +| **Authentication** | HMAC Signature | JWT (token-based) | +| **Cryptographic Proof** | ✅ Yes (`fullReport` blob) | ❌ No | --- ### Data Streams API -Use the [Data Streams API](./data-streams-api) for applications that require high-frequency, verifiable data for **on-chain** execution. It provides access to cryptographically signed data reports that can be verified and used by smart contracts. This API is designed for applications that depend on low-latency, tamper-proof data. +Use the [Data Streams API](/data-streams/reference/data-streams-api) for applications that require high-frequency, verifiable data for **onchain** execution. It provides access to cryptographically signed data reports that can be verified and used by smart contracts. This API is designed for applications that depend on low-latency, tamper-proof data. -**[View the Data Streams API Reference](./data-streams-api/interface-api)** +**[View the Data Streams API Reference](/data-streams/reference/data-streams-api/interface-api)** --- ### Candlestick API -Use the [Candlestick API](./candlestick-api) for **off-chain** applications. It provides historical open-high-low-close (OHLC) data and real-time price updates in a format compatible with the [TradingView data integration specification](https://www.tradingview.com/broker-api-docs/rest-api-spec/#tag/Data-Integration). This is ideal for building dashboards, analytics platforms, portfolio trackers, and research tools. +Use the [Candlestick API](/data-streams/reference/candlestick-api) for **offchain** applications. It provides historical open-high-low-close (OHLC) data and real-time price updates in a format compatible with the [TradingView data integration specification](https://www.tradingview.com/broker-api-docs/rest-api-spec/#tag/Data-Integration). This is ideal for building dashboards, analytics platforms, portfolio trackers, and research tools. -**[View the Candlestick API Reference](./candlestick-api)** +**[View the Candlestick API Reference](/data-streams/reference/candlestick-api)** From bd8bcadbc6cd20e8d54684f4b2403493f4d0ad7d Mon Sep 17 00:00:00 2001 From: Karim <98668332+khadni@users.noreply.github.com> Date: Wed, 6 Aug 2025 11:22:45 -0500 Subject: [PATCH 11/14] nit --- src/content/data-streams/reference/candlestick-api/index.mdx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/content/data-streams/reference/candlestick-api/index.mdx b/src/content/data-streams/reference/candlestick-api/index.mdx index 90a11f949ae..4ff1960e060 100644 --- a/src/content/data-streams/reference/candlestick-api/index.mdx +++ b/src/content/data-streams/reference/candlestick-api/index.mdx @@ -15,7 +15,7 @@ import { CopyText } from "@components" The Candlestick API is designed and implemented to satisfy [TradingView data integration specifications](https://www.tradingview.com/broker-api-docs/rest-api-spec/#tag/Data-Integration), the industry standard for sharing open-high-low-close (OHLC) aggregated trading data. -OHLC data is provdided in two formats: [the standard OHLCV format](#get-candlestick-data-row-format), widely used by retail crypto exchanges, ideal for human readability and compatibility; [and the columnar format](#get-candlestick-data-column-format), preferred by HFT systems, optimized for efficient, large-scale data processing. +OHLC data is provided in two formats: [the standard OHLCV format](#get-candlestick-data-row-format), widely used by retail crypto exchanges, ideal for human readability and compatibility; [and the columnar format](#get-candlestick-data-column-format), preferred by HFT systems, optimized for efficient, large-scale data processing. The API provides both historical candlestick data through the [history endpoints](#get-candlestick-data-column-format) (updated every minute) and live price updates through the [streaming endpoint](#get-streaming-price-updates) (updated every second). From 5ef9836055ee60fcbbd651daf1b4d6a603953498 Mon Sep 17 00:00:00 2001 From: Devin DiStefano Date: Wed, 6 Aug 2025 12:43:33 -0700 Subject: [PATCH 12/14] updates --- src/config/sidebar.ts | 2 +- .../data-streams/reference/overview.mdx | 65 ++++++++++++++----- 2 files changed, 51 insertions(+), 16 deletions(-) diff --git a/src/config/sidebar.ts b/src/config/sidebar.ts index d73439b0b05..37524448fda 100644 --- a/src/config/sidebar.ts +++ b/src/config/sidebar.ts @@ -434,7 +434,7 @@ export const SIDEBAR: Partial> = { url: "data-streams/reference/overview", }, { - title: "Data Streams API", + title: "Data Streams Reference", url: "data-streams/reference/data-streams-api", children: [ { diff --git a/src/content/data-streams/reference/overview.mdx b/src/content/data-streams/reference/overview.mdx index ab7b1e3224e..875b4cc2e86 100644 --- a/src/content/data-streams/reference/overview.mdx +++ b/src/content/data-streams/reference/overview.mdx @@ -9,30 +9,65 @@ metadata: keywords: ["Data Streams", "API Reference", "SDK", "WebSocket", "REST API", "Integration Guide"] --- -Chainlink Data Streams offers two distinct APIs for accessing low-latency market data. Choose the API that best fits your use case. +Chainlink Data Streams offers two distinct solutions for accessing low-latency market data. Choose the solution that best fits your use case. -### Which API should I use? +### Which solution should I use? -| Feature | [Data Streams API](/data-streams/reference/data-streams-api) | [Candlestick API](/data-streams/reference/candlestick-api) | -| ----------------------- | ------------------------------------------------------------ | ---------------------------------------------------------- | -| **Primary Use Case** | **Onchain** consumption by smart contracts | **Offchain** analytics, charting, dashboards | -| **Data Format** | Signed, verifiable data reports | Aggregated OHLC (candlestick) data | -| **Interfaces** | REST API & WebSocket | REST API (including a streaming endpoint) | -| **Authentication** | HMAC Signature | JWT (token-based) | -| **Cryptographic Proof** | ✅ Yes (`fullReport` blob) | ❌ No | +| Feature | [Data Streams API](#data-streams-api) | [Candlestick API](#candlestick-api) | +| ----------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------- | +| **Primary Use Case** | **Onchain** consumption by smart contracts | **Offchain** analytics, charting, dashboards | +| **Data Format** | Signed, verifiable data reports | Aggregated OHLC (candlestick) data | +| **Interfaces** | SDKs ([Go](/data-streams/reference/data-streams-api/go-sdk), [Rust](/data-streams/reference/data-streams-api/rust-sdk)), [REST API](/data-streams/reference/data-streams-api/interface-api) & [WebSocket](/data-streams/reference/data-streams-api/interface-ws) | [REST API](/data-streams/reference/candlestick-api) (including a [streaming endpoint](/data-streams/reference/candlestick-api#get-streaming-price-updates)) | +| **Authentication** | [HMAC Signature](data-streams/reference/data-streams-api/authentication) (automatic with SDKs) | [JWT](/data-streams/reference/candlestick-api#authorize-and-get-token) (token-based) | +| **Cryptographic Proof** | ✅ Yes (See [Verification methods](#verification)) | ❌ No | --- -### Data Streams API +## Data Streams API -Use the [Data Streams API](/data-streams/reference/data-streams-api) for applications that require high-frequency, verifiable data for **onchain** execution. It provides access to cryptographically signed data reports that can be verified and used by smart contracts. This API is designed for applications that depend on low-latency, tamper-proof data. +The [Data Streams API](/data-streams/reference/data-streams-api) provides cryptographically signed, verifiable data reports designed for **onchain** consumption by smart contracts. This comprehensive solution offers multiple integration paths to support applications that require low-latency, tamper-proof data. -**[View the Data Streams API Reference](/data-streams/reference/data-streams-api/interface-api)** +### Integration Methods + +#### SDKs (Recommended) + +- [Go SDK](/data-streams/reference/data-streams-api/go-sdk) - Native Go language integration +- [Rust SDK](/data-streams/reference/data-streams-api/rust-sdk) - Native Rust language integration + +#### Direct API Access + +- [REST API](/data-streams/reference/data-streams-api/interface-api) - HTTP-based interface for simple integrations +- [WebSocket](/data-streams/reference/data-streams-api/interface-ws) - Real-time data streaming via WebSocket connection + +#### Authentication + +- [Authentication Guides](/data-streams/reference/data-streams-api/authentication) - HMAC signature implementation examples (not required when using SDKs) + +#### Verification + +##### EVM chains + +- [Onchain report data verification](/data-streams/reference/data-streams-api/onchain-verification) - Verify the authenticity of received data on EVM chains + +##### Solana + +- [Verify reports using the onchain integration method](/data-streams/tutorials/solana-onchain-report-verification) - Verify reports directly within your Solana program +- [Verify reports using the offchain integration method](/data-streams/tutorials/solana-offchain-report-verification) - Verify reports client-side using the Rust SDK + +**[View the Data Streams API Reference →](/data-streams/reference/data-streams-api)** --- -### Candlestick API +## Candlestick API + +The [Candlestick API](/data-streams/reference/candlestick-api) provides historical and real-time OHLC (Open-High-Low-Close) data designed for **offchain** applications. Built to TradingView data integration specifications, it's optimized for analytics, charting, and dashboard applications. + +### Integration Methods + +Currently, the Candlestick API is accessible via a [REST API](/data-streams/reference/candlestick-api), including a [streaming endpoint](/data-streams/reference/candlestick-api#get-streaming-price-updates) for real-time data. + +### Authentication -Use the [Candlestick API](/data-streams/reference/candlestick-api) for **offchain** applications. It provides historical open-high-low-close (OHLC) data and real-time price updates in a format compatible with the [TradingView data integration specification](https://www.tradingview.com/broker-api-docs/rest-api-spec/#tag/Data-Integration). This is ideal for building dashboards, analytics platforms, portfolio trackers, and research tools. +- [Authentication Endpoint](/data-streams/reference/candlestick-api#authorize-and-get-token) - JWT token-based authentication -**[View the Candlestick API Reference](/data-streams/reference/candlestick-api)** +**[View the Candlestick API Reference →](/data-streams/reference/candlestick-api)** From 66f33695a8f912f0345b789e9fe6999060ead13a Mon Sep 17 00:00:00 2001 From: Devin DiStefano Date: Wed, 6 Aug 2025 12:51:03 -0700 Subject: [PATCH 13/14] broken-link-fix --- src/content/data-streams/reference/overview.mdx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/content/data-streams/reference/overview.mdx b/src/content/data-streams/reference/overview.mdx index 875b4cc2e86..c734a34d539 100644 --- a/src/content/data-streams/reference/overview.mdx +++ b/src/content/data-streams/reference/overview.mdx @@ -18,7 +18,7 @@ Chainlink Data Streams offers two distinct solutions for accessing low-latency m | **Primary Use Case** | **Onchain** consumption by smart contracts | **Offchain** analytics, charting, dashboards | | **Data Format** | Signed, verifiable data reports | Aggregated OHLC (candlestick) data | | **Interfaces** | SDKs ([Go](/data-streams/reference/data-streams-api/go-sdk), [Rust](/data-streams/reference/data-streams-api/rust-sdk)), [REST API](/data-streams/reference/data-streams-api/interface-api) & [WebSocket](/data-streams/reference/data-streams-api/interface-ws) | [REST API](/data-streams/reference/candlestick-api) (including a [streaming endpoint](/data-streams/reference/candlestick-api#get-streaming-price-updates)) | -| **Authentication** | [HMAC Signature](data-streams/reference/data-streams-api/authentication) (automatic with SDKs) | [JWT](/data-streams/reference/candlestick-api#authorize-and-get-token) (token-based) | +| **Authentication** | [HMAC Signature](/data-streams/reference/data-streams-api/authentication) (automatic with SDKs) | [JWT](/data-streams/reference/candlestick-api#authorize-and-get-token) (token-based) | | **Cryptographic Proof** | ✅ Yes (See [Verification methods](#verification)) | ❌ No | --- From 262133e2d3091f4124ea2bc7b428af379fea8982 Mon Sep 17 00:00:00 2001 From: Devin DiStefano Date: Fri, 8 Aug 2025 10:33:00 -0700 Subject: [PATCH 14/14] slight change, matching structure --- src/content/data-streams/reference/overview.mdx | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/content/data-streams/reference/overview.mdx b/src/content/data-streams/reference/overview.mdx index c734a34d539..49c8fd6b243 100644 --- a/src/content/data-streams/reference/overview.mdx +++ b/src/content/data-streams/reference/overview.mdx @@ -64,7 +64,10 @@ The [Candlestick API](/data-streams/reference/candlestick-api) provides historic ### Integration Methods -Currently, the Candlestick API is accessible via a [REST API](/data-streams/reference/candlestick-api), including a [streaming endpoint](/data-streams/reference/candlestick-api#get-streaming-price-updates) for real-time data. +#### Direct API Access + +- [REST API](/data-streams/reference/candlestick-api) - Access historical OHLC data via HTTP + - [Streaming Endpoint](/data-streams/reference/candlestick-api#get-streaming-price-updates) - Get real-time price updates ### Authentication