Quickstart
Paste this tag into a page to show a CS2 item. The image works in every browser.
<img src="https://inspekt.gg/api/still?id=ak47_cu_ak47_cobra_gen&wear=0.1662&seed=55&view=front&w=640&h=400&key=cs2pk_your_key_here"
referrerpolicy="strict-origin">
To name the item with an inspect link, replace
id=…&wear=…&seed=… with
inspect=<the link>. Render API lists every
parameter, the cache rules and the placeholder.
Keep referrerpolicy="strict-origin" on every <img> and on every
<iframe> you write yourself; CS2Embed.mount() sets it on the frames
it builds. It makes the browser send your origin even when the page's own
Referrer-Policy withholds the referrer. A keyed request without an
Origin or Referer header is refused with
origin_required.
The Download for AI agents button above downloads one Markdown file for a coding agent, with every endpoint, bound, refusal code and worked example in these docs.
Render API or embed
| Render API | Embed | |
|---|---|---|
| Output | One webp image of the item | The live 3D viewer, in an iframe |
| Integration | One <img> tag | A script tag and an element |
| Needs WebGPU | No | Yes, in the visitor's browser |
| Time to ship | An afternoon | A day or two |
| Counts as | One render | One embed load |
Start with stills, then add the embed to the pages that need 3D. The listing grid demo works this way and shows the code for each card.
Embed in four steps
Every snippet below needs its key line. From your site or your server, a request
without a key is refused with 401 and key_required
(Error codes).
Get a key before you start. Sign in with an email address to get one.
The key works once the account starts a 10-day free trial or picks a plan. While you are
signed in, this page replaces every cs2pk_your_key_here with your key, so Copy
gives you a working snippet. A new key has no allowed origins. Register the
origin your page runs on, or the frame shows an origin_not_allowed card.
-
Copy an inspect link
Use a link that carries the item as hex after
csgo_econ_action_preview. Two kinds do: a link copied from an item inside CS2, and a "gen" link like this one:inspect linksteam://rungame/730/76561202255233023/+csgo_econ_action_preview 001807209A0228043004388F85D7F30340950512E67D72Send the whole link, URL-encoded or not, or the hex alone.
A link from a Steam Community Market listing or a Steam inventory page ends in
M…A…D…orS…A…D…. It points at an item stored on Steam's servers, which only a signed-in CS2 session can read. The Render API refuses it with a400, and the embed shows itsbad-inspectcard.To name an item by its catalog id instead, pass
swithwearandseed(see Embed parameters). Catalog ids lists every id. -
Add the loader script, once per page
html<script src="https://inspekt.gg/cs2embed.js"></script>The loader is a few kilobytes and needs no dependencies or build step. It adds one global,
CS2Embed. -
Mount the viewer on an element with a size
html<div id="viewer" style="width:640px;height:400px"></div> <script src="https://inspekt.gg/cs2embed.js"></script> <script> var viewer = CS2Embed.mount(document.getElementById('viewer'), { inspect: 'steam://rungame/730/76561202255233023/+csgo_econ_action_preview 001807209A0228043004388F85D7F30340950512E67D72', key: 'cs2pk_your_key_here', autorotate: true, }); viewer.on('loaded', function (e) { console.log('rendered', e.id, 'in', e.ms, 'ms'); }); </script>mount()returns a handle withsetView,setScene,screenshot, andonfor theloaded,errorandstateevents. postMessage API lists every method and event, and Embed parameters lists every option. -
Reload and check
The frame shows a still of your item within a second, then switches to the live 3D view once the textures load. Rotating and zooming then run in the visitor's browser.
Before you ship
- The first request for a new still waits while it renders. A render takes
about a second, and longer while the render queue is long. Pre-warm the URL from your server
so no visitor waits, or send
wait=0to show a placeholder at once; see Caching and the placeholder. origin_not_allowedmeans the page's origin is not registered. Add it under Allowed origins in the dashboard. Scheme and port both count, sohttps://shop.exampleandhttp://localhost:3000are two entries.key_requiredmeans thekeyoption is missing or empty. Error codes lists every code.- Log refusals in code. A refused frame shows a card with the reason and fires
an
errorpostMessage event with the same code.