Screenshot API

URL to Image API — Turn Any Website Into a Screenshot Instantly

Published April 4, 2026 — 6 min read

Need to capture website screenshots programmatically? Whether you're building a link preview tool, a site monitoring dashboard, or an automated reporting system — a URL to image API lets you do it with a single HTTP request.

URLSnap is a hosted screenshot API that converts any public URL to a PNG or JPEG image. No Puppeteer to install, no headless Chrome to maintain, no server required.

The Simplest Possible Screenshot API

Here's how easy it is to take a screenshot of any website:

# One-line screenshot with curl
curl "https://urlsnap.dev/api/screenshot?url=https://github.com&apiKey=YOUR_KEY" \
  --output screenshot.png

That's it. One HTTP request, one PNG file. Works from any language, any environment, any platform.

Try it free — no credit card needed

Get your API key in 30 seconds and start capturing screenshots immediately.

Get Free API Key View Docs

Common Use Cases

🔗 Link Previews

Show thumbnail screenshots when users share URLs — like social media link cards.

📊 Site Monitoring

Capture periodic screenshots of your site to detect visual regressions automatically.

📰 Content Archiving

Archive visual snapshots of web pages for audit trails, compliance, or journalism.

🛍️ E-commerce Tracking

Screenshot competitor product pages to track pricing and layout changes over time.

📧 Email Thumbnails

Generate preview images of articles or products to embed in email newsletters.

🤖 Automated Reports

Capture dashboard screenshots and embed them in Slack/email reports automatically.

API Parameters

ParameterDescriptionDefault
urlThe website URL to screenshot (required)
apiKeyYour API key (required)
widthViewport width in pixels1280
heightViewport height in pixels800
fullCapture full scrollable page (true/false)false
formatOutput format: png or jpegpng
qualityJPEG quality 1–100 (jpeg only)90
delayWait N ms after page load (for animations/async)0

Code Examples

Node.js

const fs = require('fs');

async function screenshotUrl(url) {
  const apiUrl = `https://urlsnap.dev/api/screenshot?url=${encodeURIComponent(url)}&apiKey=YOUR_KEY&full=true`;
  const res = await fetch(apiUrl);
  const buffer = Buffer.from(await res.arrayBuffer());
  fs.writeFileSync('screenshot.png', buffer);
  console.log('Saved screenshot.png');
}

screenshotUrl('https://example.com');

Python

import requests

def screenshot_url(url):
    api_url = f"https://urlsnap.dev/api/screenshot?url={url}&apiKey=YOUR_KEY&full=true"
    response = requests.get(api_url)
    response.raise_for_status()
    with open("screenshot.png", "wb") as f:
        f.write(response.content)
    print("Saved screenshot.png")

screenshot_url("https://example.com")

PHP

<?php
function screenshotUrl($url) {
    $apiUrl = "https://urlsnap.dev/api/screenshot?url=" . urlencode($url) . "&apiKey=YOUR_KEY&full=true";
    $imageData = file_get_contents($apiUrl);
    file_put_contents("screenshot.png", $imageData);
    echo "Saved screenshot.png\n";
}

screenshotUrl("https://example.com");

Go

package main

import (
    "io"
    "net/http"
    "net/url"
    "os"
)

func screenshotUrl(targetURL string) error {
    apiURL := "https://urlsnap.dev/api/screenshot?url=" + url.QueryEscape(targetURL) + "&apiKey=YOUR_KEY&full=true"
    resp, err := http.Get(apiURL)
    if err != nil { return err }
    defer resp.Body.Close()
    f, _ := os.Create("screenshot.png")
    defer f.Close()
    io.Copy(f, resp.Body)
    return nil
}

Full-Page vs Viewport Screenshots

By default, URLSnap captures what's visible in the viewport (1280×800). Adding ?full=true captures the entire scrollable page — perfect for long landing pages, articles, or documentation.

# Viewport screenshot (1280x800, what you see above the fold)
https://urlsnap.dev/api/screenshot?url=https://example.com&apiKey=KEY

# Full-page screenshot (entire scrollable content)
https://urlsnap.dev/api/screenshot?url=https://example.com&full=true&apiKey=KEY

# Mobile viewport screenshot
https://urlsnap.dev/api/screenshot?url=https://example.com&width=390&height=844&apiKey=KEY

JavaScript-Rendered Pages (React, Vue, SPAs)

URLSnap uses a real headless Chromium browser under the hood. This means JavaScript executes, React/Vue components render, and dynamic content loads — just like a real browser.

For pages with animations or async data fetching, use the delay parameter to wait for the content to finish loading:

# Wait 2 seconds after page load for async content
https://urlsnap.dev/api/screenshot?url=https://myapp.com&delay=2000&apiKey=KEY
Tip: Most modern SPAs load in under 1 second. Start with delay=1000 and only increase if your screenshots are missing dynamic content.

Mobile Screenshots

Need to screenshot the mobile version of a site? Just set the viewport to phone dimensions:

# iPhone 14 Pro dimensions
https://urlsnap.dev/api/screenshot?url=https://example.com&width=393&height=852&apiKey=KEY

# Samsung Galaxy S23
https://urlsnap.dev/api/screenshot?url=https://example.com&width=360&height=780&apiKey=KEY

Also: URL to PDF API

URLSnap also supports PDF generation from any URL — same simple API, returns a PDF file instead of an image:

GET https://urlsnap.dev/api/pdf?url=https://example.com&apiKey=YOUR_KEY

See the HTML to PDF API guide for full documentation and examples.

Pricing

All plans include full-page screenshots, PDF generation, custom viewport sizes, and JavaScript rendering.

Start capturing screenshots now

Free API key in 30 seconds. 20 screenshots/day at no cost — no credit card required.

Get Free API Key View Pricing

FAQ

What is a URL to image API?

A URL to image API is a REST service that accepts a website URL and returns a screenshot of that page as a PNG or JPEG image. You make one HTTP GET request and receive image bytes back. No browser or headless Chrome required on your server.

Does the API render JavaScript?

Yes. URLSnap uses headless Chromium under the hood — the same engine as Google Chrome. React, Vue, Angular, and other JavaScript frameworks render correctly. Use ?delay=N if your page loads data asynchronously.

How fast are screenshots?

Most screenshots complete in 2–5 seconds, depending on how fast the target page loads. Simple static pages can complete in under 1 second. Complex pages with many third-party scripts or slow CDNs may take longer.

What image formats are supported?

PNG (default) and JPEG. Use ?format=jpeg&quality=85 for smaller file sizes when you don't need transparency. PNG is better for screenshots with text and UI elements.

Can I screenshot localhost or internal URLs?

No — URLSnap is a cloud service and can only access publicly reachable URLs. For internal pages, you'd need a self-hosted headless browser solution like Puppeteer.

Is there a free trial?

Yes — the free plan gives you 20 screenshots per day with no credit card required. Sign up and get your API key in under 30 seconds.