# Hero Filters

> `GET /api/academy/heroes`: Academy endpoint of the Rone Arena API.

Retrieve a list of heroes with filtering options for role and lane. Supports query parameters for role, lane, pagination, sorting, and localization.

Query parameters:
- **role**: Role filter. Multi allowed: `tank`, `fighter`, `assassin`, `mage`, `marksman`, `support`. Example: `role=tank&role=fighter`.
- **lane**: Lane filter. Multi allowed: `exp`, `mid`, `roam`, `jungle`, `gold`. Example: `lane=exp&lane=mid`.
- **size**: Number of items per page (minimum: 1).
- **index**: Page index (starting from 1).
- **order**: Sort order for results. Allowed values: `asc`, `desc`.
- **lang**: Language code for localized content (default: `en`).

The response includes hero filter data:
- **records**: Array of hero entries, each containing:
    - **data**:
        - **hero_id**: Unique hero identifier.
        - **head**: Hero portrait image URL.
        - **hero**:
            - **data**:
                - **name**: Hero name (e.g., 'Miya').

This endpoint is useful for:
- Filtering heroes by gameplay role.
- Filtering heroes by lane assignment.
- Displaying customized hero lists in the in-game Academy.

## Request

`GET https://arena.rone.dev/api/academy/heroes`

### Parameters

| Name | In | Type | Required | Default | Description |
| --- | --- | --- | --- | --- | --- |
| `role` | query | array of string | no | `tank, fighter, assassin, mage, marksman, support` | Filter heroes by role. |
| `lane` | query | array of string | no | `exp, mid, roam, jungle, gold` | Filter heroes by lane. |
| `size` | query | integer | no | `20` | Number of items per page. Range: 1... |
| `index` | query | integer | no | `1` | Page index for pagination. Range: 1... |
| `order` | query | string | no | `asc` | Sort order by hero ID. One of: `asc`, `desc`. |
| `lang` | query | string | no | `en` | Language code for localized content. One of: `en`, `id`, `ru`, `es`, `pt`, `tr`, `ar`, `de`, `fr`, `it`, `ja`, `ko`, `th`, `vi`, `zh-CN`, `zh-TW`, `km`. |

### Example

```bash
curl -X GET 'https://arena.rone.dev/api/academy/heroes'
```

## Example response

```json
{
  "code": 0,
  "message": "OK",
  "data": {
    "records": [
      {
        "data": {
          "head": "https://wsrv.nl/?url=https%3A%2F%2Fakmweb.youngjoygame.com%2Fweb%2Fgms%2Fimage%2F299d8aab8de508fff88c1f1e935017cb.jpg",
          "hero": {
            "data": {
              "name": "Miya"
            }
          },
          "hero_id": 1
        }
      }
    ],
    "total": 132
  }
}
```

## Links

- Try it in the playground: https://arena.rone.dev/web/academy/heroes
- Academy endpoints: https://arena.rone.dev/web/academy.md
- OpenAPI schema: https://arena.rone.dev/api/openapi.json
