[cdpfleet](https://cdpfleet.com/) / [Functions](https://cdpfleet.com/functions) / Screenshot

Free tool · Screenshot

# Screenshot any page in a *real browser*.

Enter a URL, pick the country the page should see you from, and get a PNG or JPEG back — rendered by a real browser, the way a visitor sees it. Free, no sign-up.

[Run it](#try)[API docs](https://cdpfleet.com/docs/functions/screenshot)

## Try it

Check how a page looks from another country, capture it for a ticket or a report, or test what a link preview will show.

## The same from code

`POST /v1/functions/screenshot` with your API key returns `image/png` or `image/jpeg` — more options than here, such as your own proxy or a browser of your choice. [All screenshot fields](https://cdpfleet.com/docs/functions/screenshot).

 

```bash
curl -s https://cdpfleet.com/v1/functions/screenshot \
  -H "x-api-key: $CDPFLEET_API_KEY" -H "content-type: application/json" \
  -d '{"url":"https://example.com/","country":"de","full_page":true}' -o shot.png -D - | grep -i '^x-call-id'
```

```js
// Node.js 18+: save as screenshot.mjs, run node screenshot.mjs
import { writeFile } from 'node:fs/promises';

const res = await fetch('https://cdpfleet.com/v1/functions/screenshot', {
  method: 'POST',
  headers: { 'x-api-key': process.env.CDPFLEET_API_KEY, 'content-type': 'application/json' },
  body: JSON.stringify({
    url: 'https://example.com/',
    country: 'de',
    full_page: true,
  }),
  signal: AbortSignal.timeout(30000),
});
if (!res.ok) throw new Error(`${res.status} ${await res.text()}`); // 429: wait Retry-After seconds
const bytes = Buffer.from(await res.arrayBuffer());
await writeFile('shot.png', bytes);
console.log(`shot.png: ${bytes.length} bytes`);
```

```python
# Python 3 with requests (pip install requests): save as screenshot.py, run python screenshot.py
import os
import requests

r = requests.post(
    "https://cdpfleet.com/v1/functions/screenshot",
    headers={"x-api-key": os.environ["CDPFLEET_API_KEY"]},
    json={
        "url": "https://example.com/",
        "country": "de",
        "full_page": True,
    },
    timeout=30,
)
if not r.ok:
    raise SystemExit(f"{r.status_code} {r.text}")  # 429: wait r.headers["Retry-After"] seconds
open("shot.png", "wb").write(r.content)
print(f"shot.png: {len(r.content)} bytes")
```

```java
// Java 17+: save as Main.java, run java Main.java
import java.net.URI;
import java.net.http.*;
import java.nio.file.*;
import java.time.Duration;

public class Main {
  public static void main(String[] args) throws Exception {
    String body = """
        {
          "url": "https://example.com/",
          "country": "de",
          "full_page": true
        }
        """;
    HttpResponse<byte[]> res = HttpClient.newHttpClient().send(
        HttpRequest.newBuilder(URI.create("https://cdpfleet.com/v1/functions/screenshot"))
            .header("x-api-key", System.getenv("CDPFLEET_API_KEY"))
            .header("content-type", "application/json")
            .timeout(Duration.ofSeconds(30))
            .POST(HttpRequest.BodyPublishers.ofString(body))
            .build(),
        HttpResponse.BodyHandlers.ofByteArray());
    if (res.statusCode() != 200) { // 429: wait Retry-After seconds
      throw new RuntimeException(res.statusCode() + " " + new String(res.body()));
    }
    Files.write(Path.of("shot.png"), res.body());
    System.out.println("shot.png: " + res.body().length + " bytes");
  }
}
```

```csharp
// .NET 8+: dotnet new console, replace Program.cs with this, run dotnet run
using System.Text;

using var http = new HttpClient { Timeout = TimeSpan.FromSeconds(30) };
http.DefaultRequestHeaders.Add("x-api-key", Environment.GetEnvironmentVariable("CDPFLEET_API_KEY"));
var body = """
    {
      "url": "https://example.com/",
      "country": "de",
      "full_page": true
    }
    """;
var res = await http.PostAsync("https://cdpfleet.com/v1/functions/screenshot",
    new StringContent(body, Encoding.UTF8, "application/json"));
if (!res.IsSuccessStatusCode) // 429: wait Retry-After seconds
    throw new Exception($"{(int)res.StatusCode} {await res.Content.ReadAsStringAsync()}");
var bytes = await res.Content.ReadAsByteArrayAsync();
await File.WriteAllBytesAsync("shot.png", bytes);
Console.WriteLine($"shot.png: {bytes.Length} bytes");
```

```go
// Go 1.21+: save as main.go, run go run main.go
package main

import (
	"fmt"
	"io"
	"log"
	"net/http"
	"os"
	"strings"
	"time"
)

func main() {
	body := `{
	  "url": "https://example.com/",
	  "country": "de",
	  "full_page": true
	}`
	req, _ := http.NewRequest("POST", "https://cdpfleet.com/v1/functions/screenshot", strings.NewReader(body))
	req.Header.Set("x-api-key", os.Getenv("CDPFLEET_API_KEY"))
	req.Header.Set("content-type", "application/json")
	res, err := (&http.Client{Timeout: 30 * time.Second}).Do(req)
	if err != nil {
		log.Fatal(err)
	}
	defer res.Body.Close()
	data, err := io.ReadAll(res.Body)
	if err != nil {
		log.Fatal(err)
	}
	if res.StatusCode != http.StatusOK { // 429: wait Retry-After seconds
		log.Fatalf("%s %s", res.Status, data)
	}
	if err := os.WriteFile("shot.png", data, 0o644); err != nil {
		log.Fatal(err)
	}
	fmt.Printf("shot.png: %d bytes\n", len(data))
}
```

## Free tool limits

-   **20 runs a day** and 2 at once per address, after a quick Cloudflare check.
-   Runs on a shared cdpfleet browser through the free [Community proxy](https://cdpfleet.com/community) in the country you pick; at busy times a run can take longer or ask you to retry.
-   Public pages only: private and local addresses are refused. Up to 60 seconds per page.
-   For more — your own threads, your own or residential proxies, any browser and phone devices — call the same functions with an API key; the [Community plan](https://cdpfleet.com/community) is free, and [paid plans](https://cdpfleet.com/upgrade) add more.

## Related

Cases, recipes, posts and comparisons about this — updated as new ones are published.

### Reference docs

The details, options and errors.

-   [Screenshot function](https://cdpfleet.com/docs/functions/screenshot)Every field and the response.
-   [Functions](https://cdpfleet.com/docs/functions)Billing, own browser, errors, countries.

### Cases 5

Real problems solved end to end, run on production in five languages.

-   [Case 89: Watch a page live: its XHR calls, DOM changes and WebSocket messages over SSE and a signed webhook](https://cdpfleet.com/docs/cases/watch-a-page-live)Keep a Chrome of yours on a page that updates itself (the ISS position, polled about once a second), and get every matching XHR response and every change to one…[Code on GitHub](https://github.com/cdpfleet/cdpfleet/tree/main/cases/89-watch-a-page-live)
-   [Case 88: A monitor end to end: create it, trigger a change, verify the signed webhook, read the diff and history](https://cdpfleet.com/docs/cases/monitor-end-to-end)Watch one element of a page that changes on every load, trigger checks with `POST …/run`, receive the `monitor.change` webhook and verify its HMAC signature, check…[Code on GitHub](https://github.com/cdpfleet/cdpfleet/tree/main/cases/88-monitor-end-to-end)
-   [Case 53: Surviving a soft block: honour Retry-After, then move to another exit without losing the login](https://cdpfleet.com/docs/cases/soft-block-backoff)Two crawlers against the same rate-limited site. The one that retries a 429 straight away is challenged and gets 3 of 8 pages. The one that waits as told and moves…[Code on GitHub](https://github.com/cdpfleet/cdpfleet/tree/main/cases/53-soft-block-backoff)
-   [Case 50: A price watcher in one program: two snapshots minutes apart, diffed, billed only while reading](https://cdpfleet.com/docs/cases/price-watch)Take a snapshot of a catalogue price and a live market price, wait two minutes, take another and diff them field by field. Each snapshot is its own short session, so…[Code on GitHub](https://github.com/cdpfleet/cdpfleet/tree/main/cases/50-price-watch)
-   [Case 29: Visual capture: full-page screenshot, element crop and PDF in one session](https://cdpfleet.com/docs/cases/screenshot-and-pdf)Four captures from one page load — viewport, full page, a single element and a PDF — rendered in the remote browser and saved on your machine, with their sizes and…[Code on GitHub](https://github.com/cdpfleet/cdpfleet/tree/main/cases/29-screenshot-and-pdf)

### Updates 1

Product news and browser releases.

-   [The live tab: a remote browser tab you share as a link](https://cdpfleet.com/docs/updates/live-tab)Open a real browser tab in another country and use it from any web browser — free on the site, longer from the dashboard or one API call, and a link you can hand to…

## Read next

[Functions →](https://cdpfleet.com/functions)[PDF →](https://cdpfleet.com/functions/pdf)[Markdown →](https://cdpfleet.com/functions/markdown)[Live tab →](https://cdpfleet.com/functions/livetab)[Raw page →](https://cdpfleet.com/functions/rawpage)[Community plan →](https://cdpfleet.com/community)

---
Source: https://cdpfleet.com/functions/screenshot · Markdown: https://cdpfleet.com/functions/screenshot.md · All docs for AI tools: https://cdpfleet.com/llms.txt
