{"info":{"name":"ScreenshotBuddy API","description":"Render a web page as an image or a PDF, and read where the account stands. A successful render is the image or the PDF itself, so treat it as binary and write it to a file; every error is JSON in one envelope, carrying a machine readable `code` to branch on, a human `message`, a `request_id` to quote at support, and, for a validation failure, an `errors` object. Every render costs one credit, and a failed render is refunded.\n\nSet `token` to an API token from your dashboard and every request in this collection is authenticated. Optional query parameters are present but switched off, so the whole menu is in front of you without any of it being sent. The [OpenAPI document](https://screenshotbuddy.io/api/v1/openapi.json) describes the same API for anything that generates code.","version":"1.0.0","schema":"https://schema.getpostman.com/json/collection/v2.1.0/collection.json"},"auth":{"type":"bearer","bearer":[{"key":"token","value":"{{token}}","type":"string"}]},"variable":[{"key":"baseUrl","value":"https://screenshotbuddy.io/api/v1","type":"string","description":"The base URL of the API. Every request in this collection is built on it."},{"key":"token","value":"","type":"string","description":"An API token from your dashboard, sent as the bearer token of every request except the signed one."},{"key":"tokenId","value":"","type":"string","description":"The id of the token a signed URL is signed for: the number in front of the pipe in the token itself. Used by the signed request only."},{"key":"expires","value":"","type":"string","description":"The Unix timestamp a signed URL stops working at. Optional, and covered by the signature, so changing it here means signing again."},{"key":"signature","value":"","type":"string","description":"The signature of the signed request, produced on your own server. See https://screenshotbuddy.io/documentation/signed-urls."}],"item":[{"name":"Take a screenshot","request":{"method":"GET","description":"Renders the page at `url` as an image. The body of the answer is the image itself, so save the response rather than reading it. Every parameter this mode accepts is listed below, switched off until you want it.","url":{"raw":"{{baseUrl}}/snap?url=https://example.com","host":["{{baseUrl}}"],"path":["snap"],"query":[{"key":"url","value":"https://example.com","description":"The URL of the page to render. It must start with `http://` or `https://`, be at most `2048` characters long, and point at a publicly reachable host. Private, loopback and internal addresses are refused.","disabled":false},{"key":"fullPage","value":"1","description":"Whether to capture the entire scrollable page instead of just the viewport. Defaults to `false`. Screenshots only; sending it with `pdf` is rejected, because a PDF always prints the whole document.","disabled":true},{"key":"pdf","value":"1","description":"Set this to `true` to render a PDF instead of an image. It changes which other parameters are accepted, so see [creating PDFs](https://screenshotbuddy.io/documentation/creating-pdfs) for the options that belong to that mode. Defaults to `false`.","disabled":true},{"key":"format","value":"png","description":"The image format to return. Possible values are `png`, `jpeg` and `webp`. Defaults to `png`. Screenshots only; sending it with `pdf` is rejected. Use `paperFormat` to set the paper size of a PDF.","disabled":true},{"key":"quality","value":"1","description":"The quality of the image, between `1` and `100`. It applies to lossy formats only, so `format` has to be `jpeg` or `webp`; sending it with `png` is rejected. Screenshots only; sending it with `pdf` is rejected.","disabled":true},{"key":"width","value":"1","description":"The viewport width of a screenshot, or the paper width of a PDF, between `1` and `10000`. Must be used together with `height`. For a PDF it overrides `paperFormat` and is read in the unit set by `marginUnit`.","disabled":true},{"key":"height","value":"1","description":"The viewport height of a screenshot, or the paper height of a PDF, between `1` and `10000`. Must be used together with `width`. For a PDF it overrides `paperFormat` and is read in the unit set by `marginUnit`.","disabled":true},{"key":"scale","value":"1","description":"The scale of the rendering, between `1` and `3` for screenshots and between `0.1` and `2` for PDFs. Screenshots take whole numbers only, because the browser renders at whole device scale factors; PDFs take fractions. Defaults to `1`. A value outside the range of the mode you are in is rejected.","disabled":true},{"key":"delay","value":"0","description":"How long to wait before capturing, in milliseconds, between `0` and `10000`. Useful for pages that animate on load. Screenshots only; sending it with `pdf` is rejected, because the PDF renderer has no way to wait a fixed amount of time before it prints.","disabled":true},{"key":"selector","value":"","description":"A CSS selector. Only the first element that matches it is captured, instead of the page. At most `512` characters, and it may not contain single quotes, backslashes or control characters, so write attribute selectors with double quotes: `a[href=\"/pricing\"]`. It chooses what to capture, so it cannot be combined with a clip region or with `fullPage`. Screenshots only; sending it with `pdf` is rejected.","disabled":true},{"key":"clipX","value":"0","description":"The distance from the left edge of the page to the region to capture, in pixels, between `0` and `10000`. All four clip parameters (`clipX`, `clipY`, `clipWidth`, `clipHeight`) have to be set together. A clip region chooses what to capture, so it cannot be combined with `selector` or with `fullPage`. Screenshots only; sending it with `pdf` is rejected.","disabled":true},{"key":"clipY","value":"0","description":"The distance from the top edge of the page to the region to capture, in pixels, between `0` and `10000`. Set it together with the other three clip parameters. Screenshots only; sending it with `pdf` is rejected.","disabled":true},{"key":"clipWidth","value":"1","description":"The width of the region to capture, in pixels, between `1` and `10000`. Set it together with the other three clip parameters. Screenshots only; sending it with `pdf` is rejected.","disabled":true},{"key":"clipHeight","value":"1","description":"The height of the region to capture, in pixels, between `1` and `10000`. Set it together with the other three clip parameters. Screenshots only; sending it with `pdf` is rejected.","disabled":true},{"key":"omitBackground","value":"1","description":"Whether to render the page background transparent. Defaults to `false`. The format has to be able to hold transparency, so `png` or `webp`; sending it with `jpeg` is rejected rather than answered with a black background. Screenshots only; sending it with `pdf` is rejected.","disabled":true},{"key":"waitForSelector","value":"","description":"A CSS selector to wait for before capturing. The render continues once an element matching it exists. At most `512` characters, and under the same character restriction as `selector`: no single quotes, backslashes or control characters. Screenshots only; sending it with `pdf` is rejected.","disabled":true},{"key":"waitUntil","value":"load","description":"The load event to wait for before capturing. Possible values are `load`, `domcontentloaded`, `networkidle0` (no network connections for half a second) and `networkidle2` (at most two). Defaults to `networkidle2`. Screenshots only; sending it with `pdf` is rejected.","disabled":true},{"key":"cache","value":"0","description":"Whether an identical repeat of this request may be answered with the rendering we already made, and whether this rendering is kept for the next one. Defaults to `true`. A cached answer costs no credit and says so with `X-Cache: HIT`; send `cache=0` to render the page again, which costs a credit as any render does. Entries belong to your own account. See [caching](https://screenshotbuddy.io/documentation/caching) for the whole picture.","disabled":true},{"key":"cacheTtl","value":"86400","description":"How long the rendering is kept, in seconds, between `60` and `2592000` (thirty days). Defaults to `86400`. Sending it with `cache=0` is rejected, because there is no lifetime to set on a rendering that is not being kept.","disabled":true}]}}},{"name":"Render a PDF","request":{"method":"GET","description":"The same endpoint with `pdf` turned on, which changes which parameters are accepted: paper size and margins instead of image format and clipping. The body of the answer is the PDF itself.","url":{"raw":"{{baseUrl}}/snap?url=https://example.com&pdf=1","host":["{{baseUrl}}"],"path":["snap"],"query":[{"key":"url","value":"https://example.com","description":"The URL of the page to render. It must start with `http://` or `https://`, be at most `2048` characters long, and point at a publicly reachable host. Private, loopback and internal addresses are refused.","disabled":false},{"key":"pdf","value":"1","description":"Set this to `true` to render a PDF instead of an image. It changes which other parameters are accepted, so see [creating PDFs](https://screenshotbuddy.io/documentation/creating-pdfs) for the options that belong to that mode. Defaults to `false`.","disabled":false},{"key":"landscape","value":"1","description":"Whether to use landscape orientation. Defaults to `false` (portrait). PDFs only; sending it without `pdf` is rejected. A screenshot is shaped by `width` and `height` instead.","disabled":true},{"key":"paperFormat","value":"letter","description":"The paper format. Possible values are `letter`, `legal`, `tabloid`, `ledger`, and `a0` through `a6`. Defaults to `a4`. PDFs only; sending it without `pdf` is rejected. Use `format` to set the image format of a screenshot.","disabled":true},{"key":"width","value":"1","description":"The viewport width of a screenshot, or the paper width of a PDF, between `1` and `10000`. Must be used together with `height`. For a PDF it overrides `paperFormat` and is read in the unit set by `marginUnit`.","disabled":true},{"key":"height","value":"1","description":"The viewport height of a screenshot, or the paper height of a PDF, between `1` and `10000`. Must be used together with `width`. For a PDF it overrides `paperFormat` and is read in the unit set by `marginUnit`.","disabled":true},{"key":"marginTop","value":"0","description":"Top margin, between `0` and `1000`, in the unit set by `marginUnit`. All four margins (`marginTop`, `marginRight`, `marginBottom`, `marginLeft`) have to be set together. PDFs only; sending a margin without `pdf` is rejected.","disabled":true},{"key":"marginRight","value":"0","description":"Right margin, between `0` and `1000`, in the unit set by `marginUnit`. Set it together with the other three margins. PDFs only; sending a margin without `pdf` is rejected.","disabled":true},{"key":"marginBottom","value":"0","description":"Bottom margin, between `0` and `1000`, in the unit set by `marginUnit`. Set it together with the other three margins. PDFs only; sending a margin without `pdf` is rejected.","disabled":true},{"key":"marginLeft","value":"0","description":"Left margin, between `0` and `1000`, in the unit set by `marginUnit`. Set it together with the other three margins. PDFs only; sending a margin without `pdf` is rejected.","disabled":true},{"key":"marginUnit","value":"mm","description":"The unit for the margins and for a custom paper size. Possible values are `mm`, `cm`, `in` and `px`. Defaults to `mm`. PDFs only; sending it without `pdf` is rejected, because a screenshot's `width` and `height` are viewport pixels.","disabled":true},{"key":"scale","value":"1","description":"The scale of the rendering, between `1` and `3` for screenshots and between `0.1` and `2` for PDFs. Screenshots take whole numbers only, because the browser renders at whole device scale factors; PDFs take fractions. Defaults to `1`. A value outside the range of the mode you are in is rejected.","disabled":true},{"key":"cache","value":"0","description":"Whether an identical repeat of this request may be answered with the rendering we already made, and whether this rendering is kept for the next one. Defaults to `true`. A cached answer costs no credit and says so with `X-Cache: HIT`; send `cache=0` to render the page again, which costs a credit as any render does. Entries belong to your own account. See [caching](https://screenshotbuddy.io/documentation/caching) for the whole picture.","disabled":true},{"key":"cacheTtl","value":"86400","description":"How long the rendering is kept, in seconds, between `60` and `2592000` (thirty days). Defaults to `86400`. Sending it with `cache=0` is rejected, because there is no lifetime to set on a rendering that is not being kept.","disabled":true}]}}},{"name":"Render from a signed URL","request":{"method":"GET","description":"The same render, authenticated by an HMAC in the query string instead of by a bearer token, so the URL can go straight into an image tag. Fill `tokenId` and `signature` from your own signing code: https://screenshotbuddy.io/documentation/signed-urls spells the algorithm out with a worked example. This request sends no bearer token, because the signature is what authenticates.","url":{"raw":"{{baseUrl}}/snap/signed?url=https://example.com&tokenId={{tokenId}}&signature={{signature}}","host":["{{baseUrl}}"],"path":["snap","signed"],"query":[{"key":"url","value":"https://example.com","description":"The URL of the page to render. It must start with `http://` or `https://`, be at most `2048` characters long, and point at a publicly reachable host. Private, loopback and internal addresses are refused.","disabled":false},{"key":"fullPage","value":"1","description":"Whether to capture the entire scrollable page instead of just the viewport. Defaults to `false`. Screenshots only; sending it with `pdf` is rejected, because a PDF always prints the whole document.","disabled":true},{"key":"pdf","value":"1","description":"Set this to `true` to render a PDF instead of an image. It changes which other parameters are accepted, so see [creating PDFs](https://screenshotbuddy.io/documentation/creating-pdfs) for the options that belong to that mode. Defaults to `false`.","disabled":true},{"key":"format","value":"png","description":"The image format to return. Possible values are `png`, `jpeg` and `webp`. Defaults to `png`. Screenshots only; sending it with `pdf` is rejected. Use `paperFormat` to set the paper size of a PDF.","disabled":true},{"key":"quality","value":"1","description":"The quality of the image, between `1` and `100`. It applies to lossy formats only, so `format` has to be `jpeg` or `webp`; sending it with `png` is rejected. Screenshots only; sending it with `pdf` is rejected.","disabled":true},{"key":"width","value":"1","description":"The viewport width of a screenshot, or the paper width of a PDF, between `1` and `10000`. Must be used together with `height`. For a PDF it overrides `paperFormat` and is read in the unit set by `marginUnit`.","disabled":true},{"key":"height","value":"1","description":"The viewport height of a screenshot, or the paper height of a PDF, between `1` and `10000`. Must be used together with `width`. For a PDF it overrides `paperFormat` and is read in the unit set by `marginUnit`.","disabled":true},{"key":"scale","value":"1","description":"The scale of the rendering, between `1` and `3` for screenshots and between `0.1` and `2` for PDFs. Screenshots take whole numbers only, because the browser renders at whole device scale factors; PDFs take fractions. Defaults to `1`. A value outside the range of the mode you are in is rejected.","disabled":true},{"key":"delay","value":"0","description":"How long to wait before capturing, in milliseconds, between `0` and `10000`. Useful for pages that animate on load. Screenshots only; sending it with `pdf` is rejected, because the PDF renderer has no way to wait a fixed amount of time before it prints.","disabled":true},{"key":"selector","value":"","description":"A CSS selector. Only the first element that matches it is captured, instead of the page. At most `512` characters, and it may not contain single quotes, backslashes or control characters, so write attribute selectors with double quotes: `a[href=\"/pricing\"]`. It chooses what to capture, so it cannot be combined with a clip region or with `fullPage`. Screenshots only; sending it with `pdf` is rejected.","disabled":true},{"key":"clipX","value":"0","description":"The distance from the left edge of the page to the region to capture, in pixels, between `0` and `10000`. All four clip parameters (`clipX`, `clipY`, `clipWidth`, `clipHeight`) have to be set together. A clip region chooses what to capture, so it cannot be combined with `selector` or with `fullPage`. Screenshots only; sending it with `pdf` is rejected.","disabled":true},{"key":"clipY","value":"0","description":"The distance from the top edge of the page to the region to capture, in pixels, between `0` and `10000`. Set it together with the other three clip parameters. Screenshots only; sending it with `pdf` is rejected.","disabled":true},{"key":"clipWidth","value":"1","description":"The width of the region to capture, in pixels, between `1` and `10000`. Set it together with the other three clip parameters. Screenshots only; sending it with `pdf` is rejected.","disabled":true},{"key":"clipHeight","value":"1","description":"The height of the region to capture, in pixels, between `1` and `10000`. Set it together with the other three clip parameters. Screenshots only; sending it with `pdf` is rejected.","disabled":true},{"key":"omitBackground","value":"1","description":"Whether to render the page background transparent. Defaults to `false`. The format has to be able to hold transparency, so `png` or `webp`; sending it with `jpeg` is rejected rather than answered with a black background. Screenshots only; sending it with `pdf` is rejected.","disabled":true},{"key":"waitForSelector","value":"","description":"A CSS selector to wait for before capturing. The render continues once an element matching it exists. At most `512` characters, and under the same character restriction as `selector`: no single quotes, backslashes or control characters. Screenshots only; sending it with `pdf` is rejected.","disabled":true},{"key":"waitUntil","value":"load","description":"The load event to wait for before capturing. Possible values are `load`, `domcontentloaded`, `networkidle0` (no network connections for half a second) and `networkidle2` (at most two). Defaults to `networkidle2`. Screenshots only; sending it with `pdf` is rejected.","disabled":true},{"key":"cache","value":"0","description":"Whether an identical repeat of this request may be answered with the rendering we already made, and whether this rendering is kept for the next one. Defaults to `true`. A cached answer costs no credit and says so with `X-Cache: HIT`; send `cache=0` to render the page again, which costs a credit as any render does. Entries belong to your own account. See [caching](https://screenshotbuddy.io/documentation/caching) for the whole picture.","disabled":true},{"key":"cacheTtl","value":"86400","description":"How long the rendering is kept, in seconds, between `60` and `2592000` (thirty days). Defaults to `86400`. Sending it with `cache=0` is rejected, because there is no lifetime to set on a rendering that is not being kept.","disabled":true},{"key":"tokenId","value":"{{tokenId}}","description":"The id of the API token this URL is signed for. It is the number in front of the pipe in the token itself, and it is shown next to every token under Settings, API tokens. It is not a secret, and it is covered by the signature, so it cannot be swapped for another account's. See [signed URLs](https://screenshotbuddy.io/documentation/signed-urls).","disabled":false},{"key":"expires","value":"{{expires}}","description":"The Unix timestamp, in seconds, after which this URL stops working. Optional; a URL without one keeps working until the token is revoked or rotated. It is covered by the signature, so it cannot be pushed back without signing again, and a URL past it is refused with `signed_url_expired` rather than rendered.","disabled":true},{"key":"signature","value":"{{signature}}","description":"The HMAC-SHA256 of the canonical query, keyed with the signing secret of the token, in lowercase hex. Exactly 64 characters. Every other query parameter is covered by it, so anything appended to the URL, a tracking parameter included, invalidates it. The [signed URLs](https://screenshotbuddy.io/documentation/signed-urls) page spells out the canonicalisation step by step.","disabled":false}]},"auth":{"type":"noauth"}}},{"name":"Read the account usage","request":{"method":"GET","description":"Reports the credits, plan, period and rate limit of the account. It costs no credit and has a throttle of its own, so polling it never eats into what the render endpoint will accept.","url":{"raw":"{{baseUrl}}/usage","host":["{{baseUrl}}"],"path":["usage"]}}},{"name":"Fetch the OpenAPI document","request":{"method":"GET","description":"The machine readable description of this API, which is what to point a client generator at. Public, so it takes no token.","url":{"raw":"{{baseUrl}}/openapi.json","host":["{{baseUrl}}"],"path":["openapi.json"]},"auth":{"type":"noauth"}}}]}