# AggregatorV3Interface v0.2.2 API Reference
Source: https://docs.chain.link/chainlink-local/api-reference/v0.2.2/aggregator-v3-interface

> For the complete documentation index, see [llms.txt](/llms.txt).

> **NOTE: Integrate Chainlink Local into your project**
>
> ### npm
>
> If you use [NPM](https://www.npmjs.com/), install the [@chainlink/local NPM
> package](https://www.npmjs.com/package/@chainlink/local):
>
> ```shell
> npm install @chainlink/local@0.2.2
> ```
>
> ### yarn
>
> If you use [Yarn](https://yarnpkg.com/), install the [@chainlink/local NPM
> package](https://www.npmjs.com/package/@chainlink/local):
>
> ```shell
> yarn add @chainlink/local@0.2.2
> ```
>
> ### foundry
>
> If you use [Foundry](https://book.getfoundry.sh/):
>
> ```shell
> forge install smartcontractkit/chainlink-local@cd3bfb8c42716cfb791174314eba2c0d178551b9
> ```
>
> and then set remappings to: `@chainlink/local/=lib/chainlink-local/` in either `remappings.txt` or `foundry.toml` file
>
> ### RemixIDE
>
> Import the `CCIPLocalSimulator` contract from the `@chainlink/local` package:
>
> ```solidity
> import {CCIPLocalSimulator} from "@chainlink/local@0.2.2/src/ccip/CCIPLocalSimulator.sol";
> ```

## AggregatorV3Interface

An interface for accessing detailed price feed data and metadata from an aggregator contract, providing enhanced functionality for retrieving round data and contract information.

[`AggregatorV3Interface`](https://github.com/smartcontractkit/chainlink-local/blob/cd3bfb8c42716cfb791174314eba2c0d178551b9/src/data-feeds/interfaces/AggregatorV3Interface.sol)

## Functions

### decimals

Retrieves the number of decimal places used by the aggregator.

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

> **NOTE**
>
> Gets the number of decimals used by the aggregator.

#### Returns

| Parameter | Type  | Description            |
| --------- | ----- | ---------------------- |
| (unnamed) | uint8 | The number of decimals |

### description

Retrieves the description of the aggregator.

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

> **NOTE**
>
> Gets the description of the aggregator.

#### Returns

| Parameter | Type   | Description                       |
| --------- | ------ | --------------------------------- |
| (unnamed) | string | The description of the aggregator |

### getRoundData

Retrieves the complete round data for a specific round ID.

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

> **NOTE**
>
> Gets the round data for a specific round ID.
>
> This function should raise "No data present" if no data is available for the given round ID.

#### Parameters

| Parameter | Type   | Description                      |
| --------- | ------ | -------------------------------- |
| \_roundId | uint80 | The round ID to get the data for |

#### Returns

| Parameter       | Type    | Description                                   |
| --------------- | ------- | --------------------------------------------- |
| roundId         | uint80  | The round ID                                  |
| answer          | int256  | The answer for the round                      |
| startedAt       | uint256 | The timestamp when the round started          |
| updatedAt       | uint256 | The timestamp when the round was updated      |
| answeredInRound | uint80  | The round ID in which the answer was computed |

### latestRoundData

Retrieves the complete round data for the most recent round.

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

> **NOTE**
>
> Gets the latest round data.
>
> This function should raise "No data present" if no data is available.

#### Returns

| Parameter       | Type    | Description                                          |
| --------------- | ------- | ---------------------------------------------------- |
| roundId         | uint80  | The latest round ID                                  |
| answer          | int256  | The latest answer                                    |
| startedAt       | uint256 | The timestamp when the latest round started          |
| updatedAt       | uint256 | The timestamp when the latest round was updated      |
| answeredInRound | uint80  | The round ID in which the latest answer was computed |

### version

Retrieves the version number of the aggregator.

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

> **NOTE**
>
> Gets the version of the aggregator.

#### Returns

| Parameter | Type    | Description                   |
| --------- | ------- | ----------------------------- |
| (unnamed) | uint256 | The version of the aggregator |