# Screenshots

Best for: Images of any public page for previews, checks and archives. Category: Any website.

Any public URL as a PNG, JPEG or WebP image, after the page has run its JavaScript and loaded its images. Capture the viewport at the width, height and pixel ratio you choose (scale 2 or 3 for retina), the whole scrollable page, or one element by CSS selector. Wait for load, network idle, a selector or a fixed pause first, and load the page from a country you name. Call it with GET and query parameters or POST with JSON; the answer is the image itself or JSON with the image base64-encoded.

- Look up by: The page URL
- Coverage: Public pages on ports 80, 443, 8080 and 8443. Private and internal addresses are refused.
- Cost: From 1 credit a call; failed and empty calls are free
- Answers: Details

## Endpoints

- `GET /v1/screenshot`: Screenshot a page (GET), from 1 credit. https://scrapercompany.com/docs/reference/screenshot-get
- `POST /v1/screenshot`: Screenshot a page, from 1 credit. https://scrapercompany.com/docs/reference/screenshot

## Example

Screenshot a page (GET) (`GET /v1/screenshot`):

```bash
curl -f "https://api.scrapercompany.com/v1/screenshot?url=https%3A%2F%2Fexample.com" \
  -H "x-api-key: $SCRAPERCOMPANY_API_KEY" \
  -o screenshot.png
```

## Good to know

- The site's own status comes back in the X-Upstream-Status header. Only a 2xx page that produced an image is charged; an error page is returned free.
- 1 credit for most pages; 5 for a site that refuses standard requests or with country; 75 with premium. 5 (75) is held while the capture runs.
- Viewport 1440 x 900 by default, 320-3840 wide and 240-2160 high; full_page captures the whole page; selector captures one element.
- jpeg and webp take a quality from 1 to 100 (80 by default); png is lossless.
- An error is always JSON, never an image, so check the status before you save the body.

- [All data sources](https://scrapercompany.com/docs/data-sources)
