GunSpec

Firearms

Resource class for interacting with the GunSpec Firearms API. Wraps all /v1/firearms endpoints. Instantiated internally by the GunSpec client and exposed as client.firearms.

Auth RequiredExplorer+

Get all variants of a firearm.

getVariants(id: string): Promise<APIResponse<Firearm[]>>
GET/v1/firearms/{id}/variants

  • stringheaderrequired

    Your API key. Authorization: Bearer <key> is accepted in its place.

  • stringrequired

    Firearm slug

    Accepts
    a lowercase slug: letters, digits and hyphens
    Example

  • FirearmVariant[]

    The response payload.

  • string

    URL-safe slug identifying the firearm, e.g. glock-17-gen5.

  • string

    Display name, as the maker writes it.

  • string | null

    How this record differs from its parent: optics_ready, compact, threaded and so on. Null when the record has no parent.

  • integer | null

    Year it entered production or service. Null where the date is disputed or unknown.

  • FirearmStatus | null

    Production status, one of in_production, discontinued, out_of_production, in_service, limited_production, prototype. Discontinued records are kept deliberately: a rifle built in 2004 wears parts nobody sells today.

  • 400VALIDATION_ERRORValidation error
  • 401UNAUTHORIZEDAPI key required
  • 403FORBIDDENValid key, not permitted
  • 404NOT_FOUNDResource not found
  • 429RATE_LIMITEDRate limit exceeded
  • 500INTERNAL_ERRORUnexpected server error

Minimum tier
Explorer+
Monthly quota
200/mo
Rate limit
10/min
Daily cap
50

Figures shown are for this endpoint's minimum tier. Higher tiers raise every limit.