# AggregatorInterface v0.3.0 API Reference
Source: https://docs.chain.link/chainlink-local/api-reference/v0.3.0/aggregator-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.3.0
> ```
>
> ### 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.3.0
> ```
>
> ### foundry
>
> If you use [Foundry](https://book.getfoundry.sh/):
>
> ```shell
> forge install smartcontractkit/chainlink-local@v0.3.0
> ```
>
> 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.3.0/src/ccip/CCIPLocalSimulator.sol";
> ```

## AggregatorInterface

Basic price feed interface.

[AggregatorInterface](https://github.com/smartcontractkit/chainlink-local/blob/v0.3.0/src/data-feeds/interfaces/AggregatorInterface.sol)

## Events

### AnswerUpdated

Emitted when the answer is updated.

```solidity
event AnswerUpdated(int256 indexed current, uint256 indexed roundId, uint256 updatedAt);
```

**Parameters**

| Name        | Type      | Description                                      |
| ----------- | --------- | ------------------------------------------------ |
| `current`   | `int256`  | - The updated answer.                            |
| `roundId`   | `uint256` | - The round ID for which the answer was updated. |
| `updatedAt` | `uint256` | - The timestamp when the answer was updated.     |

### NewRound

Emitted when a new round is started.

```solidity
event NewRound(uint256 indexed roundId, address indexed startedBy, uint256 startedAt);
```

**Parameters**

| Name        | Type      | Description                                          |
| ----------- | --------- | ---------------------------------------------------- |
| `roundId`   | `uint256` | - The round ID of the new round.                     |
| `startedBy` | `address` | - The address of the account that started the round. |
| `startedAt` | `uint256` | - The timestamp when the round was started.          |

## Functions

### getAnswer

Gets the answer for a specific round ID.

```solidity
function getAnswer(uint256 roundId) external view returns (int256);
```

**Parameters**

| Name      | Type      | Description                           |
| --------- | --------- | ------------------------------------- |
| `roundId` | `uint256` | - The round ID to get the answer for. |

**Returns**

| Name     | Type     | Description                                 |
| -------- | -------- | ------------------------------------------- |
| `<none>` | `int256` | int256 - The answer for the given round ID. |

### getTimestamp

Gets the timestamp for a specific round ID.

```solidity
function getTimestamp(uint256 roundId) external view returns (uint256);
```

**Parameters**

| Name      | Type      | Description                              |
| --------- | --------- | ---------------------------------------- |
| `roundId` | `uint256` | - The round ID to get the timestamp for. |

**Returns**

| Name     | Type      | Description                                     |
| -------- | --------- | ----------------------------------------------- |
| `<none>` | `uint256` | uint256 - The timestamp for the given round ID. |

### latestAnswer

Gets the latest answer from the aggregator.

```solidity
function latestAnswer() external view returns (int256);
```

**Returns**

| Name     | Type     | Description                 |
| -------- | -------- | --------------------------- |
| `<none>` | `int256` | int256 - The latest answer. |

### latestRound

Gets the latest round ID from the aggregator.

```solidity
function latestRound() external view returns (uint256);
```

**Returns**

| Name     | Type      | Description                    |
| -------- | --------- | ------------------------------ |
| `<none>` | `uint256` | uint256 - The latest round ID. |

### latestTimestamp

Gets the timestamp of the latest answer from the aggregator.

```solidity
function latestTimestamp() external view returns (uint256);
```

**Returns**

| Name     | Type      | Description                                   |
| -------- | --------- | --------------------------------------------- |
| `<none>` | `uint256` | uint256 - The timestamp of the latest answer. |