> ## Documentation Index
> Fetch the complete documentation index at: /llms.txt
> Use this file to discover all available pages before exploring further.

# Screenshot

> Capture any website as an image: the browser window or the full page, at any window size

Screenshot captures any URL as an image, rendered in a real browser.

* Handles the hard parts: JavaScript rendering, ads and cookie banners
* Captures the browser window or the full scrollable page, at any window size
* Returns a link to the image on our domain, ready to save or share

For details, see the [Scrape Endpoint API Reference](/api-reference/endpoint/scrape.md): a screenshot is the `screenshot` format of `/scrape`.

> [!NOTE]
>
> If a request fails, see [Errors](/api-reference/errors.md) for the error codes and what to do about each one.

## Taking a screenshot with ScreenshotRender

### /scrape endpoint (with screenshot)

Ask `/scrape` for the `screenshot` format. The SDKs have a `screenshot()` method that does this for you.

### Installation

```bash Python
pip install screenshotrender
```

```bash Node
npm install screenshotrender
```

### Usage

```python Python
from screenshotrender import ScreenshotRender

screenshotrender = ScreenshotRender(api_key="sr-YOUR-API-KEY")

shot = screenshotrender.screenshot("https://example.com")
print(shot.screenshot)  # the image's URL
```

```js Node
import ScreenshotRender from "screenshotrender";

const screenshotrender = new ScreenshotRender({ apiKey: "sr-YOUR-API-KEY" });

const shot = await screenshotrender.screenshot("https://example.com");
console.log(shot.screenshot); // the image's URL
```

```bash cURL
curl -s -X POST "https://www.screenshotrender.com/api/v1/scrape" \
  -H "Authorization: Bearer $SCREENSHOTRENDER_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "url": "https://example.com",
    "formats": ["screenshot"]
  }'
```

> [!NOTE]
>
> Each screenshot costs 1 credit.

### Response

SDKs return the page object directly. cURL returns the payload exactly as shown below.

```json Response
{
  "success": true,
  "data": {
    "screenshot": "https://www.screenshotrender.com/files/screenshots/8o0RFROSVXjP2IShpJLe4PMDX60WrcH8.png",
    "metadata": {
      "title": "Example Domain",
      "language": "en",
      "sourceURL": "https://example.com/",
      "url": "https://www.example.com/",
      "statusCode": 200,
      "contentType": "text/html; charset=utf-8",
      "proxyUsed": "basic",
      "cacheState": "hit",
      "cachedAt": "2026-12-03T11:45:46.804Z"
    }
  },
  "creditsUsed": 1
}
```

`data.screenshot` is a PNG on `www.screenshotrender.com`, kept for 30 days. Without options, the capture is the 1920×1080 browser window.

## Full page and window size

Set `fullPage` to capture the whole scrollable page instead of the browser window, and `viewport` to choose the window size in pixels. In the SDKs these are options of `screenshot()`. In the API, pass the format as an object: `{ "type": "screenshot", "fullPage": true, "viewport": { ... } }`.

```python Python
from screenshotrender import ScreenshotRender

screenshotrender = ScreenshotRender(api_key="sr-YOUR-API-KEY")

shot = screenshotrender.screenshot(
    "https://www.screenshotrender.com",
    full_page=True,
    viewport={"width": 1440, "height": 900},
)
print(shot.screenshot)
```

```js Node
import ScreenshotRender from "screenshotrender";

const screenshotrender = new ScreenshotRender({ apiKey: "sr-YOUR-API-KEY" });

const shot = await screenshotrender.screenshot("https://www.screenshotrender.com", {
  fullPage: true,
  viewport: { width: 1440, height: 900 },
});
console.log(shot.screenshot);
```

```bash cURL
curl -s -X POST "https://www.screenshotrender.com/api/v1/scrape" \
  -H "Authorization: Bearer $SCREENSHOTRENDER_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "url": "https://www.screenshotrender.com",
    "formats": [
      { "type": "screenshot", "fullPage": true, "viewport": { "width": 1440, "height": 900 } }
    ]
  }'
```

```json Response
{
  "success": true,
  "data": {
    "screenshot": "https://www.screenshotrender.com/files/screenshots/2hNsa9qksnP-fhyKPwGEkw9ne_2P6W32.png",
    "metadata": {
      "title": "ScreenshotRender · Screenshot API for Cloudflare, SPAs, and clean previews",
      "description": "Render a pixel-perfect screenshot of any URL. A Cloudflare screenshot, a JavaScript-heavy SPA, or a cookie-banner-free p...",
      "language": "en",
      "sourceURL": "https://www.screenshotrender.com/",
      "url": "https://www.screenshotrender.com/",
      "statusCode": 200,
      "contentType": "text/html; charset=utf-8",
      "proxyUsed": "basic"
    }
  },
  "creditsUsed": 1
}
```

The image above is 1440 pixels wide, the window width, and 7217 pixels tall, the length of the page.

## Mobile, ads, waiting and location

Page options work with screenshots like with any other format:

```python Python
from screenshotrender import ScreenshotRender

screenshotrender = ScreenshotRender(api_key="sr-YOUR-API-KEY")

shot = screenshotrender.screenshot(
    "https://www.screenshotrender.com",
    mobile=True,
    block_ads=True,
    wait_for=1000,
    location={"country": "US"},
)
print(shot.screenshot)
```

```js Node
import ScreenshotRender from "screenshotrender";

const screenshotrender = new ScreenshotRender({ apiKey: "sr-YOUR-API-KEY" });

const shot = await screenshotrender.screenshot("https://www.screenshotrender.com", {
  mobile: true,
  blockAds: true,
  waitFor: 1000,
  location: { country: "US" },
});
console.log(shot.screenshot);
```

```bash cURL
curl -s -X POST "https://www.screenshotrender.com/api/v1/scrape" \
  -H "Authorization: Bearer $SCREENSHOTRENDER_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "url": "https://www.screenshotrender.com",
    "formats": ["screenshot"],
    "mobile": true,
    "blockAds": true,
    "waitFor": 1000,
    "location": { "country": "US" }
  }'
```

| Option | What it does |
| - | - |
| `mobile` | Loads the page as a phone would, with its mobile layout. The capture above is 360×800. |
| `blockAds` | Hides ads and cookie banners before capturing. |
| `waitFor` | Milliseconds to wait after the page loads, for animations or late content. |
| `location.country` | Loads the page from this country (ISO code, like `"US"` or `"DE"`). |
| `timeout` | Most milliseconds to wait for the page. |

See the [Advanced scraping guide](/advanced-scraping-guide.md) for every page option.

## Screenshots with other formats

A screenshot is a format like any other, so you can ask for it next to other [formats](/features/scrape.md#scrape-formats) in the same request. The page still costs 1 credit.

```bash cURL
curl -s -X POST "https://www.screenshotrender.com/api/v1/scrape" \
  -H "Authorization: Bearer $SCREENSHOTRENDER_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "url": "https://example.com",
    "formats": ["markdown", "screenshot"]
  }'
```

The response has both `data.markdown` and `data.screenshot`.

## Screenshots from your agent

The [MCP server](/mcp-server.md) has a `take_screenshot` tool that returns the image inline, so your agent can see the page, plus its link and the page's title and description.
