Firearms

Get image asset

Returns the image bytes for one gallery entry. Defaults to the full-size WebP (variant=display) with an immutable cache header; format=datauri returns a base64 data URI that drops straight into an <img src> with no second request. Images we link rather than host (external sources, asset-CDN paths) answer with a 302 to their location. Listing images and their credits is explorer-tier via /v1/firearms/{id}/images; the bytes are builder-tier, like the silhouette.

Requires Builder tier or higher.

get/v1/firearms/{id}/images/{imageId}

Request

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

Path parameters

idstring required

Resource slug ID

imageIdstring required

Image row id from /v1/firearms/{id}/images

Query parameters

format'raw' | 'datauri'

raw file, or a base64 data URI

variant'original' | 'display' | 'thumb'

WebP by default: display is full size with transparency, thumb a small preview, original the uploaded file (usually PNG). A missing derivative falls back to the original

Response

The image bytes when format=raw (the default), or the JSON envelope when format=datauri

successboolean required

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

Example response

{
  "success": true,
  "data": {
    "id": "glock-g17-gen5",
    "imageId": 6563,
    "variant": "thumb",
    "format": "datauri",
    "mimeType": "image/webp",
    "dataUri": "data:image/webp;base64,UklGRi..."
  }
}

Changes

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