Firearm Analysis

Compare how much ammunition each firearm carries per kilogram

Returns, for each of up to 5 firearms, its ammunition as a weight, in two kinds of figure that are never mixed.

Derived from the catalogue: a full magazine is the firearm's loaded weight less its empty weight, as load carriage takes it, and from it and the magazine's capacity come the rounds carried per kilogram of full magazines and how many full magazines and rounds fit budget_kg. Only a detachable magazine comes out whole, so a firearm with a fixed magazine, a tube or a clip is answered without these, with a warning.

Estimated by the fitted cartridge-mass model: a basic load of rounds rounds (default magazines times the capacity) and of magazines full magazines, from the bullet (the load named by ammo_id, or the cartridge's typical bullet) and the case's dimensions. The model was fitted to four cartridges whose mass a source states and misses none by more than 8.5%; every estimate carries that error as a range, and is labelled estimated. An estimate is never catalogue data.

The model also checks each derived magazine: one lighter than its rounds alone are estimated to weigh, allowing the model's whole error, means one of the record's two weights is wrong, and the answer says so beside the figures derived from it.

Requires Builder tier or higher.

get/v1/firearms/ammo-load

Request

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

Query parameters

idsstring required

Comma-separated firearm slugs, maximum 5.

ammo_idstring

A load whose bullet the estimate uses, for the firearms that fire its cartridge. Without it, each cartridge's typical bullet.

budget_kgnumber

A weight of full magazines to fill, in kg.

magazinesinteger

Full magazines in the estimated basic load.

roundsinteger

Rounds in the estimated basic load. Default: magazines times the capacity.

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 how much ammunition each firearm carries per kilogram

successboolean required

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

Example response

{
  "success": true,
  "data": {
    "method": {
      "id": "ammo-load",
      "name": "Magazine arithmetic and the fitted cartridge-mass model",
      "maxErrorPct": 8.5,
      "fittedEnvelopeCm3": [
        2.6
      ],
      "references": [
        {
          "name": "7.62×39mm",
          "load": "57-N-231",
          "roundG": 16.3,
          "source": "https://en.wikipedia.org/wiki/7.62%C3%9739mm"
        }
      ]
    },
    "load": {
      "budgetKg": 5,
      "magazines": 7,
      "defaulted": [
        "magazines"
      ]
    },
    "results": [
      {
        "firearm": {
          "id": "hk416",
          "name": "HK416",
          "magazineType": "detachable_box",
          "magazineCapacity": 30
        },
        "cartridge": {
          "caliberId": "5-56x45mm-nato",
          "bulletG": 4,
          "bulletSource": "caliber",
          "envelopeCm3": 3.222
        },
        "magazine": {
          "loadedMagazineG": 400,
          "capacity": 30,
          "roundsPerKg": 75,
          "check": {
            "roundsG": {
              "expected": 361.7
            },
            "bandG": {
              "low": 309,
              "high": 879.3
            }
          }
        },
        "budget": {
          "magazines": 12,
          "rounds": 360,
          "massG": 4800,
          "leftoverG": 200
        },
        "basicLoad": {
          "rounds": 210,
          "roundG": {
            "expected": 12.06
          },
          "roundsG": {
            "expected": 2531.6
          },
          "magazines": 7,
          "magazinesG": {
            "expected": 3345.3
          }
        },
        "delta": {
          "roundsPerKg": 25,
          "budgetRounds": 120
        }
      }
    ]
  }
}

Changes

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