Allscreenshots Docs
Getting started

Quickstart

Capture your first screenshot in under 5 minutes

Quickstart

Get up and running with AllScreenshots in just a few minutes.

Create an account

Sign up at allscreenshots.com using your email or GitHub account. You'll get 100 free screenshots to start with.

Get your API key

After signing in, go to your dashboard and create an API key. Copy it somewhere safe—you'll only see the full key once.

Keep your API key secret. Don't commit it to version control or expose it in client-side code.

Capture your first screenshot

Make a POST request to capture a screenshot:

curl -X POST 'https://api.allscreenshots.com/v1/screenshots' \
  -H 'Authorization: Bearer YOUR_API_KEY' \
  -H 'Content-Type: application/json' \
  -d '{"url": "https://github.com"}' \
  --output screenshot.png

This saves the screenshot as screenshot.png in your current directory.

Next steps

Now that you've captured your first screenshot, explore more options:

Customize the viewport

Capture at a specific resolution:

{
  "url": "https://github.com",
  "viewport": {
    "width": 1440,
    "height": 900
  }
}

Emulate a device

Render as if viewed on an iPhone:

{
  "url": "https://github.com",
  "device": "iphone_15"
}

Capture full pages

Scroll and capture the entire page:

{
  "url": "https://github.com",
  "fullPage": true
}

Get a JSON response

Instead of binary image data, receive a URL:

{
  "url": "https://github.com",
  "responseType": "json"
}

Response:

{
  "url": "https://storage.allscreenshots.com/abc123.png",
  "expiresAt": "2025-01-30T12:00:00Z",
  "size": 245678,
  "width": 1920,
  "height": 1080,
  "format": "png",
  "renderTime": 1234
}

Common options

OptionTypeDefaultDescription
urlstringrequiredThe URL to capture
formatstring"png"Output format: png, jpeg, webp, pdf
viewport.widthnumber1920Viewport width in pixels
viewport.heightnumber1080Viewport height in pixels
fullPagebooleanfalseCapture the full scrollable page
delaynumber0Wait time in ms before capture
darkModebooleanfalseEmulate dark color scheme

See the API reference for all available options.

Code examples

JavaScript

const response = await fetch('https://api.allscreenshots.com/v1/screenshots', {
  method: 'POST',
  headers: {
    'Authorization': 'Bearer YOUR_API_KEY',
    'Content-Type': 'application/json',
  },
  body: JSON.stringify({
    url: 'https://github.com',
    format: 'png',
    viewport: { width: 1280, height: 720 }
  }),
});

const screenshot = await response.blob();

Python

import requests

response = requests.post(
    'https://api.allscreenshots.com/v1/screenshots',
    headers={'Authorization': 'Bearer YOUR_API_KEY'},
    json={
        'url': 'https://github.com',
        'format': 'png',
        'viewport': {'width': 1280, 'height': 720}
    }
)

with open('screenshot.png', 'wb') as f:
    f.write(response.content)

Go

package main

import (
    "bytes"
    "encoding/json"
    "io"
    "net/http"
    "os"
)

func main() {
    payload := map[string]interface{}{
        "url":    "https://github.com",
        "format": "png",
    }
    body, _ := json.Marshal(payload)

    req, _ := http.NewRequest("POST",
        "https://api.allscreenshots.com/v1/screenshots",
        bytes.NewBuffer(body))
    req.Header.Set("Authorization", "Bearer YOUR_API_KEY")
    req.Header.Set("Content-Type", "application/json")

    client := &http.Client{}
    resp, _ := client.Do(req)
    defer resp.Body.Close()

    file, _ := os.Create("screenshot.png")
    defer file.Close()
    io.Copy(file, resp.Body)
}

On this page