# Get validators

Get a paginated list of validators

```
GET /validators
```

## Query params

| Query param  | Description                                                                                                                                         |
| ------------ | --------------------------------------------------------------------------------------------------------------------------------------------------- |
| `era_id`     | Active auction era identifier. Data for older eras aren't persistent for long, and will eventually become unavailable. This is a required parameter |
| `is_active`  | Validator active filter param                                                                                                                       |
| `public_key` | Comma-separated list of public key                                                                                                                  |

## Sorting

| Property            | Description                          |
| ------------------- | ------------------------------------ |
| `rank`              | Sort validators by rank              |
| `fee`               | Sort validators by fee               |
| `delegators_number` | Sort validators by delegators number |
| `total_stake`       | Sort validators by total stake       |
| `self_stake`        | Sort validators by self stake        |
| `network_share`     | Sort validators by network share     |

Default sorting is `total_stake DESC`

## Optional properties

| Property                   | Type                                                                                  | Description                                                                                             |
| -------------------------- | ------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------- |
| `account_info`             | [`AccountInfo`](https://docs.cspr.cloud/rest-api/account-info)                        | [Account info](https://github.com/make-software/casper-account-info-contract) provided by the validator |
| `centralized_account_info` | [`CentralizedAccountInfo`](https://docs.cspr.cloud/rest-api/centralized-account-info) | Account information available for known accounts provided by CSPR.cloud team                            |
| `cspr_name`                | `string`                                                                              | Primary CSPR.name of the validator account                                                              |
| `average_performance`      | [`ValidatorPerformance`](https://docs.cspr.cloud/rest-api/validator-performance)      | Validator average performance                                                                           |

## Response

[`PaginatedResponse`](https://docs.cspr.cloud/documentation/overview/pagination)[`<Validator>`](https://docs.cspr.cloud/rest-api/validator)

## Example

{% hint style="info" %}
Since this API works only with recent eras, you'll need to replace the era ID with the latest one, which you can fetch using the [Get auction metrics API](https://docs.cspr.cloud/rest-api/auction-metrics/get-auction-metrics).
{% endhint %}

```bash
curl -X 'GET' \
  'https://api.testnet.cspr.cloud/validators?era_id=18011' \
  -H 'accept: application/json' \
  -H 'authorization: 55f79117-fc4d-4d60-9956-65423f39a06a'

```

```json
{
  "item_count": 97,
  "page_count": 10,
  "data": [
    {
      "bid_amount": "6899894365588738",
      "delegators_number": 128,
      "delegators_stake": "99740346894080564",
      "era_id": 18011,
      "fee": 10,
      "is_active": true,
      "maximum_delegation_amount": "1000000000000000000",
      "minimum_delegation_amount": "500000000000",
      "network_share": "9.7307688184699",
      "public_key": "0106ca7c39cd272dbf21a86eeb3b36b7c26e2e9b94af64292419f7862936bca2ca",
      "rank": 1,
      "reserved_slots": 0,
      "self_share": "6.47025389673254",
      "self_stake": "6899894365588738",
      "total_stake": "106640241259669302"
    },
    {
      "bid_amount": "6415411735193897",
      "delegators_number": 135,
      "delegators_stake": "99951924469972479",
      "era_id": 18011,
      "fee": 5,
      "is_active": true,
      "maximum_delegation_amount": "1000000000000000000",
      "minimum_delegation_amount": "500000000000",
      "network_share": "9.7058666242945",
      "public_key": "017d96b9a63abcb61c870a4f55187a0a7ac24096bdb5fc585c12a686a4d892009e",
      "rank": 2,
      "reserved_slots": 0,
      "self_share": "6.03137388231623",
      "self_stake": "6415411735193897",
      "total_stake": "106367336205166376"
    },
    ...
    {
      "bid_amount": "422344060138949",
      "delegators_number": 7,
      "delegators_stake": "93505148759339619",
      "era_id": 18011,
      "fee": 10,
      "is_active": true,
      "maximum_delegation_amount": "1000000000000000000",
      "minimum_delegation_amount": "500000000000",
      "network_share": "8.5707487860917",
      "public_key": "012b365e09c5d75187b4abc25c4aa28109133bab6a256ef4abe24348073e590d80",
      "rank": 3,
      "reserved_slots": 0,
      "self_share": "0.44964902975816",
      "self_stake": "422344060138949",
      "total_stake": "93927492819478568"
    }
  ]
}
```
