One API that turns any URL or HTML into a screenshot, a pixel-perfect PDF, or a templated social image. Replace three subscriptions with one.
100 renders/month free · no credit card · first render in under 2 minutes
curl -X POST https://rasterkit.com/v1/screenshot \
-H "x-api-key: $RASTERKIT_API_KEY" \
-H "content-type: application/json" \
-d '{"url": "https://example.com", "full_page": true, "format": "png"}' \
-o screenshot.png import { writeFile } from 'node:fs/promises'
const res = await fetch('https://rasterkit.com/v1/screenshot', {
method: 'POST',
headers: {
'x-api-key': process.env.RASTERKIT_API_KEY,
'content-type': 'application/json',
},
body: JSON.stringify({"url": "https://example.com", "full_page": true, "format": "png"}),
})
if (!res.ok) throw new Error(`Render failed: ${res.status} ${await res.text()}`)
await writeFile('screenshot.png', Buffer.from(await res.arrayBuffer()))
console.log('Saved screenshot.png') import os
import requests
res = requests.post(
"https://rasterkit.com/v1/screenshot",
headers={"x-api-key": os.environ["RASTERKIT_API_KEY"]},
json={"url": "https://example.com", "full_page": True, "format": "png"},
timeout=60,
)
res.raise_for_status()
with open("screenshot.png", "wb") as f:
f.write(res.content)
print("Saved screenshot.png") <?php
$ch = curl_init('https://rasterkit.com/v1/screenshot');
curl_setopt_array($ch, [
CURLOPT_POST => true,
CURLOPT_RETURNTRANSFER => true,
CURLOPT_TIMEOUT => 60,
CURLOPT_HTTPHEADER => [
'x-api-key: ' . getenv('RASTERKIT_API_KEY'),
'content-type: application/json',
],
CURLOPT_POSTFIELDS => '{"url": "https://example.com", "full_page": true, "format": "png"}',
]);
$body = curl_exec($ch);
$status = curl_getinfo($ch, CURLINFO_RESPONSE_CODE);
curl_close($ch);
if ($status !== 200) {
throw new RuntimeException("Render failed: $status $body");
}
file_put_contents('screenshot.png', $body);
echo "Saved screenshot.png\n"; require "net/http"
require "json"
uri = URI("https://rasterkit.com/v1/screenshot")
req = Net::HTTP::Post.new(uri)
req["x-api-key"] = ENV.fetch("RASTERKIT_API_KEY")
req["content-type"] = "application/json"
req.body = '{"url": "https://example.com", "full_page": true, "format": "png"}'
res = Net::HTTP.start(uri.hostname, uri.port, use_ssl: true, read_timeout: 60) { |http| http.request(req) }
raise "Render failed: #{res.code} #{res.body}" unless res.code == "200"
File.binwrite("screenshot.png", res.body)
puts "Saved screenshot.png" package main
import (
"bytes"
"fmt"
"io"
"net/http"
"os"
"time"
)
func main() {
body := []byte(`{"url": "https://example.com", "full_page": true, "format": "png"}`)
req, _ := http.NewRequest("POST", "https://rasterkit.com/v1/screenshot", bytes.NewReader(body))
req.Header.Set("x-api-key", os.Getenv("RASTERKIT_API_KEY"))
req.Header.Set("content-type", "application/json")
client := &http.Client{Timeout: 60 * time.Second}
res, err := client.Do(req)
if err != nil {
panic(err)
}
defer res.Body.Close()
data, _ := io.ReadAll(res.Body)
if res.StatusCode != 200 {
panic(fmt.Sprintf("render failed: %d %s", res.StatusCode, data))
}
os.WriteFile("screenshot.png", data, 0644)
fmt.Println("Saved screenshot.png")
} import java.net.URI;
import java.net.http.*;
import java.nio.file.*;
import java.time.Duration;
public class Render {
public static void main(String[] args) throws Exception {
String body = """
{"url": "https://example.com", "full_page": true, "format": "png"}""";
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("https://rasterkit.com/v1/screenshot"))
.timeout(Duration.ofSeconds(60))
.header("x-api-key", System.getenv("RASTERKIT_API_KEY"))
.header("content-type", "application/json")
.POST(HttpRequest.BodyPublishers.ofString(body))
.build();
HttpResponse<byte[]> res = HttpClient.newHttpClient()
.send(request, HttpResponse.BodyHandlers.ofByteArray());
if (res.statusCode() != 200) {
throw new RuntimeException("Render failed: " + res.statusCode() + " " + new String(res.body()));
}
Files.write(Path.of("screenshot.png"), res.body());
System.out.println("Saved screenshot.png");
}
} using System.Text;
var client = new HttpClient { Timeout = TimeSpan.FromSeconds(60) };
client.DefaultRequestHeaders.Add("x-api-key",
Environment.GetEnvironmentVariable("RASTERKIT_API_KEY"));
var body = new StringContent(
"""{"url": "https://example.com", "full_page": true, "format": "png"}""",
Encoding.UTF8, "application/json");
var res = await client.PostAsync("https://rasterkit.com/v1/screenshot", body);
var bytes = await res.Content.ReadAsByteArrayAsync();
if (!res.IsSuccessStatusCode)
throw new Exception($"Render failed: {(int)res.StatusCode} {Encoding.UTF8.GetString(bytes)}");
await File.WriteAllBytesAsync("screenshot.png", bytes);
Console.WriteLine("Saved screenshot.png"); Full-page captures, mobile & tablet emulation, dark mode, ad and cookie-banner blocking. PNG, JPEG, or WebP.
Screenshot docs →Pixel-perfect PDFs from URLs or HTML through real Chromium. Headers, footers, page numbers, backgrounds — your CSS just works.
PDF docs →Social cards from HTML templates with {{variables}}. Design once,
generate thousands. Signed URLs drop straight into og:image.
<img> embeds.cache_ttl and identical requests are served instantly without consuming quota.All plans include screenshots, PDFs, and OG images from one quota. Annual billing = 2 months free. Cached renders never count against your quota.
Typical synchronous screenshots return in 1.5–3 s; PDFs from HTML are usually under 1 s. Cached renders return in tens of milliseconds. p95 targets: screenshot < 4 s, PDF < 6 s.
One successful screenshot, PDF, or image generation. Failed renders and cache hits are free. All three products draw from the same monthly pool.
Yes — pass async: true to get a job id immediately, then poll /v1/jobs/:id or receive a signed webhook when it finishes.
Yes — signed URLs let you put a render directly in an <img> tag or email template. Signatures are HMAC-SHA256 with a per-key secret.
Every fetched URL — including every redirect hop and subresource — is checked against private/reserved IP ranges. Browsers run sandboxed in isolated containers. See the url_blocked reference.
Sign up, copy your key, render — under 2 minutes.
Get your free API key