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 RequiredBuilder+

Full-text search across firearms.

search(params: SearchFirearmsParams): Promise<PaginatedResponse<Firearm>>
GET/v1/firearms/search

  • stringheaderrequired

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

  • stringrequired

    Search query

    Max length
    200
    Example
  • integerdefault1

    Page number, from 1 to 10,000

    Range
    1 – 10000
    Example
  • integerdefault20

    Items per page (max 100)

    Range
    1 – 100
    Example
  • string

    Only matches from this manufacturer slug

    Max length
    100
    Example
  • string

    Only matches in this category slug

    Max length
    100
    Example
  • string

    Only matches with this action type, as stored and underscored. The vocabulary is /v1/firearms/action-types

    Max length
    100
    Example
  • string

    Only matches from this ISO 3166-1 alpha-2 country code

    Max length
    10
    Example

  • FirearmSearchResult[]

    One search hit. The field names are snake_case here, unlike /v1/firearms and the rest of the catalog: these are the search view's own columns and renaming them would break every consumer already reading them. manufacturer_name and category_name are joined in so a result list renders without a second call.

  • string

    URL-safe slug identifying the firearm. Stable: it is what a mirror keys on.

  • string

    Display name, as the maker writes it.

  • string | null

    Slug of the manufacturer. manufacturerId on the camelCase endpoints.

  • string | null

    Slug of the category. categoryId on the camelCase endpoints.

  • string | null

    Display name of the manufacturer, joined in so a result row needs no second call.

  • string | null

    Display name of the category.

  • string | null

    Slug of the category again, under the name the search view uses. Same value as category_id.

  • integer | null

    Year the model was introduced.

  • 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.

  • string | null

    ISO 3166-1 alpha-2 code of the country of origin.

  • string | null

    Operating action as stored, underscored, e.g. short_recoil, bolt_action, gas_operated. The full vocabulary is /v1/firearms/action-types; a hyphenated value matches nothing.

  • number | null

    Unloaded weight in grams, without magazine.

  • number | null

    Barrel length in millimetres, measured from the breech face.

  • string | null

    Line-art silhouette, or null where none has been drawn.

  • string | null

    GLB model, or null where none is on file.

  • integer

    How many accounts have favorited this record.

  • number | null

    FTS5 relevance score the page is ordered by. Lower is a better match (SQLite bm25 scores are negative), and it is only comparable within one response. Absent or null when the query fell back to a plain substring match, which has no ranking.

  • InlineMediaItem[]

    Every image this firearm has, silhouette first. Empty when none are on file.

  • integer

    Autoincrementing image id.

  • string

    Absolute, directly fetchable URL.

  • MediaKind

    What kind of asset a media row is.

  • string | null

    Alt text, where one has been written. Null otherwise, so do not render an empty string.

  • integer | null

    Pixel width, where it is known.

  • integer | null

    Pixel height, where it is known.

  • string | null

    The firearm's alternate name the query matched, when its own name did not: a special edition is filed as an alternate name on the model it is an edition of, so searching for the edition returns the model with the edition's name here. Null when the record's own name matched, or the match came from the maker, a caliber or the description.

  • string | null

    edition when matched_name is an edition of this model (a limited, anniversary, engraved or finish edition), alternate when it is another name for it. Null when matched_name is null.

  • number

    Current page number

  • number

    Items per page

  • number

    Total matching records (Builder and above)

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

Minimum tier
Builder+
Monthly quota
25,000/mo
Rate limit
60/min
Daily cap
5,000

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

This read answers conditional requests. Keep the ETag from a response and send it back as If-None-Match: an unchanged record returns 304 Not Modified with no body, which counts toward your per-minute rate limit but not your daily allowance.