INTRODUCTION Tutorials The Basics Random Numbers API Calls Other Tutorials Architecture Overview Basic Request Model Decentralized Data Model Off-Chain Reporting
USING DATA FEEDS Introduction to Data Feeds Get the Latest Price (EVM) Get the Latest Price (Solana) Historical Price Data Feed Registry API Reference Contract Addresses ENS Ethereum Data Feeds Binance Smart Chain Data Feeds Polygon (Matic) Data Feeds xDai Data Feeds Huobi Eco Chain Data Feeds Avalanche Data Feeds Fantom Data Feeds Arbitrum Data Feeds Harmony Data Feeds Solana Data Feeds Optimism Data Feeds
USING RANDOMNESS Introduction to Chainlink VRF Get a Random Number API Reference Security Considerations Contract Addresses Best Practices
USING CHAINLINK KEEPERS Introduction Making Compatible Contracts Register Upkeep for a Contract Patterns and Best Practices Network Overview FAQs
USING ANY API Introduction to Using Any API Make a GET Request Make an Existing Job Request Multi-Variable Responses Large Responses Find Existing Jobs API Reference Contract Addresses
DEVELOPER REFERENCE Install Instructions LINK Token Contracts Developer Communications Getting Help Data Provider Nodes Hackathon Resources Contributing to Chainlink User Guides Install, configure & fund MetaMask Acquire testnet LINK Deploy your first contract Fund your contract Use your first contract!
Data Feeds API Reference
Tell us more about your experience.
API reference for AggregatorV3Interface
.
Functions
Name | Description |
---|---|
decimals | The number of decimals in the response. |
description | The description of the aggregator that the proxy points to. |
getRoundData | Get data from a specific round. |
latestRoundData | Get data from the latest round. |
version | The version representing the type of aggregator the proxy points to. |
decimals
Get the number of decimals present in the response value.
function decimals() external view returns (uint8)
JavaScript
RETURN
: The number of decimals.
description
Get the description of the underlying aggregator that the proxy points to.
function description() external view returns (string memory)
JavaScript
RETURN
: The description of the underlying aggregator.
getRoundData
Get data about a specific round, using the roundId
.
function getRoundData(uint80 _roundId) external view
returns (
uint80 roundId,
int256 answer,
uint256 startedAt,
uint256 updatedAt,
uint80 answeredInRound
)
JavaScript
Parameters
roundId
: The round ID
Return Values
roundId
: The round ID.answer
: The price.startedAt
: Timestamp of when the round started.updatedAt
: Timestamp of when the round was updated.answeredInRound
: The round ID of the round in which the answer was computed.
latestRoundData
Get the price from the latest round.
function latestRoundData() external view
returns (
uint80 roundId,
int256 answer,
uint256 startedAt,
uint256 updatedAt,
uint80 answeredInRound
)
JavaScript
Return Values
roundId
: The round ID.answer
: The price.startedAt
: Timestamp of when the round started.updatedAt
: Timestamp of when the round was updated.answeredInRound
: The round ID of the round in which the answer was computed.
version
The version representing the type of aggregator the proxy points to.
function version() external view returns (uint256)
JavaScript
RETURN
: The version number.