{"uid":"cap_r9dmwXCfquh4j8IjIHgrM","slug":"screenshot-api-css-element-capture-0883263c","name":"Screenshot API – CSS Element Capture","description":"Capture a PNG screenshot of a single CSS-selected element on an http(s) URL; returns a JSON envelope with the PNG base64-encoded under image_base64, plus selector, final_url, title, viewport, and size.","url":"https://screenshot-api-production-fe7e.up.railway.app/capture/element","method":"POST","headers":{},"bodySchema":{"type":"object","properties":{"url":{"type":"string","description":"The http(s) URL to capture, e.g. 'https://example.com'. Internal/loopback hosts are rejected."},"width":{"type":"integer","description":"Viewport width in pixels (320-3840). Defaults to 1280."},"height":{"type":"integer","description":"Viewport height in pixels (240-3840). Defaults to 800."},"selector":{"type":"string","description":"CSS selector of the single element to capture, e.g. '#main' or '.hero'."},"wait_until":{"type":"string","description":"Playwright load state to wait for before capture: 'load', 'domcontentloaded', 'networkidle', or 'commit'. Defaults to 'networkidle'."}}},"responseSchema":null,"example":null,"exampleRequest":null,"tags":["x402"],"displayCostAmount":"0.002","displayCostAsset":"USDC","priceDynamic":false,"priceHint":null,"priceStatus":"priced","priceSource":"probe","requiresHandshake":false,"reviewCount":0,"rating":{"score":"0.00","successRate":"0.00","reviews":0,"stars":null,"state":"unrated"},"availabilityStatus":"unknown","priceObserved":null,"sessionDeposit":null,"pricing":{"kind":"static","summary":"$0.002/call","primary":{"kind":"static","protocol":"x402","network":"base","amountUsd":"0.002","per":"call","confidence":"exact"},"accepted":[{"kind":"static","protocol":"x402","network":"base","amountUsd":"0.002","per":"call","confidence":"exact"}]},"paymentMethods":[{"uid":"pm_ET6-Dmt1hBLPOCNvFss9H","protocol":"x402","methodType":"crypto","chain":"base","mode":"charge","costAmount":"0.002","costPer":"request","priority":0,"asset":"0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913","unit":"request","depositMicros":null,"planRef":null}],"brandName":null,"brandSlug":null,"brandBaseUrl":null,"brandDocsUrl":null,"whatItDoes":"Captures a PNG screenshot of a single CSS-selected DOM element on any public URL, returning the image base64-encoded in a JSON envelope along with metadata.","exampleAgentPrompt":"Grab a screenshot of just the `.hero` section on https://stripe.com at 1280×800 viewport, waiting for the network to go idle before you capture it.","exampleUseCases":[{"title":"Visual regression for a UI component","prompt":"Can you screenshot the `#checkout-form` element on https://shop.acme.com/cart at 1280×800 so I can compare how it looks today versus last week?"},{"title":"Capture a live chart for a report","prompt":"Take a screenshot of the `.chart-container` element on https://dashboard.example.com/analytics — use a 1440×900 viewport and wait for networkidle so all the data loads before you grab it."},{"title":"Thumbnail of a landing page hero","prompt":"I need a PNG of just the `.hero-banner` section on https://myproduct.io, captured at a 1280×800 viewport — can you get that for me?"}],"resultDescription":"A JSON envelope containing: `image_base64` (PNG of the matched element, base64-encoded), `selector` (the CSS selector used), `final_url` (URL after any redirects), `title` (page title), `viewport` (width and height used), and `size` (pixel dimensions of the captured element image).","failureModes":["CSS selector not found on page — element does not exist or page did not load fully before capture","Internal or loopback host rejected — URL must be a public http(s) address","Invalid viewport dimensions — width or height outside 320–3840 range","Page load timeout — site takes too long to reach the requested load state","Invalid `wait_until` value — must be one of load, domcontentloaded, networkidle, or commit","Payment failure — x402 payment not processed, call not executed","Network error reaching the target URL — site down or blocked"],"whenToPreferThis":"Choose this endpoint when you need to capture only a specific DOM element rather than the full page or viewport — for example, isolating a chart, hero banner, product card, or form without surrounding page chrome. It is superior to full-page or viewport screenshot endpoints when the target component is small, partially off-screen, or surrounded by irrelevant content. Prefer it over PDF rendering when you need a raster image of a UI element rather than a printable document.","instructions":null,"reviewSummary":null,"reviewSummaryHighlights":null,"reviewSummaryConcerns":null,"reviewSummaryGeneratedAt":null,"activationCount":0,"lastUsedAt":null,"lastSuccessfullyRanAt":null,"lastHealthCheckAt":"2026-09-14T00:32:15.135Z","isFirstParty":false}