Record a video or an animated GIF of a website, HTML, or Markdown
Changed onRecord a short video or an animated GIF of a website by its URL, or of the rendered HTML or Markdown, optionally scrolling the page.
Request
- Base URLhttps://api.screenshotone.com
- Auth
- API key in query parameter access_key
- or API key in header X-Access-Key
- TypeScriptA function with typed inputs. Its response is checked against the schema.
Query parameters
The URL of the site to render. One of url, html or markdown is required.
The HTML to render. One of url, html or markdown is required.
The Markdown to render. One of url, html or markdown is required.
The signature of a signed request: a hash of all the request options made with the signing key. It is not the signing key itself.
What to return: by_format returns the result in the requested format, empty returns only the status or the error, and json returns a JSON object, which has data only for the options that produce it, like caching, storage or metadata.
The name of the file to download the result as. The extension is added from the format.
Set to true to request the dark mode of the site and to false to request the light one, if the site supports them. Not set by default.
Emulates the prefers-reduced-motion: reduce preference. The site decides how to respond to it.
Actively reduces motion on the page before capturing it: animations, carousels and background videos.
The media type to emulate: print renders the page as for printers, screen as for screens.
JavaScript to inject into the page and execute before capturing.
The events to wait for after the injected scripts were executed. Use it when a script navigates to another page.
CSS to inject into the page.
Selectors of the elements to hide before capturing. All elements matching each selector are hidden with display: none.
A selector of the element to hover over before capturing.
Whether to return an error when the element to hover over is not found.
A selector of the element to click before capturing.
Whether to return an error when the element to click is not found.
Includes the open and closed shadow DOM roots when the content of the page is extracted, for format=html or metadata_content=true.
Bypasses the Content Security Policy of the site. It may be needed for injected scripts to work.
A device to emulate instead of setting the viewport options one by one. It sets the viewport, the scale factor and the user agent. The list of devices is returned by the /devices method.
The width of the browser viewport in pixels. Overrides the value set by viewport_device.
The height of the browser viewport in pixels. Overrides the value set by viewport_device.
The device scale factor (device pixel ratio), from 1 to 5, fractions are allowed. Overrides the value set by viewport_device.
Whether the meta viewport tag is taken into account. Overrides the value set by viewport_device.
Whether the viewport supports touch events. Overrides the value set by viewport_device.
Whether the viewport is in landscape mode. Overrides the value set by viewport_device.
The latitude of the geolocation to emulate. Latitude and longitude must be set together.
The longitude of the geolocation to emulate. Latitude and longitude must be set together.
The accuracy of the emulated geolocation in meters.
The country to render the site from, through the proxies provided by ScreenshotOne. It can't be used together with proxy.
Blocks cookie banners, GDPR overlays and other privacy notices.
Blocks banners with a different set of techniques and heuristics. Try it when block_cookie_banners doesn't help; it may change how the page looks.
Blocks chat widgets like Intercom, Crisp, Drift, Tawk and others.
Blocks ads.
Blocks trackers, so the rendering is not counted as a visit by analytics.
Blocks the requests of the page that match a URL, a domain or a pattern like *.example.com/*. Up to 100 patterns.
Blocks loading the resources of the page by type.
Caches the result. A cached result is reused for the requests with the same options.
How long a cached result is reused, in seconds: from 14400 (4 hours, the default) to 2592000 (1 month). Requires cache=true.
An alphanumeric key to keep different cached versions of the result for the same options. Requires cache=true.
The user agent of the browser. Changing it may break the stealth mode; it overrides the user agent set by viewport_device.
The value of the Authorization header to send to the site, for pages protected by basic authentication or a token.
Extra HTTP headers to send to the site, each in the format Header-Name:Header-Value.
Cookies to set for the site, each in the format name=value; Domain=example.com; Secure; HttpOnly.
The URL of your own HTTP proxy to render the site through, like http://user:password@host:port. It can't be used together with ip_country_code.
Hostname patterns of the requests to load directly and not through the proxy. Requires proxy.
The time zone of the browser.
The time in seconds to wait before capturing, after the page is loaded. Up to 30, or up to 300 when timeout is greater than 300.
The time in seconds after which the request is aborted. The default is 60 and the maximum is 90; both are 600 for async requests.
The time in seconds after which the request is aborted when the site doesn't respond.
The events to wait for before capturing: load, domcontentloaded, networkidle0 (no network connections for 500 ms) or networkidle2 (no more than two).
A selector of the element to wait for before capturing. The element must appear in the DOM, but may be invisible.
With several selectors in wait_for_selector: at_least_one waits until at least one of them is matched, at_least_by_count waits until as many elements are matched as there are selectors, not necessarily one for each selector.
Fails the request when the content of the page contains any of the given strings, case-insensitive.
Fails the request when the content of the page misses any of the given strings, case-insensitive.
Fails the request when a request of the page matching one of the given patterns fails or returns an error status. Up to 100 patterns.
Renders the page even when the site responds with a status outside of the 200-299 range. Without it, the host_returned_error error is returned.
Asks to render with hardware (GPU) acceleration. It is a hint, available on the top-tier paid plans: rendering without GPU is used when the GPU servers are unavailable.
Fails the request when GPU rendering fails, instead of falling back to rendering without GPU.
Executes the request asynchronously: the API returns an empty response immediately. Usually combined with webhook_url or the storage options. Caching is not available for async requests.
A public HTTPS URL to send the result of the request to.
Whether to sign the body of the webhook request.
Sends the details of a failed request to the webhook, too.
An alphanumeric identifier of your own that is sent back in the x-screenshotone-external-identifier header of the webhook request.
Uploads the result to the configured S3-compatible storage.
The bucket to upload to. Overrides the one configured in the dashboard.
The key of the file in the bucket, without an extension: it is added from the format. Required when store=true.
The endpoint of an S3-compatible storage, like Cloudflare R2. Leave it out for Amazon S3.
The access key ID of the storage. Overrides the one configured in the dashboard.
The secret access key of the storage. Overrides the one configured in the dashboard.
The ACL of the uploaded file: public-read, or not set.
The storage class of the uploaded file.
Returns the location of the uploaded file: in the X-ScreenshotOne-Store-Location header, or in the JSON response.
Returns the fonts the page uses.
Returns the content of the page in addition to the result: a temporary URL of the stored content and when it expires, in the X-ScreenshotOne-Content-URL and X-ScreenshotOne-Content-Expires headers, or in the JSON response.
The format of the content returned by metadata_content: html or markdown.
Returns the title of the page: in the x-screenshotone-page-title header, or in the JSON response.
Returns the Open Graph metadata of the page: in the x-screenshotone-open-graph header, or in the JSON response.
Returns the HTTP status code the site responded with. Only for requests with url.
Returns the HTTP headers the site responded with. Only for requests with url.
Returns the icon (favicon) of the site.
The format of the animation.
The duration of the animation in seconds. With scroll_complete=true, the recording stops earlier when the scrolling is completed.
Renders a transparent background when the page doesn't define one. Only for format=mov.
The width of the video in pixels. Set together with height; by default, the width of the viewport. Not used when aspect_ratio is set.
The height of the video in pixels. Set together with width; by default, the height of the viewport. Not used when aspect_ratio is set.
The aspect ratio to fit the video of the viewport into.
The left coordinate (x) of the area of the video to clip. Only for format=gif.
The top coordinate (y) of the area of the video to clip. Only for format=gif.
The width of the area of the video to clip. Only for format=gif.
The height of the area of the video to clip. Only for format=gif.
The scenario of the animation: default records the page as it is, scroll records scrolling the page.
The duration of one scroll in milliseconds. It is not the duration of the animation.
The delay between the scrolls in milliseconds.
How many pixels to scroll by at a time.
The easing effect of the scrolling.
Whether to start scrolling immediately or to wait for scroll_delay first.
The time to wait before the scrolling starts, in milliseconds.
Stops the recording when the scrolling is completed, even when it is earlier than duration.
Whether to scroll back to the top after reaching the bottom of the page.
How to scroll back: once scrolls back in one move, repeat repeats the same steps the page was scrolled down with.
Scrolls back after the given time in milliseconds. Can't be used with scroll_stop_after_duration.
Stops scrolling after the given time in milliseconds. Requires scroll_back=false.
Scrolls to the end of the page in one scroll after the given time in milliseconds. Only for scenario=scroll.
A selector of the element to scroll to; the scrolling stops when the element is visible.
How many pixels to shift the element given in scroll_till_selector from the top of the viewport.
Navigates to another page while scrolling and records the opened page.
The time in milliseconds after which to navigate. By default, half of the duration.
The URL to navigate to while scrolling.
When scroll_navigate_to_url is not set, the keywords to choose an internal link to navigate to by its text.
Response
A successful recording of a website, HTML, or Markdown.
Changes
- info
endpoint added
- info