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

# Migrating from V1 to V2 API

> Step-by-step guide to migrate your application from the beaconcha.in V1 API to the V2 API, with endpoint mappings and code examples.

## Why Migrate?

> [!NOTE]
>
> All new features, endpoints, and improvements are built exclusively for V2. We recommend migrating to V2 for the best experience.

* **Richer data:** V2 endpoints return more detailed, structured responses with fine-grained reward breakdowns
* **Flexible selectors:** Query by validator index, public key, or dashboard, and on Scale and Enterprise plans by deposit address, withdrawal address, or entity
* **Use cases and guides:** 14+ step-by-step guides with code examples for common workflows
* **BeaconScore® and entities:** Exclusive V2 features for performance benchmarking and entity comparison
* **Active development:** All new features ship on V2 only

***

## Need Help?

> [card] [Use Cases](https://docs.beaconcha.in/api/use-cases.md)
>
> Task-specific guides with code examples for common operations.

> [card] [Error Handling](https://docs.beaconcha.in/api/errors.md)
>
> V2 error patterns, status codes, and troubleshooting.

> [card] [AI Integration](https://docs.beaconcha.in/api/ai-integration.md)
>
> Connect your AI assistant to the beaconcha.in docs via MCP or llms.txt.

> [card] [Discord](https://dsc.gg/beaconchain)
>
> Ask questions and get help from the community.

***

## Key Differences

| Aspect | V1 API | V2 API |
| - | - | - |
| HTTP method | Mostly `GET` | All `POST` |
| Authentication | Query param (`?apikey=`) or header (`apikey: ...`) | Bearer token (`Authorization: Bearer <key>`), recommended; the V1 methods also work |
| Pagination | Offset-based (`offset` and `limit`) | Cursor-based (`cursor` and `page_size`), at most 10 items per page |
| Validator selection | Path parameter: up to 100 comma-separated validator indices or public keys | JSON body selector: validator indices or public keys (up to 100, or 20 on the Free Trial and legacy plans), or a dashboard. The deposit address, withdrawal address, and owner/operator (`entities`) selectors require a Scale or Enterprise plan |
| History | Many epochs per request, for example 100 epochs of balances | Per-epoch endpoints take one `epoch` per request. Aggregate endpoints take an evaluation window (`24h` to `all_time`), or a custom range on Scale and Enterprise plans |
| Amounts | Mostly Gwei, as integers | Wei, as decimal strings |
| Response envelope | `{ "status": "OK", "data": ... }` | `{ "data": ..., "paging": ... }` |
| Chain selection | Implicit (server URL) | `"chain"` field in request body (`"mainnet"` or `"hoodi"`), defaults to `"mainnet"` on most endpoints |

***

## Endpoint Mapping

V1 endpoints that have a V2 equivalent are no longer listed in the [V1 API reference](https://docs.beaconcha.in/api/v1-overview.md). They still respond, so existing integrations keep working, but they receive no new development. The tables below map each of them to its V2 replacement.

💎 marks a V2 feature that requires a Scale or Enterprise plan.

### Validators

| V1 | V2 | Notes |
| - | - | - |
| `GET /api/v1/validator/{indexOrPubkey}` | [`POST /api/v2/ethereum/validators`](https://docs.beaconcha.in/api-reference/ethereum/validators) | Returns status, balances, withdrawal credentials, and lifecycle epochs. For `total_withdrawals`, list the slots with [`validators/withdrawal-slots`](https://docs.beaconcha.in/api-reference/ethereum/validators/withdrawal-slots), then add up the amounts of the [`slot/withdrawals`](https://docs.beaconcha.in/api-reference/ethereum/withdrawals) rows with `status: completed`. Rejected withdrawal requests are also returned, with the requested amount, but were never paid. 💎 [`validators/metadata`](https://docs.beaconcha.in/api-reference/ethereum/validators/metadata) returns the custom `name`: `null` instead of an empty string when there is none, and also for the `Whale_0x…` names V1 returns for validators of address entities. `last_attestation_slot` is not returned. |
| `POST /api/v1/validator` | [`POST /api/v2/ethereum/validators`](https://docs.beaconcha.in/api-reference/ethereum/validators) | Send the indices or public keys in the `validator_identifiers` array. |
| `GET .../validator/eth1/{eth1address}` | [`POST /api/v2/ethereum/validators`](https://docs.beaconcha.in/api-reference/ethereum/validators) | 💎 Use the `deposit_address` selector. ENS names are not resolved. Validators that do not have an index yet appear in [`validators/queues`](https://docs.beaconcha.in/api-reference/ethereum/validators/queues), and their deposits in [`deposit-slots`](https://docs.beaconcha.in/api-reference/ethereum/validators/deposit-slots). |
| `GET .../validator/withdrawalCredentials/{...}` | [`POST /api/v2/ethereum/validators`](https://docs.beaconcha.in/api-reference/ethereum/validators) | 💎 Use the `withdrawal` selector with an address or a `0x00`, `0x01`, or `0x02` credential. ENS names are not resolved. |
| `GET .../balancehistory` | [`POST .../validators/balances`](https://docs.beaconcha.in/api-reference/ethereum/validators/balances) | One `epoch` per request: send one request for each epoch you need. |
| `GET .../attestations` | [`POST .../validators/attestation-slots`](https://docs.beaconcha.in/api-reference/ethereum/validators/attestation-slots) | Lists the slots with attestation duties. For the status and inclusion slot of each duty, use [`slot/attestation-duties`](https://docs.beaconcha.in/api-reference/ethereum/slot/attestation-duties) per slot, or [`performance-list`](https://docs.beaconcha.in/api-reference/ethereum/validators/performance-list) per epoch. Finalized epochs only. |
| `GET .../attestationefficiency` | [`POST .../validators/performance-aggregate`](https://docs.beaconcha.in/api-reference/ethereum/validators/performance-aggregate) | BeaconScore® replaces the attestation efficiency metric; the two values cannot be converted into each other. The result aggregates all selected validators. |
| `GET .../proposals` | [`POST .../validators/proposal-slots`](https://docs.beaconcha.in/api-reference/ethereum/validators/proposal-slots) | Returns the proposal slots and execution block numbers of finalized epochs. Use [`slot`](https://docs.beaconcha.in/api-reference/ethereum/slot/overview) for the proposal status and [`block`](https://docs.beaconcha.in/api-reference/ethereum/block/overview) for the block details. |
| `GET .../execution/{addressIndexOrPubkey}/produced` | [`POST .../validators/proposal-slots`](https://docs.beaconcha.in/api-reference/ethereum/validators/proposal-slots) | Select by validator index or public key, or 💎 by fee recipient with the `payload_fee_recipient` selector, which matches the fee recipient of the block's execution payload, as V1 does. Then request [`block/rewards`](https://docs.beaconcha.in/api-reference/ethereum/block/rewards) for each `block`: `total_reward` is the proposer's reward and the address it went to. [`block`](https://docs.beaconcha.in/api-reference/ethereum/block/overview) has the block details, and the relay and builder are in [`block/mev-timing`](https://docs.beaconcha.in/api-reference/ethereum/block/mev-timing) for mainnet blocks from 2024-06-03 on. Finalized proposals only, newest first: use `range` instead of `offset` and `sort`. One fee recipient per request instead of up to 20, and ENS names are not resolved. |
| `GET .../withdrawals` | [`POST .../validators/withdrawal-slots`](https://docs.beaconcha.in/api-reference/ethereum/validators/withdrawal-slots) | Lists the slots with withdrawals; [`slot/withdrawals`](https://docs.beaconcha.in/api-reference/ethereum/withdrawals) returns the amounts. |
| `GET .../validator/{indexOrPubkey}/deposits` | [`POST .../validators/deposit-slots`](https://docs.beaconcha.in/api-reference/ethereum/validators/deposit-slots) | Lists the slots of a key's deposits, also for a public key without an index yet; [`slot/deposits`](https://docs.beaconcha.in/api-reference/ethereum/deposits) returns each deposit with its transaction hash, signature, and withdrawal credentials. A deposit still in the deposit queue has no processed slot yet: request its `consensus_layer_queued` slot with `stage: consensus_layer_queued`. [`validators/queues`](https://docs.beaconcha.in/api-reference/ethereum/validators/queues) adds the estimated wait. The deposit index, the transaction index and input, and `removed` are not returned. |
| `GET /api/v1/eth1deposit/{txhash}` | [`POST /api/v2/ethereum/transaction/deposits`](https://docs.beaconcha.in/api-reference/ethereum/transaction/deposits) | 💎 Returns each deposit of the transaction: its validator, withdrawal credentials, amount (in wei, where V1 returned Gwei), sender, status, execution block, and the slots that queued and processed it. Results are paginated. A hash without deposits returns `404`, where V1 returned an empty list. The signature and its validity come from [`slot/deposits`](https://docs.beaconcha.in/api-reference/ethereum/deposits) at the processed slot; a deposit still in the deposit queue has no processed slot yet, so request its `queued_slot` with `stage: consensus_layer_queued`. The block timestamp comes from [`block`](https://docs.beaconcha.in/api-reference/ethereum/block/overview); the deposit index, the transaction index and input, and `removed` are not returned. |
| `GET .../validator/stats/{index}` | [`POST .../validators/performance-aggregate`](https://docs.beaconcha.in/api-reference/ethereum/validators/performance-aggregate) | 💎 For a day's duty counts (attestations, proposals, included slashings, sync committee), request a custom range of that day; custom ranges cover whole UTC days. Without one, add up [`performance-list`](https://docs.beaconcha.in/api-reference/ethereum/validators/performance-list) over the day's epochs. Balances come from [`validators/balances`](https://docs.beaconcha.in/api-reference/ethereum/validators/balances) at the day's first and last epoch (the minimum and maximum need every epoch of the day), deposits and withdrawals from [`deposit-slots`](https://docs.beaconcha.in/api-reference/ethereum/validators/deposit-slots) and [`withdrawal-slots`](https://docs.beaconcha.in/api-reference/ethereum/validators/withdrawal-slots), with the amounts from [`slot/deposits`](https://docs.beaconcha.in/api-reference/ethereum/deposits) and [`slot/withdrawals`](https://docs.beaconcha.in/api-reference/ethereum/withdrawals) (for withdrawals, only rows with `status: completed`). For the split into attester and proposer slashings, request [`slot`](https://docs.beaconcha.in/api-reference/ethereum/slot/overview) for each proposed block. |
| `GET /api/v1/validators/queue` | [`POST /api/v2/ethereum/queues`](https://docs.beaconcha.in/api-reference/ethereum/queues) | Network-wide queue data. The active validator count is `validators_count` in [`epoch`](https://docs.beaconcha.in/api-reference/ethereum/epoch/overview). For per-validator queue positions, use [`validators/queues`](https://docs.beaconcha.in/api-reference/ethereum/validators/queues). |

### Rewards

| V1 | V2 | Notes |
| - | - | - |
| `GET .../incomedetailhistory` | [`POST .../validators/rewards-list`](https://docs.beaconcha.in/api-reference/ethereum/validators/rewards-list) | One `epoch` per request. The missed proposal count is in [`performance-list`](https://docs.beaconcha.in/api-reference/ethereum/validators/performance-list). |
| `GET .../performance` | [`POST .../validators/rewards-aggregate`](https://docs.beaconcha.in/api-reference/ethereum/validators/rewards-aggregate) | V1's 1-day, 7-day, 31-day, and total values map to the `24h`, `7d`, `30d`, and `all_time` windows; 💎 365 days needs a custom range. `total` includes execution layer rewards: subtract `proposal.execution_layer_reward` to get consensus layer rewards only. The result aggregates all selected validators, and `rank7d` has no equivalent. V1 measures income as the balance change, so it includes slashing penalties that V2's reward columns leave out: values for slashed validators differ. V2 counts finalized epochs only, so it can trail V1. The current balance is in [`validators`](https://docs.beaconcha.in/api-reference/ethereum/validators). |
| `GET .../execution/performance` | [`POST .../validators/rewards-aggregate`](https://docs.beaconcha.in/api-reference/ethereum/validators/rewards-aggregate) | Use `proposal.execution_layer_reward`, with the same windows as above; 💎 365 days needs a custom range. |

### Epochs and Slots

| V1 | V2 | Notes |
| - | - | - |
| `GET /api/v1/epoch/{epoch}` | [`POST /api/v2/ethereum/epoch`](https://docs.beaconcha.in/api-reference/ethereum/epoch/overview) | Amounts are in wei. `participation_rate` and `attesting_balance` are `null` until the epoch is finalized; V1 returns them for recent epochs too. `blockscount` and `rewards_exported` have no V2 field. |
| `GET /api/v1/slot/{slotOrHash}` | [`POST /api/v2/ethereum/slot`](https://docs.beaconcha.in/api-reference/ethereum/slot/overview) | Select by slot number, block root, `latest`, or `finalized`. The execution payload details are in [`block`](https://docs.beaconcha.in/api-reference/ethereum/block/overview), and the fee recipient is in [`block/rewards`](https://docs.beaconcha.in/api-reference/ethereum/block/rewards). V1 `attestationscount` is `included_aggregate_count`, and `graffiti_text` is `null` instead of empty when there is no graffiti. Eth1 data votes, the sync aggregate bits and signature, the logs bloom, and `votes` (the number of validator votes that name the block as head, added up over every block that included them) are not returned. |
| `GET .../epoch/{epoch}/slots` | [`POST /api/v2/ethereum/epoch`](https://docs.beaconcha.in/api-reference/ethereum/epoch/overview), then [`POST /api/v2/ethereum/slot`](https://docs.beaconcha.in/api-reference/ethereum/slot/overview) | `slots.start` and `slots.end` give the epoch's slot range; request [`slot`](https://docs.beaconcha.in/api-reference/ethereum/slot/overview) for each of its slots. The fields that `slot` does not return are listed in the row above. |
| `GET .../slot/{slot}/deposits` | [`POST .../slot/deposits`](https://docs.beaconcha.in/api-reference/ethereum/deposits) | Since Electra, deposits are reported at the slot where they were processed. |
| `GET .../slot/{slot}/withdrawals` | [`POST .../slot/withdrawals`](https://docs.beaconcha.in/api-reference/ethereum/withdrawals) | Amounts are in wei. The withdrawal index is not returned. |

### Sync Committees

| V1 | V2 | Notes |
| - | - | - |
| `GET /api/v1/sync_committee/{period}` | [`POST /api/v2/ethereum/sync-committee/validators`](https://docs.beaconcha.in/api-reference/ethereum/sync-committee/validators) | Lists each member once, ordered by validator index, with its positions in the committee in `sync_committee_indices`. To rebuild V1's `validators` array in committee order, put each validator at each of its positions: a validator selected more than once appears once per position. The committee spans several pages: get the period number for `latest` or `next` from [`sync-committee`](https://docs.beaconcha.in/api-reference/ethereum/sync-committee/overview) first and request every page by that number, because `latest` and `next` move to the following period at a period boundary. `range` holds the start and end epochs. |

### Network Statistics

| V1 | V2 | Notes |
| - | - | - |
| `GET /api/v1/ethstore/{day}` | [`POST /api/v2/ethereum/eth-store`](https://docs.beaconcha.in/api-reference/ethereum/eth-store) | V2 returns a paginated time series that covers V1's single-day and `latest` lookups. See the differences below. |

The V2 endpoint reads the same source data as V1 and applies the same ETH.STORE®
methodology. Only the presentation changed:

* **Response shape.** V1's flat keys are grouped: `rewards.{}`, `apr.{}`, and
  `moving_averages.{}`. `avgapr7d` becomes `moving_averages.window_7d.apr.combined`,
  `cl_avgapr31d` becomes `moving_averages.window_31d.apr.consensus_layer`, and so on.
* **Timestamps.** `day_start` and `day_end` are Unix timestamps in seconds, not
  RFC 3339 strings.
* **Day selection.** Instead of a `{day}` path parameter, choose an evaluation window
  (`24h` returns the latest datapoint, up to `all_time` with pagination, most recent
  day first). Scale and Enterprise plans can also request an arbitrary range by
  timestamp, epoch, or slot.
* **Precision.** V2 returns APR values as single-precision floats, so they can differ
  from V1 in the last digits.

Both APIs express APR as a fraction, where `1.0` is 100%, and both compute the 7- and
31-day moving averages as unweighted means of the daily APR values.

### V1 Endpoints Partially Covered by V2

These V1 endpoints stay in the V1 API reference because part of their use case has no V2 equivalent yet. Use V2 for the part it covers.

| V1 | Covered in V2 | Not covered in V2 |
| - | - | - |
| [`GET .../validator/{indexOrPubkey}/blsChange`](https://docs.beaconcha.in/api-reference/validators/bls-to-execution-credential-changes) | The current `withdrawal_credentials` in [`validators`](https://docs.beaconcha.in/api-reference/ethereum/validators) | The change record: slot, signature, and previous credentials |

### V1-Only Endpoints (No V2 Equivalent Yet)

The following V1 endpoints do not have V2 equivalents at this time. They remain accessible via the V1 API.

| Category | V1 | Notes |
| - | - | - |
| Slots | [`GET .../slot/{slot}/attestations`](https://docs.beaconcha.in/api-reference/slots/attestations-for-a-slot) | Attestations included in a block. V2 [`slot/attestation-duties`](https://docs.beaconcha.in/api-reference/ethereum/slot/attestation-duties) lists the duties scheduled for a slot instead |
| Slots | [`GET .../slot/{slot}/attesterslashings`](https://docs.beaconcha.in/api-reference/slots/attester-slashings-for-a-slot) | Attester slashings. V2 [`slot`](https://docs.beaconcha.in/api-reference/ethereum/slot/overview) returns only counts |
| Slots | [`GET .../slot/{slot}/proposerslashings`](https://docs.beaconcha.in/api-reference/slots/proposer-slashings) | Proposer slashings. V2 [`slot`](https://docs.beaconcha.in/api-reference/ethereum/slot/overview) returns only counts |
| Slots | [`GET .../slot/{slot}/voluntaryexits`](https://docs.beaconcha.in/api-reference/slots/voluntary-exits-for-a-slot) | Voluntary exits. V2 [`slot`](https://docs.beaconcha.in/api-reference/ethereum/slot/overview) returns only counts |
| Other | [`POST /api/v1/client/metrics`](https://docs.beaconcha.in/api-reference/v1/client/metrics) | Pushes machine metrics. V2 [`machine-metrics`](https://docs.beaconcha.in/api-reference/machine-metrics) reads them back |

### Unlisted V1 Endpoints Without a Full V2 Equivalent

The following V1 endpoints are no longer listed in the V1 API reference, although V2 does not fully replace them. They still respond, but receive no new development. Where V2 has a close equivalent, it is listed.

| V1 | Closest V2 | Notes |
| - | - | - |
| `GET /api/v1/latestState` | [`state`](https://docs.beaconcha.in/api-reference/ethereum/state): head, justified, and finalized slots, and how far the explorer's data lags the chain | ETH prices in fiat currencies, `gasPriceGwei`, `lastProposedSlot`, and the node `syncing` flag are not available |
| `GET /api/v1/execution/block/{blockNumber}` | [`block`](https://docs.beaconcha.in/api-reference/ethereum/block/overview) and [`block/rewards`](https://docs.beaconcha.in/api-reference/ethereum/block/rewards), and [`slot`](https://docs.beaconcha.in/api-reference/ethereum/slot/overview) for the proposer | One block per request instead of up to 100. The relay and builder are in [`block/mev-timing`](https://docs.beaconcha.in/api-reference/ethereum/block/mev-timing) for mainnet blocks from 2024-06-03 on |
| `GET /api/v1/validator/leaderboard` | [`entities/owners`](https://docs.beaconcha.in/api-reference/ethereum/entities/owners) and [`entities/operators`](https://docs.beaconcha.in/api-reference/ethereum/entities/operators), ranked with `sort_by` | V2 ranks staking entities, not single validators |
| `GET /api/v1/rocketpool/stats` and `GET /api/v1/rocketpool/validator/{indexOrPubkey}` | — | Rocket Pool data is not offered in V2 |
| `GET /api/v1/execution/address/{address}`, `GET /api/v1/execution/address/{address}/erc20tokens`, `GET /api/v1/execution/gasnow`, and `GET /api/v1/ens/lookup/{domain}` | — | Execution layer address, token, gas price, and ENS data are not offered in V2 |
| `GET /api/v1/graffitiwall` | — | The graffiti wall is not offered in V2 |
| `GET /api/v1/validators/proposalLuck` | — | Proposal luck is not offered in V2 |
| `GET /api/v1/chart/{chart}` | — | Its chart images are no longer updated |

### V2-Only Endpoints (New in V2)

These endpoints are only available in V2 and have no V1 equivalent:

| Category | V2 | Notes |
| - | - | - |
| Validator Metrics | [`POST .../validators/metadata`](https://docs.beaconcha.in/api-reference/ethereum/validators/metadata) | 💎 Validator metadata, including the entities that own and run each validator |
| Validator Metrics | [`POST .../validators/apy-roi`](https://docs.beaconcha.in/api-reference/ethereum/validators/apy-roi) | APY and ROI calculations |
| Validator Metrics | [`POST .../validators/mev-timing-aggregate`](https://docs.beaconcha.in/api-reference/ethereum/validators/mev-timing-aggregate) | MEV timing of a validator set |
| Validator Metrics | [`POST .../validators/mev-timing`](https://docs.beaconcha.in/api-reference/ethereum/validators/mev-timing) | 💎 MEV timing of a validator set per day |
| Validator Duties | `POST .../validators/upcoming-duty-slots` | Pending API: the beaconcha.in team is working on this API. |
| Validator Duties | [`POST .../validators/sync-committee-periods`](https://docs.beaconcha.in/api-reference/ethereum/validators/sync-committee-periods) | Sync committee period history |
| Validator Duties | [`POST .../slot/sync-committee-duties`](https://docs.beaconcha.in/api-reference/ethereum/slot/sync-committee-duties) | Sync committee duty status and rewards for a slot |
| Validator Duties | [`POST .../validators/ptc-slots`](https://docs.beaconcha.in/api-reference/ethereum/validators/ptc-slots) 💎 and [`POST .../slot/ptc-duties`](https://docs.beaconcha.in/api-reference/ethereum/slot/ptc-duties) | Payload Timeliness Committee duties, see [Glamsterdam API](https://docs.beaconcha.in/api/glamsterdam.md) |
| Queues | [`POST .../validators/queues`](https://docs.beaconcha.in/api-reference/ethereum/validators/queues) | Queue positions and estimated wait times of your validators |
| Queues | [`POST .../validators/queues/consolidations`](https://docs.beaconcha.in/api-reference/ethereum/validators/queues/consolidations) and [`POST .../validators/queues/compounding-switches`](https://docs.beaconcha.in/api-reference/ethereum/validators/queues/compounding-switches) | Consolidation and compounding switch requests of your validators |
| Queues | [`POST /api/v2/ethereum/queues/history`](https://docs.beaconcha.in/api-reference/ethereum/queues/history) | Staking queue sizes over time |
| Queues | [`POST .../queues/request-fees`](https://docs.beaconcha.in/api-reference/ethereum/queues/request-fees) and [`POST .../queues/request-fees/current`](https://docs.beaconcha.in/api-reference/ethereum/queues/request-fees/current) | Withdrawal and consolidation request fees |
| Network | [`POST .../state/validator-statuses`](https://docs.beaconcha.in/api-reference/ethereum/state/validator-statuses) | Distribution of validator statuses |
| Network | [`POST /api/v2/ethereum/performance-aggregate`](https://docs.beaconcha.in/api-reference/ethereum/performance-aggregate) | Network-wide performance aggregate |
| Network | [`POST .../slot/consolidations`](https://docs.beaconcha.in/api-reference/ethereum/consolidations) | Consolidation and compounding switch requests in a block |
| Network | `POST /api/v2/ethereum/config` | Pending API: the beaconcha.in team is working on this API. |
| MEV | [`POST /api/v2/ethereum/mev-timing`](https://docs.beaconcha.in/api-reference/ethereum/mev-timing) | Network-wide MEV timing per day |
| MEV | [`POST .../block/mev-timing`](https://docs.beaconcha.in/api-reference/ethereum/block/mev-timing) | MEV timing outcome of a block |
| MEV | [`POST .../block/mev-bids`](https://docs.beaconcha.in/api-reference/ethereum/block/mev-bids) | 💎 All relay bids for a block |
| Entities | [`POST .../entities/owners`](https://docs.beaconcha.in/api-reference/ethereum/entities/owners) | 💎 Entities that own validators |
| Entities | [`POST .../entities/operators`](https://docs.beaconcha.in/api-reference/ethereum/entities/operators) | 💎 Entities that run validators |
| Machine Metrics | [`POST /api/v2/machine-metrics`](https://docs.beaconcha.in/api-reference/machine-metrics) and [`POST .../machine-metrics/machine-names`](https://docs.beaconcha.in/api-reference/machine-metrics/machine-names) | Reads the metrics your machines push to `POST /api/v1/client/metrics` |

***

## Migration Example: Validator Lookup

### Before (V1)

```bash theme={null}
curl 'https://beaconcha.in/api/v1/validator/1?apikey=YOUR_API_KEY'
```

### After (V2)

```bash theme={null}
curl -X POST 'https://beaconcha.in/api/v2/ethereum/validators' \
  -H 'Authorization: Bearer YOUR_API_KEY' \
  -H 'Content-Type: application/json' \
  -d '{
    "chain": "mainnet",
    "validator": {"validator_identifiers": [1]}
  }'
```

Key changes in this example:

1. `GET` becomes `POST` with a JSON body
2. The validator index moves from the URL path into the `validator` object in the request body
3. Authentication moves from query parameter to `Authorization: Bearer` header
4. The `chain` field selects the network (`mainnet` by default)

***

## Migration Example: Rewards Data

### Before (V1)

```bash theme={null}
curl -H 'apikey: YOUR_API_KEY' \
  'https://beaconcha.in/api/v1/validator/1/incomedetailhistory'
```

### After (V2)

```bash theme={null}
curl -X POST 'https://beaconcha.in/api/v2/ethereum/validators/rewards-list' \
  -H 'Authorization: Bearer YOUR_API_KEY' \
  -H 'Content-Type: application/json' \
  -d '{
    "chain": "mainnet",
    "validator": {"validator_identifiers": [1]},
    "epoch": 413950,
    "page_size": 10
  }'
```

V2 rewards data includes a detailed breakdown by duty type (attestation, sync committee, proposal) with reward, penalty, and missed reward amounts.

***

## Authentication Changes

V1 supported both query parameter and header authentication:

```bash theme={null}
# V1 - query parameter
curl 'https://beaconcha.in/api/v1/validator/1?apikey=YOUR_API_KEY'

# V1 - header
curl -H 'apikey: YOUR_API_KEY' 'https://beaconcha.in/api/v1/validator/1'
```

V2 accepts the same methods, but we recommend the Bearer token header:

```bash theme={null}
# V2 - Bearer token (recommended)
curl -H 'Authorization: Bearer YOUR_API_KEY' \
  -H 'Content-Type: application/json' \
  -X POST 'https://beaconcha.in/api/v2/ethereum/state' \
  -d '{"chain": "mainnet"}'
```

> [!NOTE]
>
> The same API key works for both V1 and V2. You do not need a new key to start using V2.

***

## Pagination Changes

V1 uses offset-based pagination. On history endpoints such as `balancehistory`, `offset` and `limit` step through epochs:

```bash theme={null}
# V1 - offset pagination
curl 'https://beaconcha.in/api/v1/validator/1/balancehistory?offset=100&limit=25&apikey=YOUR_API_KEY'
```

V2 uses cursor-based pagination. Per-epoch endpoints such as `validators/balances` take one `epoch` per request, and the cursor pages through the validators of that epoch, at most 10 per page. To build a history, send one request per epoch. The first request omits the cursor, and subsequent requests use the `cursor` value from the `paging` object in the previous response:

```bash theme={null}
# V2 - first page
curl -X POST 'https://beaconcha.in/api/v2/ethereum/validators/balances' \
  -H 'Authorization: Bearer YOUR_API_KEY' \
  -H 'Content-Type: application/json' \
  -d '{
    "chain": "mainnet",
    "validator": {"validator_identifiers": [1]},
    "epoch": 413950,
    "page_size": 10
  }'

# V2 - next page (use cursor from previous response)
curl -X POST 'https://beaconcha.in/api/v2/ethereum/validators/balances' \
  -H 'Authorization: Bearer YOUR_API_KEY' \
  -H 'Content-Type: application/json' \
  -d '{
    "chain": "mainnet",
    "validator": {"validator_identifiers": [1]},
    "epoch": 413950,
    "page_size": 10,
    "cursor": "eyJlcG9jaCI6MzQ3NTY2fQ=="
  }'
```

See the [Pagination Guide](https://docs.beaconcha.in/api/pagination.md) for full details on cursor-based pagination.

***

## Rate Limit Considerations

A single V1 history request can take many V2 requests, because V2 returns at most 10 items per page and per-epoch endpoints take one epoch per request. Your rate limit behavior also depends on your subscription type:

* **Legacy plans** (Sapphire, Emerald, Diamond): V1 and V2 use separate rate limit buckets. Your V1 quota is unaffected by V2 usage. V2 requests are limited to 1 request per second and 1,000 requests per month, and V2 selectors accept up to 20 validators.
* **Current plans** (Hobbyist, Business, Scale): V1 and V2 share a single rate limit bucket.

See the [Rate Limits guide](https://docs.beaconcha.in/api/rate-limits.md#how-v1-and-v2-rate-limits-work) for full details.


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.