# Conflicts

Resource class for interacting with the GunSpec Conflicts API. Wraps the `/v1/conflicts` endpoint. Instantiated internally by the GunSpec client and exposed as `client.conflicts`.

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

## client.conflicts.list()

`GET /v1/conflicts`

Auth: API key required  
Tier: Builder+

List all military conflicts in the database. Returns conflicts with metadata including name, date range, and participating nations. Use the conflict identifiers with `client.firearms.byConflict()` to find firearms used in a specific conflict.

### Response 200 (application/json)

| Field | Type | Description |
| --- | --- | --- |
| `data` | object[] | The response payload. |
| `data[].name` | string | Display name, as the maker writes it. |
| `data[].firearmCount` | integer | How many firearms this row covers. |
| `data[].firearms` | object[] | The firearms recorded as used in this conflict. |
| `data[].firearms[].id` | string | Slug of the firearm. |
| `data[].firearms[].name` | string | Display name, as the maker writes it. |

```json
{
  "success": true,
  "data": [
    {
      "name": "Vietnam War",
      "firearmCount": 34,
      "firearms": [
        {
          "id": "m16a1",
          "name": "M16A1"
        }
      ]
    }
  ]
}
```

### 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/conflicts' \
  --header 'X-API-Key: your_key'
```
