GunSpec

Stats

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

Auth RequiredStudio+

Get firearm statistics for a specific decade/era.

byEra(params: ByEraParams): Promise<APIResponse<EraStats>>
GET/v1/stats/by-era

  • stringheaderrequired

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

  • stringrequired

    Decade to report on, formatted like "1990s"

    Example

  • object

    The response payload.

  • integer

    Firearms introduced in the decade.

  • number | null

    Mean unloaded weight in grams, over those that record one.

  • number | null

    Mean magazine capacity, over those that record one.

  • number | null

    Mean barrel length in millimetres, over those that record one.

  • integer | null

    Earliest introduction year inside the decade that any record carries.

  • integer | null

    Latest introduction year inside the decade that any record carries.

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

Minimum tier
Studio+
Monthly quota
150,000/mo
Rate limit
120/min
Daily cap
10,000

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