# Conflicts

Historical conflict data extracted from firearms records. Unique dataset not available elsewhere.

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

## List Conflicts

`GET /v1/conflicts`

Auth: API key required  
Tier: Builder+

Returns every conflict referenced in firearm service histories, with the firearms recorded in each.

### 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 |

### Notes

- Requires **Builder** tier or higher.
- Conflicts are sorted by start year descending (most recent first).
- Conflict data is aggregated from the `conflicts` JSON field on individual firearm records.
- The `slug` field can be used with the `/v1/firearms/by-conflict` endpoint.

### Example

```bash
curl --request GET \
  --url 'https://api.gunspec.io/v1/conflicts' \
  --header 'X-API-Key: your_key'
```
