Firearm Discovery

Rank firearms by a superlative

Returns the firearms that lead a single measurable stat. Records missing the underlying measurement are excluded rather than ranked as zero.

Requires Builder tier or higher.

get/v1/firearms/top

Request

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

Query parameters

stat'lightest' | 'heaviest' | 'longest-range' | 'highest-rof' | 'most-compact' | 'highest-capacity' | 'most-powerful' required

Which superlative to rank by

categorystring

Restrict the ranking to a category slug

limitinteger

How many to return

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

Rank firearms by a superlative

successboolean required

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

Example response

{
  "success": true,
  "data": [
    {
      "id": "glock-g17-gen5",
      "name": "Glock 17 Gen5",
      "manufacturerId": "glock",
      "categoryId": "pistol",
      "value": 625,
      "unit": "g"
    }
  ]
}

Changes

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