Firearms

Get silhouette line art

Returns the scalable line-art silhouette for a firearm, sized to its real-world dimensions.

Requires Builder tier or higher.

get/v1/firearms/{id}/silhouette

Request

  • Base URL: https://api.gunspec.io
  • URL: https://api.gunspec.io/v1/firearms/{id}/silhouette
  • Auth: one of:
    • API key in header X-API-Key
    • HTTP bearer

Path parameters

idstring required

Resource slug ID

Query parameters

format'raw' | 'svg' | 'datauri' | 'json'

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

stroke_widthinteger

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

stroke_colorstring

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

Response

The SVG file when format=raw, or the JSON envelope when format is datauri or json

successboolean required

Always true on a successful response. Every error carries false and an error object instead.

Example response

{
  "success": true,
  "data": {
    "id": "ak-47",
    "name": "AK-47",
    "slug": "ak-47",
    "format": "datauri",
    "mimeType": "image/svg+xml",
    "dataUri": "data:image/svg+xml;base64,PHN2ZyB4bWxu...",
    "svg": "<svg xmlns=\"http://www.w3.org/2000/svg\" ...>"
  }
}

Changes

No recorded changes to this operation across all 1 revision of this API.