> ## Documentation Index
> Fetch the complete documentation index at: https://docs.base.org/llms.txt
> Use this file to discover all available pages before exploring further.

> ## Agent Instructions
> For the current source of truth, read https://docs.base.org/llms.txt and connect the Base docs MCP server at https://docs.base.org/mcp.

# Base Earn API: Get Earnings

> Return an address's earnings in one Base Earn vault for its lifetime, the last 7 or 30 days, or a custom period, with claimable rewards and current value.

Returns an address's earnings in one vault: the return to date, the return for a period, claimable rewards, and the position's current value.

Earnings depend on third-party tracking and may be unavailable, especially for a new position. A missing field means the value is unavailable, never zero. An unknown `vaultId` returns `404`.

## Path Parameters

**vaultId** `string` *required*

The vault identifier from [discovery](https://docs.base.org/sdks/base-earn/api-reference/list-vaults.md).

**address** `string` *required*

The end user's wallet, as a 20-byte `0x` hex address.

## Query Parameters

**period** `string` (default: lifetime)

`lifetime`, `7d`, `30d` or `custom`. Defaults to `lifetime`.

**start** `string`

Required with `period=custom`. An RFC 3339 timestamp with whole seconds, such as `2026-11-01T00:00:00Z`. Sending `start` or `end` with any other period returns `400`.

**end** `string`

Optional with `period=custom`. An RFC 3339 timestamp with whole seconds.

```bash cURL wrap theme={null}
curl "https://api.base.org/earn/v1/lend/vaults/01a23de5-1ff9-7bbd-af0d-f534e0ea628b/earnings/0x742d35Cc6634C0532925a3b844Bc454e4438f44e?period=7d"
```

```typescript TypeScript wrap theme={null}
const earnings = await earn(
  "GET",
  `/lend/vaults/${encodeURIComponent(vaultId)}/earnings/${encodeURIComponent(address)}?period=7d`,
);
if (!earnings.earningsAvailable) {
  // Show earnings as unavailable, not as zero.
}
```

```python Python wrap theme={null}
earnings = earn("GET", f"/lend/vaults/{vault_id}/earnings/{address}?period=7d")
if not earnings["earningsAvailable"]:
    pass  # Show earnings as unavailable, not as zero.
```

```json 200 (no earnings data) lines expandable wrap theme={null}
{
  "vaultId": "01a23de5-1ff9-7bbd-af0d-f534e0ea628b",
  "address": "0x742d35Cc6634C0532925a3b844Bc454e4438f44e",
  "network": "base",
  "period": "7d",
  "earningsAvailable": false,
  "claimableRewards": [],
  "periodReturn": {
    "available": false,
    "start": "2026-11-27T19:00:00Z",
    "end": "2026-12-04T19:00:00Z"
  },
  "currentValue": {
    "token": { "address": "0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913", "symbol": "USDC", "decimals": 6 },
    "amount": "0"
  }
}
```

The TypeScript and Python examples use the `earn()` helper from [Call the API](https://docs.base.org/sdks/base-earn/call-the-api.md).

## Response Fields

**earningsAvailable** `boolean`

`false` when there is no earnings data for this address and vault.

**returnToDate** `object`

The position's return since the first deposit, as an [amount](#amounts).

**periodReturn** `object`

The return for the requested period. Absent for `lifetime`.

**properties**

**available** `boolean`

Whether the period return is available.

**amount** `object`

The return for the period, as an [amount](#amounts).

**start** `string`

Start of the period, as an RFC 3339 timestamp.

**end** `string`

End of the period, as an RFC 3339 timestamp.

**claimableRewards** `array`

Rewards the address can claim now, as [amounts](#amounts).

**currentValue** `object`

The position's current value, as an [amount](#amounts).

**fetchedAt** `string`

When the earnings data was fetched, as an RFC 3339 timestamp.

### Amounts

Each amount is an object with these fields:

**token** `object`

The token's `address`, `symbol` and `decimals`.

**amount** `string`

The amount in the token's atomic units. It can be negative.

**amountUsd** `string`

The amount in USD. Absent when no price is available.
