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+

Get an SVG silhouette (line art) of a firearm.

getSilhouette(id: string, params?: SilhouetteParams): Promise<APIResponse<Silhouette>>
GET/v1/firearms/{id}/silhouette

  • stringheaderrequired

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

  • stringrequired

    Resource slug ID

    Accepts
    a lowercase slug: letters, digits and hyphens
    Example

  • stringdefaultraw

    An SVG file (raw; svg is accepted as the same thing, the name SDK 0.1.x used), an inline data URI, or the SVG source as JSON

    Accepts
    Example
  • integerdefault0

    Inject a stroke so the line art reads on any background. 0 leaves it unstroked; anything above 20 is clamped to 20

    Range
    0 – 20
    Example
  • stringdefaultblack

    Colour of that stroke. Any CSS colour the browser understands: a name, a hex value, rgb(), oklch(), color-mix(). Quotes, angle brackets, ampersands and backslashes are refused, because the value is written into an SVG attribute

    Max length
    64
    Example

  • object

    The response payload.

  • string

    Slug of the firearm.

  • string

    Display name, as the maker writes it.

  • string

    Slug of the line-art file, which is the firearm slug.

  • string

    Which JSON form this is: datauri or svg.

  • string

    Media type of the bytes, e.g. image/png.

  • string

    Present when format=datauri: the SVG inlined as an RFC 2397 data URI.

  • string

    Present when format=json: the SVG source, for parsing or manipulating in code.

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

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

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