{"openapi":"3.1.0","info":{"title":"Shotfly API","version":"1.0.0"},"servers":[{"url":"https://api.shotfly.dev"}],"components":{"securitySchemes":{"accessKey":{"type":"apiKey","in":"query","name":"access_key"},"bearer":{"type":"http","scheme":"bearer"}}},"security":[{"accessKey":[]},{"bearer":[]}],"paths":{"/v1/screenshot":{"get":{"summary":"Take a screenshot","parameters":[{"name":"url","in":"query","required":false,"description":"Page to capture. http(s) only; a missing scheme defaults to https.","schema":{},"example":"https://example.com","x-group":"source"},{"name":"html","in":"query","required":false,"description":"Raw HTML to render instead of a URL (POST only, up to 2 MB).","schema":{"type":"string","maxLength":2097152},"x-group":"source"},{"name":"format","in":"query","required":false,"description":"png (default), jpeg, webp or pdf. A webp image is at most 16383 pixels on each side; taller captures are cut at the bottom.","schema":{"default":"png","type":"string","enum":["png","jpeg","jpg","webp","pdf"]},"example":"webp","x-group":"output"},{"name":"quality","in":"query","required":false,"description":"Quality 1–100 for jpeg and webp. Default 80.","schema":{"type":"integer","minimum":1,"maximum":100},"x-group":"output"},{"name":"device","in":"query","required":false,"description":"Device preset: desktop, desktop_hd, iphone_15, pixel_8, ipad.","schema":{"type":"string","enum":["desktop","desktop_hd","iphone_15","pixel_8","ipad"]},"example":"iphone_15","x-group":"viewport"},{"name":"viewport_width","in":"query","required":false,"description":"Viewport width in CSS pixels (100–3840). Default 1280.","schema":{"type":"integer","minimum":100,"maximum":3840},"x-group":"viewport"},{"name":"viewport_height","in":"query","required":false,"description":"Viewport height in CSS pixels (100–2160). Default 800.","schema":{"type":"integer","minimum":100,"maximum":2160},"x-group":"viewport"},{"name":"device_scale_factor","in":"query","required":false,"description":"Pixel density 1–3. Default 1 (device presets set their own).","schema":{"type":"number","minimum":1,"maximum":3},"x-group":"viewport"},{"name":"full_page","in":"query","required":false,"description":"Capture the whole scrollable page. Lazy content is scrolled into view first.","schema":{"default":false,"type":"boolean"},"x-group":"output"},{"name":"full_page_max_height","in":"query","required":false,"description":"Height cap in CSS pixels for full_page (default 10000, max 20000). For webp it is lowered to 16383 ÷ device_scale_factor, rounded down (5461 for iphone_15).","schema":{"type":"integer","minimum":100,"maximum":20000},"x-group":"output"},{"name":"selector","in":"query","required":false,"description":"Capture only the first element matching this CSS selector.","schema":{"type":"string","minLength":1,"maxLength":500},"x-group":"output"},{"name":"clip_x","in":"query","required":false,"description":"Clip rectangle left edge in CSS pixels (all four clip_* are required together).","schema":{"type":"number"},"x-group":"output"},{"name":"clip_y","in":"query","required":false,"description":"Clip rectangle top edge in CSS pixels.","schema":{"type":"number"},"x-group":"output"},{"name":"clip_width","in":"query","required":false,"description":"Clip rectangle width in CSS pixels.","schema":{"type":"number"},"x-group":"output"},{"name":"clip_height","in":"query","required":false,"description":"Clip rectangle height in CSS pixels.","schema":{"type":"number"},"x-group":"output"},{"name":"thumbnail_width","in":"query","required":false,"description":"Resize the result to this width, keeping the aspect ratio.","schema":{"type":"integer","minimum":16,"maximum":3840},"x-group":"output"},{"name":"wait_until","in":"query","required":false,"description":"load (default), domcontentloaded or networkidle.","schema":{"default":"load","type":"string","enum":["load","domcontentloaded","networkidle"]},"x-group":"wait"},{"name":"wait_for_selector","in":"query","required":false,"description":"Wait until this CSS selector is visible before capturing.","schema":{"type":"string","minLength":1,"maxLength":500},"x-group":"wait"},{"name":"delay","in":"query","required":false,"description":"Extra wait in milliseconds before capturing (max 10000).","schema":{"type":"integer","minimum":0,"maximum":10000},"x-group":"wait"},{"name":"timeout","in":"query","required":false,"description":"Total time budget in seconds (5–60). Default 30.","schema":{"type":"integer","minimum":5,"maximum":60},"x-group":"wait"},{"name":"block_ads","in":"query","required":false,"description":"Block ads and trackers. Default true.","schema":{"default":true,"type":"boolean"},"x-group":"blocking"},{"name":"block_cookie_banners","in":"query","required":false,"description":"Reject or hide cookie consent banners. Default true. Never clicks \"accept\".","schema":{"default":true,"type":"boolean"},"x-group":"blocking"},{"name":"hide_selectors","in":"query","required":false,"description":"Comma-separated CSS selectors to hide before capturing.","schema":{"maxItems":50,"type":"array","items":{"type":"string","minLength":1,"maxLength":500}},"x-group":"blocking"},{"name":"css","in":"query","required":false,"description":"CSS injected into the page.","schema":{"type":"string","maxLength":100000},"x-group":"customize"},{"name":"js","in":"query","required":false,"description":"JavaScript evaluated in the page after load.","schema":{"type":"string","maxLength":100000},"x-group":"customize"},{"name":"user_agent","in":"query","required":false,"description":"Override the User-Agent header.","schema":{"type":"string","minLength":1,"maxLength":1000},"x-group":"request"},{"name":"headers","in":"query","required":false,"description":"Extra request headers as a JSON object.","schema":{"type":"object","propertyNames":{"type":"string","maxLength":256},"additionalProperties":{"type":"string","maxLength":4096}},"x-group":"request"},{"name":"cookies","in":"query","required":false,"description":"Cookies as a JSON array of {name, value, domain?, path?}.","schema":{"maxItems":50,"type":"array","items":{"type":"object","properties":{"name":{"type":"string","minLength":1,"maxLength":256},"value":{"type":"string","maxLength":4096},"domain":{"type":"string","maxLength":256},"path":{"type":"string","maxLength":1024}},"required":["name","value"],"additionalProperties":false}},"x-group":"request"},{"name":"dark_mode","in":"query","required":false,"description":"Emulate prefers-color-scheme: dark.","schema":{"default":false,"type":"boolean"},"x-group":"viewport"},{"name":"geo","in":"query","required":false,"description":"Exit country (ISO 3166-1 alpha-2). Adds 2 credits.","schema":{},"example":"DE","x-group":"routing"},{"name":"stealth","in":"query","required":false,"description":"Start with the stealth tiers, and allow the premium anti-bot tier.","schema":{"default":false,"type":"boolean"},"x-group":"routing"},{"name":"escalation","in":"query","required":false,"description":"none (default) or auto: allow the premium anti-bot tier when cheaper tiers hit a challenge.","schema":{"default":"none","type":"string","enum":["none","auto"]},"x-group":"routing"},{"name":"max_credits","in":"query","required":false,"description":"Never spend more than this many credits on the request.","schema":{"type":"integer","minimum":1,"maximum":100},"x-group":"routing"},{"name":"cache_ttl","in":"query","required":false,"description":"Seconds a result may be served from cache (0 disables). Default 86400; at most 2592000 (30 days), and never longer than our current storage retention for cached screenshots.","schema":{"type":"integer","minimum":0,"maximum":2592000},"x-group":"delivery"},{"name":"fresh","in":"query","required":false,"description":"Ignore any cached result and render again.","schema":{"default":false,"type":"boolean"},"x-group":"delivery"},{"name":"response_type","in":"query","required":false,"description":"image (default) returns the file; json returns metadata and a temporary link.","schema":{"default":"image","type":"string","enum":["image","json"]},"x-group":"delivery"},{"name":"webhook_url","in":"query","required":false,"description":"Async jobs only (POST /v1/jobs): URL that receives the signed result.","schema":{},"x-group":"delivery"},{"name":"markdown","in":"query","required":false,"description":"Also return the page content as Markdown (JSON responses and async jobs only).","schema":{"default":false,"type":"boolean"},"x-group":"delivery"}],"responses":{"200":{"description":"The rendered file (response_type=image) or JSON with a temporary link (response_type=json).","headers":{"X-Request-Id":{"schema":{"type":"string"}},"X-Cache":{"schema":{"type":"string","enum":["HIT","MISS"]}},"X-Credits-Charged":{"schema":{"type":"integer"}},"X-Render-Outcome":{"schema":{"type":"string"}}},"content":{"image/png":{},"image/jpeg":{},"image/webp":{},"application/pdf":{},"application/json":{}}},"default":{"description":"Error","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","required":["code","message","docs_url"],"properties":{"code":{"type":"string","enum":["invalid_params","url_not_allowed","unauthorized","quota_exceeded","credits_limit","forbidden","signature_invalid","signature_expired","domain_blocked","account_suspended","not_found","target_blocked","blank_page","target_http_error","cookie_wall","rate_limited","concurrency_limited","internal_error","render_failed","service_unavailable","render_timeout"]},"message":{"type":"string"},"request_id":{"type":"string"},"docs_url":{"type":"string"},"retry_hint":{"type":"string"}}}}}}}}}},"post":{"summary":"Take a screenshot (JSON body)","requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"url":{},"html":{"type":"string","maxLength":2097152},"format":{"default":"png","type":"string","enum":["png","jpeg","jpg","webp","pdf"]},"quality":{"type":"integer","minimum":1,"maximum":100},"device":{"type":"string","enum":["desktop","desktop_hd","iphone_15","pixel_8","ipad"]},"viewport_width":{"type":"integer","minimum":100,"maximum":3840},"viewport_height":{"type":"integer","minimum":100,"maximum":2160},"device_scale_factor":{"type":"number","minimum":1,"maximum":3},"full_page":{"default":false,"type":"boolean"},"full_page_max_height":{"type":"integer","minimum":100,"maximum":20000},"selector":{"type":"string","minLength":1,"maxLength":500},"clip_x":{"type":"number"},"clip_y":{"type":"number"},"clip_width":{"type":"number"},"clip_height":{"type":"number"},"thumbnail_width":{"type":"integer","minimum":16,"maximum":3840},"wait_until":{"default":"load","type":"string","enum":["load","domcontentloaded","networkidle"]},"wait_for_selector":{"type":"string","minLength":1,"maxLength":500},"delay":{"type":"integer","minimum":0,"maximum":10000},"timeout":{"type":"integer","minimum":5,"maximum":60},"block_ads":{"default":true,"type":"boolean"},"block_cookie_banners":{"default":true,"type":"boolean"},"hide_selectors":{"maxItems":50,"type":"array","items":{"type":"string","minLength":1,"maxLength":500}},"css":{"type":"string","maxLength":100000},"js":{"type":"string","maxLength":100000},"user_agent":{"type":"string","minLength":1,"maxLength":1000},"headers":{"type":"object","propertyNames":{"type":"string","maxLength":256},"additionalProperties":{"type":"string","maxLength":4096}},"cookies":{"maxItems":50,"type":"array","items":{"type":"object","properties":{"name":{"type":"string","minLength":1,"maxLength":256},"value":{"type":"string","maxLength":4096},"domain":{"type":"string","maxLength":256},"path":{"type":"string","maxLength":1024}},"required":["name","value"],"additionalProperties":false}},"dark_mode":{"default":false,"type":"boolean"},"geo":{},"stealth":{"default":false,"type":"boolean"},"escalation":{"default":"none","type":"string","enum":["none","auto"]},"max_credits":{"type":"integer","minimum":1,"maximum":100},"cache_ttl":{"type":"integer","minimum":0,"maximum":2592000},"fresh":{"default":false,"type":"boolean"},"response_type":{"default":"image","type":"string","enum":["image","json"]},"webhook_url":{},"markdown":{"default":false,"type":"boolean"}}}}}},"responses":{"200":{"description":"The rendered file (response_type=image) or JSON with a temporary link (response_type=json).","headers":{"X-Request-Id":{"schema":{"type":"string"}},"X-Cache":{"schema":{"type":"string","enum":["HIT","MISS"]}},"X-Credits-Charged":{"schema":{"type":"integer"}},"X-Render-Outcome":{"schema":{"type":"string"}}},"content":{"image/png":{},"image/jpeg":{},"image/webp":{},"application/pdf":{},"application/json":{}}},"default":{"description":"Error","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","required":["code","message","docs_url"],"properties":{"code":{"type":"string","enum":["invalid_params","url_not_allowed","unauthorized","quota_exceeded","credits_limit","forbidden","signature_invalid","signature_expired","domain_blocked","account_suspended","not_found","target_blocked","blank_page","target_http_error","cookie_wall","rate_limited","concurrency_limited","internal_error","render_failed","service_unavailable","render_timeout"]},"message":{"type":"string"},"request_id":{"type":"string"},"docs_url":{"type":"string"},"retry_hint":{"type":"string"}}}}}}}}}}},"/v1/monitors":{"post":{"summary":"Create a monitor (runs with the calling key)","requestBody":{"content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"name":{"type":"string","minLength":1,"maxLength":120},"params":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}},"interval_minutes":{"type":"integer","minimum":5,"maximum":10080},"diff_threshold":{"default":0.01,"type":"number","exclusiveMinimum":0,"maximum":1},"notify":{"default":{},"type":"object","properties":{"webhook_url":{"type":"string","format":"uri"},"slack_webhook_url":{"type":"string","format":"uri"},"email":{"type":"boolean"}},"additionalProperties":false},"archive":{"default":false,"type":"boolean"},"storage_integration_id":{"type":"string"}},"required":["name","params","interval_minutes"],"additionalProperties":false}}}},"responses":{"201":{"description":"The monitor"}}},"get":{"summary":"List monitors","responses":{"200":{"description":"Monitors"}}}},"/v1/monitors/{id}":{"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"get":{"summary":"A monitor with its last 50 runs","responses":{"200":{"description":"The monitor"}}},"patch":{"summary":"Update or pause a monitor","requestBody":{"content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"name":{"type":"string","minLength":1,"maxLength":120},"enabled":{"type":"boolean"},"interval_minutes":{"type":"integer","minimum":5,"maximum":10080},"diff_threshold":{"type":"number","exclusiveMinimum":0,"maximum":1},"notify":{"default":{},"type":"object","properties":{"webhook_url":{"type":"string","format":"uri"},"slack_webhook_url":{"type":"string","format":"uri"},"email":{"type":"boolean"}},"additionalProperties":false},"archive":{"type":"boolean"}},"additionalProperties":false}}}},"responses":{"200":{"description":"The monitor"}}},"delete":{"summary":"Delete a monitor","responses":{"204":{"description":"Deleted"}}}},"/v1/storage-integrations":{"post":{"summary":"Register a bucket for monitor archives (optional S3 Object Lock)","requestBody":{"content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"bucket":{"type":"string","minLength":3,"maxLength":63},"region":{"default":"us-east-1","type":"string","minLength":1,"maxLength":40},"endpoint":{"type":"string","format":"uri"},"access_key_id":{"type":"string","minLength":1,"maxLength":128},"secret_access_key":{"type":"string","minLength":1,"maxLength":256},"path_prefix":{"default":"","type":"string","maxLength":200,"pattern":"^([A-Za-z0-9._-]+\\/)*$"},"object_lock":{"type":"object","properties":{"mode":{"type":"string","enum":["GOVERNANCE","COMPLIANCE"]},"days":{"type":"integer","minimum":1,"maximum":36500}},"required":["mode","days"],"additionalProperties":false}},"required":["bucket","access_key_id","secret_access_key"],"additionalProperties":false}}}},"responses":{"201":{"description":"The integration; the secret is never returned"}}},"get":{"summary":"List storage integrations","responses":{"200":{"description":"Integrations"}}}},"/v1/storage-integrations/{id}":{"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"delete":{"summary":"Delete an integration no monitor uses","responses":{"204":{"description":"Deleted"}}}}}}