Back to Hub
CREATED BY CHAINLINK LABS

Read Data Feeds

A set of minimal examples that read from Chainlink Data Feeds using the CRE chain reader on a cron schedule.

A set of minimal examples that, on a cron schedule (every 10 minutes), read from Chainlink Data Feeds using the CRE chain reader.

There are two types of examples:

1. Regular (single-value) price feeds

Reads decimals() and latestAnswer() from Chainlink Data Feeds (e.g. BTC/USD, ETH/USD), logs the scaled values, and returns a JSON array of results.

  • Example network: Arbitrum One (mainnet).

Production contracts:

2. MVR (Multiple Variable Response) bundle feeds

Reads latestBundle() and bundleDecimals() from a Chainlink BundleAggregatorProxy, decodes the returned bytes into multiple typed fields, and returns a structured JSON object (including scaled numeric values).

  • Example network: Base mainnet.
  • Example MVR feed: S&P Global SSA EURC.

References:


Get Started

Language-specific examples (both regular and MVR) live under the building-blocks/read-data-feeds directory.

  • To get started with Go (regular data feeds), see the Go README.

  • To get started with TypeScript (regular data feeds), see the TypeScript README.

  • To get started with Go MVR bundle feeds, use the Go example that reads latestBundle() / bundleDecimals() from the S&P Global SSA EURC feed on Base (see the corresponding Go README in the MVR example directory).

  • To get started with TypeScript MVR bundle feeds, use the TypeScript example that reads and decodes the same MVR feed on Base (see the corresponding TypeScript README in the MVR example directory).

Get the latest Chainlink content straight to your inbox.