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.

Authentifizierung erforderlichBuilder+

Calculate ballistics for a firearm with specific ammunition.

calculate(id: string, params: CalculateBallisticsParams): Promise<APIResponse<FirearmCalculation>>
GET/v1/firearms/{id}/calculate

  • stringHeadererforderlich

    Ihr API-Schlüssel. Authorization: Bearer <key> wird ebenfalls akzeptiert.

  • stringerforderlich

    Resource slug ID

    Akzeptiert
    a lowercase slug: letters, digits and hyphens
    Beispiel

  • stringerforderlich

    Ammunition load to fire

    Max. Länge
    255
    Beispiel

  • object

    Muzzle solution adjusted for this firearm barrel length, against its published figures.

  • BallisticsFirearm

    The firearm the solution was computed for. barrelLengthMm is absent when the firearm has no recorded barrel.

  • string

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

  • string

    Display name, as the maker writes it.

  • number

    Barrel length in millimetres, measured from the breech face.

  • object

    The load the calculation used.

  • string

    Slug of the ammunition load that was fired.

  • string

    Display name, as the maker writes it.

  • object

    The figures derived for the barrel length asked about, rather than the reference one.

  • number

    Muzzle velocity in metres per second, for the default load.

  • number

    Muzzle energy in joules, for the default load.

  • TerminalBallistics

    Terminal performance indices computed at the muzzle.

  • object

    The figures published for this firearm, where the catalog records them.

  • number | null

    Muzzle velocity in metres per second, for the default load.

  • number | null

    Muzzle energy in joules, for the default load.

  • object

    Computed minus source-reported. Null where no source figure exists to compare against.

  • number | null

    Remaining velocity at this distance, in metres per second.

  • number | null

    Remaining energy at this distance, in joules.

  • string | null

    Why the calculation could not be completed, or null when it succeeded.

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

Mindeststufe
Builder+
Monatskontingent
25,000/mo
Anfragerate
60/min
Tageslimit
2,000

Die Werte gelten für die Mindeststufe dieses Endpunkts. Höhere Stufen erhöhen alle Limits.