skills/sirv-api/SKILL.md
Sirv REST API integration for image and file management. Use when working with Sirv CDN, uploading/downloading files to Sirv, managing image metadata, searching files, creating 360 spins, converting videos, or any Sirv API operations. Covers authentication, file operations, metadata, search queries, async jobs, and account management.
npx skillsauth add igorvaryvoda/image-optimization-skill sirv-apiInstall this skill globally with one command. Works with Claude Code, Cursor, and Windsurf.
3 of 9 scanners reported clean
Some scanners were skipped, did not run, or reported a non-clean status. Review each row below.
Base URL: https://api.sirv.com
Check current Sirv docs before changing endpoint fields, path escaping, metadata field names, or pagination behavior:
https://apidocs.sirv.com/https://sirv.com/help/articles/search-files-with-the-api/https://sirv.com/help/articles/add-meta-with-the-api/https://sirv.com/help/articles/sirv-api/All requests require a Bearer token from /v2/token:
curl -X POST https://api.sirv.com/v2/token \
-H "Content-Type: application/json" \
-d '{"clientId": "YOUR_CLIENT_ID", "clientSecret": "YOUR_CLIENT_SECRET"}'
Response:
{"token": "eyJhbG...", "expiresIn": 1200, "scope": ["account:read", ...]}
Use token in subsequent requests:
curl https://api.sirv.com/v2/account \
-H "Authorization: Bearer eyJhbG..."
Tokens expire in 20 minutes. Request a new one before expiry.
/ as %2F./v2/account/limits before bulk search/upload/delete jobs./v2/files/fetch to import remote originals directly into Sirv when source URLs are stable.from for normal pagination and scrolling search for more than 1000 results.{ } / \ ! space.| Operation | Method | Endpoint | Key Params |
|-----------|--------|----------|------------|
| Upload | POST | /v2/files/upload | ?filename=/path/file.jpg + binary body |
| Download | GET | /v2/files/download | ?filename=/path/file.jpg |
| Delete | POST | /v2/files/delete | ?filename=/path/file.jpg |
| Copy | POST | /v2/files/copy | ?from=/a.jpg&to=/b.jpg |
| Rename/Move | POST | /v2/files/rename | ?from=/a.jpg&to=/b.jpg |
| Create folder | POST | /v2/files/mkdir | ?dirname=/new-folder |
| List directory | GET | /v2/files/readdir | ?dirname=/folder |
| Operation | Method | Endpoint |
|-----------|--------|----------|
| Get all meta | GET | /v2/files/meta?filename=/path |
| Set meta | POST | /v2/files/meta?filename=/path |
| Get/Set title | GET/POST | /v2/files/meta/title?filename=/path |
| Get/Set description | GET/POST | /v2/files/meta/description?filename=/path |
| Get/Add/Delete tags | GET/POST/DELETE | /v2/files/meta/tags?filename=/path |
| Get/Set product | GET/POST | /v2/files/meta/product?filename=/path |
| Operation | Start | Poll |
|-----------|-------|------|
| Spin to video | POST /v2/files/spin2video | Returns filename directly |
| Video to spin | POST /v2/files/video2spin | Returns filename directly |
| Create ZIP | POST /v2/files/zip | GET /v2/files/zip?id= |
| Batch delete | POST /v2/files/batch/delete | GET /v2/files/batch/delete?id= |
| 3D to GLB | POST /v2/files/3d/model2GLB | GET /v2/files/3d/model2GLB?id= |
const token = await getToken();
await fetch('https://api.sirv.com/v2/files/upload?filename=/images/photo.jpg', {
method: 'POST',
headers: {
'Authorization': `Bearer ${token}`,
'Content-Type': 'image/jpeg'
},
body: imageBuffer
});
await fetch('https://api.sirv.com/v2/files/search', {
method: 'POST',
headers: {
'Authorization': `Bearer ${token}`,
'Content-Type': 'application/json'
},
body: JSON.stringify({
query: 'extension:.jpg AND mtime:[now-7d TO now]',
size: 50
})
});
await fetch('https://api.sirv.com/v2/files/search', {
method: 'POST',
headers: {
'Authorization': `Bearer ${token}`,
'Content-Type': 'application/json'
},
body: JSON.stringify({
query: 'dirname.paths:\\/products AND extension:.jpg',
size: 100
})
});
// Start job
const { id } = await fetch('https://api.sirv.com/v2/files/zip', {
method: 'POST',
headers: { 'Authorization': `Bearer ${token}`, 'Content-Type': 'application/json' },
body: JSON.stringify({
filenames: ['/images/photo1.jpg', '/images/photo2.jpg'],
zipFilename: '/downloads/photos.zip'
})
}).then(r => r.json());
// Poll until complete
let progress = 0;
while (progress < 100) {
const status = await fetch(`https://api.sirv.com/v2/files/zip?id=${id}`, {
headers: { 'Authorization': `Bearer ${token}` }
}).then(r => r.json());
progress = status.progress;
await new Promise(r => setTimeout(r, 1000));
}
stat, meta, readdir, or search.development
Sirv Media Viewer guidance. Use when building, auditing, or debugging Sirv product galleries, zoom viewers, 360 spins, videos, YouTube/Vimeo embeds, 3D models, PDF galleries, smart .view galleries, thumbnails, fullscreen/mobile behavior, SMV class="Sirv" markup, data-src/data-options/data-breakpoints, Sirv JS loading, viewer API/events, CSP, accessibility, or Core Web Vitals for Sirv interactive media.
development
Sirv dynamic imaging URL API for on-the-fly image transformation. Use when building image URLs with Sirv CDN, resizing images via URL parameters, adding watermarks/text overlays, cropping, applying filters, format conversion (WebP, AVIF), or any Sirv URL-based image manipulation. Covers 100+ URL parameters for scaling, cropping, effects, text, watermarks, frames, and optimization.
tools
Guide for using Sirv AI Studio (www.sirv.studio), an AI-powered image and video processing platform. Use when working with product images, background removal, image upscaling, AI generation, video creation, batch processing, or e-commerce image workflows. Triggers on mentions of Sirv AI Studio, product photography, background removal, image upscaling, AI image generation, batch image processing, or marketplace optimization. IMPORTANT - If sirv-ai MCP tools are available (sirv_remove_background, sirv_upscale, sirv_generate, etc.), USE THEM directly for image processing tasks instead of telling user to visit the website.
development
Expert guidance on image optimization for web performance. Use when auditing or improving image delivery, Core Web Vitals, LCP/CLS/INP, responsive images, srcset/sizes, lazy loading, preloading, CDN delivery, Sirv/Cloudinary/imgix/Vercel/Cloudflare image pipelines, format conversion, compression, alt text, product media, Sirv Media Viewer galleries/zoom/spins/videos, or image-heavy frontend code. Covers AVIF, WebP, JPEG, PNG, GIF, SVG, HEIC, JPEG XL, HDR/wide gamut, quality settings, placeholders, image audits, Sirv dynamic imaging/API/viewer workflows, and implementation verification.