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+

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

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

  • stringHeadererforderlich

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

  • stringerforderlich

    Resource slug ID

    Akzeptiert
    a lowercase slug: letters, digits and hyphens
    Beispiel

  • stringstandardraw

    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

    Akzeptiert
    Beispiel
  • integerstandard0

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

    Bereich
    0 – 20
    Beispiel
  • stringstandardblack

    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. Länge
    64
    Beispiel

  • 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

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.