Firearm Discovery

Compare two firearms head to head

Returns a per-stat verdict between exactly two firearms, plus the win/loss/draw tally across all compared stats.

Requires Builder tier or higher.

get/v1/firearms/head-to-head

Request

  • Base URL: https://api.gunspec.io
  • URL: https://api.gunspec.io/v1/firearms/head-to-head
  • Auth: one of:
    • API key in header X-API-Key
    • HTTP bearer

Query parameters

astring required

First firearm slug

bstring required

Second firearm slug

Headers

If-None-Matchstring

The ETag from a previous response. If the body would be byte-identical, the API answers 304 Not Modified with no body. A 304 counts toward the per-minute rate limit but not the daily request allowance.

Response

Compare two firearms head to head

successboolean required

Always true on a successful response. Every error carries false and an error object instead.

Example response

{
  "success": true,
  "data": {
    "a": {
      "id": "glock-g17-gen5",
      "name": "Glock 17 Gen5",
      "manufacturer_id": "glock",
      "category_id": "pistol",
      "weight_empty_g": 625,
      "overall_length_mm": 202,
      "barrel_length_mm": 114,
      "magazine_capacity": 17,
      "muzzle_velocity_mps": 375,
      "muzzle_energy_j": 500,
      "effective_range_m": 50,
      "year_introduced": 2017,
      "country_of_origin": "AT",
      "action_type": "short_recoil"
    },
    "b": {
      "id": "glock-g17-gen5",
      "name": "Glock 17 Gen5",
      "manufacturer_id": "glock",
      "category_id": "pistol",
      "weight_empty_g": 625,
      "overall_length_mm": 202,
      "barrel_length_mm": 114,
      "magazine_capacity": 17,
      "muzzle_velocity_mps": 375,
      "muzzle_energy_j": 500,
      "effective_range_m": 50,
      "year_introduced": 2017,
      "country_of_origin": "AT",
      "action_type": "short_recoil"
    },
    "verdicts": {
      "weightEmptyG": {
        "winner": "a",
        "a": 625,
        "b": 833,
        "better": "lighter"
      },
      "magazineCapacity": {
        "winner": "b",
        "a": 17,
        "b": 21,
        "better": "higher"
      }
    }
  }
}

Changes

No recorded changes to this operation across all 1 revision of this API.