Chainlink Developers

Welcome to the Chainlink documentation site. You'll find comprehensive guides and documentation to help you start working with Chainlink as quickly as possible, as well as support if you get stuck. Click here for an introductory walkthrough on how to create a Chainlink request on the Ropsten test network!

Building on Chainlink? Click here to get started!

Get Started

Deprecated API Reference

🚧

Deprecated

This API is deprecated. Please see API Reference for the latest Price Feed API.

API reference for AggregatorInterface.

Index

Functions

NameDescription
latestAnswerGet the latest price.
latestTimestampGet the time that the price feed was last updated.
latestRoundGet the round id.
getAnswerGet the price from a specific round.
getTimestampGet the timestamp of a specific round.

Events

NameDescription
AnswerUpdatedEmitted when the answer is updated.
NewRoundEmitted when a new round is started.

Functions

latestAnswer

Get the latest price.

function latestAnswer() external view returns (int256)
  • RETURN: The latest price.

latestTimestamp

Get the time that the price feed was last updated.

function latestTimestamp() external view returns (uint256)
  • RETURN: The timestamp of the latest update.

latestRound

Get the round id, an unsigned integer representing that latest update that increments with every update.

function latestRound() external view returns (uint256)
  • RETURN: The latest round id.

getAnswer

Get the price from a specific round.

function getAnswer(uint256 roundId) external view returns (int256)
  • roundId: The round id.
  • RETURN: The price from that round.

getTimestamp

Get the timestamp of a specific round.

function getTimestamp(uint256 roundId) external view returns (uint256)
  • roundId: The round id.
  • RETURN: The timestamp from that round.

Events

AnswerUpdated

Emitted when the answer is updated.

event AnswerUpdated(int256 indexed current, uint256 indexed roundId, uint256 timestamp)
  • current: The updated price.
  • roundId: The round id.
  • timestamp: The time at which the answer was updated.

NewRound

Emitted when a new round is started.

event NewRound(uint256 indexed roundId, address indexed startedBy, uint256 startedAt)
  • roundId: The new round id.
  • startedBy: The address which starts the new round.
  • startedAt: The time the new round was started.

Updated 6 months ago


Deprecated API Reference


Suggested Edits are limited on API Reference Pages

You can only suggest edits to Markdown body content, but not to the API spec.