Firearms

Index every firearm that has imagery

Returns each firearm with a render or photograph, and that imagery, as a three-field row. Built for media grids and mirroring jobs: paging the full catalogue with has_image=true returns fifteen fields per row, twelve of which such a caller discards. Silhouettes are excluded; every firearm has one. per_page allows up to 1000 here for the same reason.

Every response carries meta.fingerprint, which changes when imagery is added or removed. A client holding a cached copy of this collection can request a single row and compare it, rather than downloading the collection to discover whether it changed.

Available on every plan. Requires an API key; Explorer keys receive a reduced field set.

get/v1/firearms/media

Request

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

Query parameters

pageinteger

Page number

per_pageinteger

Firearms per page

kind'silhouette' | 'render' | 'photo' | 'schematic' | 'model'

Restrict the images on each row to one kind

idsstring

Only these firearms, as a comma-separated list of ids (at most 24). A firearm with no imagery is left out of the answer.

Headers

If-None-Matchstring

The ETag from a previous response. If the body would be byte-identical, the API answers 304 Not Modified with no body. A 304 counts toward the per-minute rate limit but not the daily request allowance.

Response

Index every firearm that has imagery

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",
      "images": [
        {
          "id": 2572,
          "url": "https://api.gunspec.io/v1/firearms/ak-47/images/2572",
          "alt": "AK-47 right profile",
          "width": 1536,
          "height": 1024
        }
      ]
    }
  ],
  "pagination": {
    "page": 1,
    "per_page": 20,
    "limit": 20,
    "total": 42,
    "totalPages": 3
  }
}

Changes

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