# Features

Resource class for the GunSpec Features API. Exposed as `client.features`. A single firearm's icons are `feature_icon` items in `client.firearms.listMedia(id)`; this lists them all.

Source: https://docs.gunspec.io/en/sdk/features

## client.features.listIcons()

`GET /v1/features/icons`

Auth: API key required  
Tier: Explorer+

List the drawn feature icons, a page at a time. On every plan.

### Query parameters

| Name | Type | Required | Description |
| --- | --- | --- | --- |
| `q` | string | no | Part of an icon's name; spaces and hyphens read as underscores, so `picatinny rail` finds `picatinny_rail` |
| `page` | integer | no | Page number, from 1 to 10,000 |
| `per_page` | integer | no | Items per page (max 100) |

### Response 200 (application/json)

| Field | Type | Description |
| --- | --- | --- |
| `data` | FeatureIcon[] | One page of results |
| `data[].name` | string | The icon's file name without extension, e.g. `5r_rifling`. Stable across releases. |
| `data[].label` | string | The name as a reader would write it, e.g. `5R Rifling`. |
| `data[].iconUrl` | string | The drawing on the assets CDN, a WebP image. Public: it needs no key to fetch. |
| `pagination.page` | number | Current page number |
| `pagination.per_page` | number | Items per page |
| `pagination.total` | number | Total matching records (Builder and above) |

```json
{
  "success": true,
  "data": [
    {
      "name": "5r_rifling",
      "label": "5R Rifling",
      "iconUrl": "https://assets.gunspec.io/content/features/simple/5r_rifling.webp"
    }
  ],
  "pagination": {
    "page": 1,
    "limit": 20,
    "per_page": 20,
    "total": 42,
    "totalPages": 3
  }
}
```

### Errors

| Status | Code | Message |
| --- | --- | --- |
| 400 | `VALIDATION_ERROR` | Validation error |
| 401 | `UNAUTHORIZED` | API key required |
| 403 | `FORBIDDEN` | Valid key, not permitted |
| 429 | `RATE_LIMITED` | Rate limit exceeded |
| 500 | `INTERNAL_ERROR` | Unexpected server error |

### Example

```bash
curl --request GET \
  --url 'https://api.gunspec.io/v1/features/icons?q=rifling' \
  --header 'X-API-Key: your_key'
```
