# Price Feed API Reference

When you use price feed, retrieve the feeds through the `AggregatorV3Interface` and the proxy address.&#x20;

## AggregatorV3Interface <a href="#aggregatorv3interface" id="aggregatorv3interface"></a>

Import this interface to your contract and use it to run functions in the proxy contract. Create the interface object by pointing to the proxy address. For example, on Bitlayer you could create the interface object in the constructor of your contract using the following example:

```solidity
/**
 * Network: Bitlayer
 * Data Feed: BTC/USD
 * Address: 0x62d2c5dEe038FaEbc3F6ec498fD2Bbb3b0080B03
 */
constructor() {
  priceFeed = AggregatorV3Interface(0x62d2c5dEe038FaEbc3F6ec498fD2Bbb3b0080B03);
}
```

```solidity
// SPDX-License-Identifier: MIT
pragma solidity >0.8.0;


interface AggregatorV3Interface {

  function decimals() external view returns (uint8);
  function description() external view returns (string memory);
  function version() external view returns (uint256);

  // getRoundData and latestRoundData should both raise "No data present"
  // if they do not have data to report, instead of returning unset values
  // which could be misinterpreted as actual reported values.
  function getRoundData(uint80 _roundId)
    external
    view
    returns (
      uint80 roundId,
      int256 answer,
      uint256 startedAt,
      uint256 updatedAt,
      uint80 answeredInRound
    );

}
```

## Functions in AggregatorV3Interface <a href="#functions-in-aggregatorv3interface" id="functions-in-aggregatorv3interface"></a>

| Name                          | Description                                                          |
| ----------------------------- | -------------------------------------------------------------------- |
| [decimals](#decimals)         | The number of decimals in the response.                              |
| [description](#description)   | The description of the aggregator that the proxy points to.          |
| [getRoundData](#getrounddata) | Get data from a specific round.                                      |
| [version](#version)           | The version representing the type of aggregator the proxy points to. |

### **decimals**

Get the number of decimals present in the response value.

```solidity
function decimals() external view returns (uint8);
```

* `RETURN`: The number of decimals.

### **description**

Get the description of the underlying aggregator that the proxy points to.

```solidity
function description() external view returns (string memory);
```

* `RETURN`: The description of the underlying aggregator.

### **getRoundData**

Get data about a specific round, using the `roundId`.

```solidity
function getRoundData(
  uint80 _roundId
) external view returns (uint80 roundId, int256 answer, uint256 startedAt, uint256 updatedAt, uint80 answeredInRound);
```

**Parameters:**

* `_roundId`: The round Id

**Return values:**

* `roundId`: The round Id
* `answer`: The answer for this round
* `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.

```solidity
function version() external view returns (uint256)
```

* `RETURN`: The version number.<br>
