Inject your own CSS into a page you do not control
The page belongs to someone else. The stylesheet you add to it, for the length of one capture, belongs to you.
styleshide_selectorsreduced_motionmedia_typecurl --fail-with-body "https://api.pagecapture.dev/v1/take" \
-H "X-Access-Key: $PAGECAPTURE_KEY" \
-H "Content-Type: application/json" \
--data '{"url":"https://example.com","format":"jpg","styles":"* { animation: none !important; transition: none !important; }"}' \
-o capture.jpgVerified 2026-08-13 by running the published code against a fixture.
Configure it in the playgroundWhat it does
- Injects each stylesheet into the page context, in the order given, immediately after the navigation and waits — before hiding, before your scripts, before any click.
- Accepts up to 128 KiB of CSS across all entries, checked at validation so an oversized payload fails before a browser is opened.
- Is part of the cache key, so two different stylesheets never share a cached result.
What it does not do
- Does not run JavaScript. A style tag cannot expand a section that only opens on click — that is `click` or `scripts`.
- Does not fail the capture when the injection is refused. A page with a restrictive Content Security Policy can reject the tag, and the capture continues without it unless you set `bypass_csp`.
- Does not persist. The stylesheet exists for the length of one capture and is gone with the browser context.
Every limit on this page is the one the API enforces
These rows are read from the same parameter table that validates your request. Nothing here is transcribed, so a number cannot drift from the behaviour it describes.
| Parameter | Type | Default | Range | Endpoints | Cache key |
|---|---|---|---|---|---|
stylesCSS injected into the page. | string[] | — | — | /v1/take, /v1/animate | In |
hide_selectorsSelectors to hide before capturing. | string[] | — | — | /v1/take, /v1/animate | In |
reduced_motionEmulate `prefers-reduced-motion: reduce`. | boolean | false | — | /v1/take, /v1/animate | In |
media_typeCSS media type to emulate. | enum | screen | — | /v1/take, /v1/animate | In |
How it behaves next to the rest of the request
bypass_cspBypass the page Content Security Policy. Opt-in and recorded.
A page whose CSP forbids inline styles will drop the injected tag. `bypass_csp` disables that enforcement for the capture — it is opt-in and recorded, because it changes the security posture of the render.
hide_selectorsSelectors to hide before capturing.
Hiding is the same mechanism with a fixed rule: `visibility: hidden !important` on the selectors you name. Use it for removal and `styles` for anything else.
reduced_motionEmulate `prefers-reduced-motion: reduce`.
For animations, emulating `prefers-reduced-motion: reduce` is usually cleaner than overriding every transition by hand — the page's own reduced-motion styles do the work.
Errors this option can produce
None of them is billable. No error code in the catalog is.
Related capabilities
All capabilities100 successful captures a month, every feature unlocked, no card.
Get an API keyPageCapture Engineering · reviewed by PageCapture API maintainers · Verified 2026-08-13 by running the published code against a fixture.