Python REST API No Selenium needed

Screenshot API for Python

Capture website screenshots in Python without installing Selenium, Chrome drivers, or Playwright. One HTTP request with the requests library is all you need.

Get Free API Key →

Quick Start

import requests

url = "https://grabshot.dev/v1/screenshot"
params = {
    "url": "https://example.com",
    "key": "YOUR_API_KEY"
}

response = requests.get(url, params=params)

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

Full Example with Options

import requests
import os

def capture_screenshot(target_url, **options):
    """Capture a website screenshot using GrabShot API."""
    params = {
        "url": target_url,
        "key": os.environ["GRABSHOT_API_KEY"],
        "width": options.get("width", 1440),
        "height": options.get("height", 900),
        "format": options.get("format", "png"),
        "fullPage": options.get("full_page", "false"),
    }
    
    if options.get("dark_mode"):
        params["darkMode"] = "true"
    if options.get("device_frame"):
        params["deviceFrame"] = options["device_frame"]
    
    response = requests.get("https://grabshot.dev/v1/screenshot", params=params)
    response.raise_for_status()
    return response.content

# Usage
img = capture_screenshot(
    "https://github.com",
    width=1920,
    full_page=True,
    device_frame="macbook"
)

with open("github.png", "wb") as f:
    f.write(img)

Django Integration

# views.py
from django.http import HttpResponse
import requests

def screenshot_view(request):
    url = request.GET.get("url")
    if not url:
        return HttpResponse("url parameter required", status=400)
    
    resp = requests.get("https://grabshot.dev/v1/screenshot", params={
        "url": url,
        "key": settings.GRABSHOT_API_KEY,
    })
    
    return HttpResponse(resp.content, content_type="image/png")

Flask Integration

from flask import Flask, request, send_file
import requests as http
from io import BytesIO

app = Flask(__name__)

@app.route("/screenshot")
def screenshot():
    url = request.args.get("url")
    resp = http.get("https://grabshot.dev/v1/screenshot", params={
        "url": url,
        "key": app.config["GRABSHOT_KEY"],
    })
    return send_file(BytesIO(resp.content), mimetype="image/png")

GrabShot vs Selenium/Playwright

FeatureGrabShot APISeleniumPlaywright
Setuppip install requestsChrome + chromedriverplaywright install
Memory~0 MB300-800 MB200-500 MB
Speed~2s API call5-15s per page3-10s per page
ConcurrencyUnlimitedRAM-limitedRAM-limited
Server neededNoYes (display)Yes (or headless)
Device framesBuilt-inManualEmulation only

Common Use Cases in Python

Web Scraping with Visual Context

Capture visual snapshots alongside your scraped data for verification and archival.

Automated Reporting

Generate PDF reports with embedded website screenshots using ReportLab or WeasyPrint.

Social Media Automation

Create social media cards with website previews for your marketing pipeline.

Monitoring Dashboards

Periodically capture screenshots of web dashboards for stakeholder updates.

Pricing

Free tier: 25 screenshots/month. No credit card required.

Starter: $9/mo for 2,500 screenshots, no watermark.

Pro: $29/mo for 10,000 screenshots with AI cleanup.

Start Free — No Credit Card →

Full API documentation →