Screenshots and PDFs
HTML and Markdown
Get a page’s content instead of a picture of it. The page is loaded in a real browser first, so content added by JavaScript is included, and cookie banners and other overlays can be removed the same way as for screenshots.
Markdown
format=markdown
returns the page’s readable content as Markdown, without navigation, scripts or styling. It’s the format to use when passing a page to an AI model or a search index.
// npm install @shotsmith/sdk
import { Shotsmith, TakeOptions } from '@shotsmith/sdk';
import { writeFile } from 'node:fs/promises';
const shotsmith = new Shotsmith({
accessKey: 'YOUR_ACCESS_KEY',
});
const options = TakeOptions.url('https://shotsmith.dev/sample')
.format('markdown');
await writeFile('capture.md', await shotsmith.take(options));
<?php
// composer require shotsmith/shotsmith-php
require 'vendor/autoload.php';
use Shotsmith\Client;
use Shotsmith\Options\TakeOptions;
$shotsmith = new Client('YOUR_ACCESS_KEY');
$options = TakeOptions::url('https://shotsmith.dev/sample')
->format('markdown');
file_put_contents('capture.md', $shotsmith->take($options));
// In Laravel: Shotsmith::take($options) with SHOTSMITH_ACCESS_KEY in .env
curl -G "https://shotsmith.dev/v1/take" \ --data-urlencode "access_key=YOUR_ACCESS_KEY" \ --data-urlencode "url=https://shotsmith.dev/sample" \ --data-urlencode "format=markdown" \ -o capture.md
import { writeFile } from 'node:fs/promises';
const params = new URLSearchParams({
access_key: 'YOUR_ACCESS_KEY',
url: 'https://shotsmith.dev/sample',
format: 'markdown',
});
const res = await fetch(`https://shotsmith.dev/v1/take?${params}`);
if (!res.ok) throw new Error((await res.json()).error_message);
await writeFile('capture.md', Buffer.from(await res.arrayBuffer()));
import urllib.request
from urllib.parse import urlencode
params = {
"access_key": "YOUR_ACCESS_KEY",
"url": "https://shotsmith.dev/sample",
"format": "markdown"
}
url = "https://shotsmith.dev/v1/take?" + urlencode(params, doseq=True)
# Raises urllib.error.HTTPError on a 4xx/5xx response
with urllib.request.urlopen(url, timeout=120) as res, open("capture.md", "wb") as f:
f.write(res.read())
<?php
$query = http_build_query([
'access_key' => 'YOUR_ACCESS_KEY',
'url' => 'https://shotsmith.dev/sample',
'format' => 'markdown',
], '', '&', PHP_QUERY_RFC3986);
$ch = curl_init('https://shotsmith.dev/v1/take?' . $query);
curl_setopt_array($ch, [
CURLOPT_RETURNTRANSFER => true,
CURLOPT_TIMEOUT => 120,
]);
$body = curl_exec($ch);
$status = curl_getinfo($ch, CURLINFO_RESPONSE_CODE);
if ($status !== 200) {
throw new RuntimeException(json_decode($body, true)['error_message'] ?? "HTTP {$status}");
}
file_put_contents('capture.md', $body);
package main
import (
"io"
"net/http"
"os"
)
func main() {
res, err := http.Get("https://shotsmith.dev/v1/take?access_key=YOUR_ACCESS_KEY&url=https%3A%2F%2Fshotsmith.dev%2Fsample&format=markdown")
if err != nil {
panic(err)
}
defer res.Body.Close()
if res.StatusCode != http.StatusOK {
body, _ := io.ReadAll(res.Body)
panic(string(body))
}
out, err := os.Create("capture.md")
if err != nil {
panic(err)
}
defer out.Close()
io.Copy(out, res.Body)
}
require "net/http"
require "uri"
uri = URI("https://shotsmith.dev/v1/take")
uri.query = URI.encode_www_form([
["access_key", "YOUR_ACCESS_KEY"],
["url", "https://shotsmith.dev/sample"],
["format", "markdown"]
])
res = Net::HTTP.get_response(uri)
raise res.body unless res.is_a?(Net::HTTPSuccess)
File.binwrite("capture.md", res.body)
import java.net.URI;
import java.net.http.HttpClient;
import java.net.http.HttpRequest;
import java.net.http.HttpResponse;
import java.nio.file.Path;
public class Capture {
public static void main(String[] args) throws Exception {
var client = HttpClient.newHttpClient();
var request = HttpRequest.newBuilder(URI.create(
"https://shotsmith.dev/v1/take?access_key=YOUR_ACCESS_KEY&url=https%3A%2F%2Fshotsmith.dev%2Fsample&format=markdown"
)).build();
var res = client.send(request, HttpResponse.BodyHandlers.ofFile(Path.of("capture.md")));
if (res.statusCode() != 200) {
throw new RuntimeException("HTTP " + res.statusCode());
}
}
}
using System;
using System.IO;
using System.Net.Http;
using var http = new HttpClient { Timeout = TimeSpan.FromSeconds(120) };
// Throws HttpRequestException on a 4xx/5xx response
var bytes = await http.GetByteArrayAsync(
"https://shotsmith.dev/v1/take?access_key=YOUR_ACCESS_KEY&url=https%3A%2F%2Fshotsmith.dev%2Fsample&format=markdown"
);
await File.WriteAllBytesAsync("capture.md", bytes);
Content-Type: text/markdown; charset=utf-8
X-Capture-Id: 01m8kvpk6jsmeykdfs0wy6awbn
X-Cache: MISS
X-Render-Time: 298
X-Quota-Limit: 15000
X-Quota-Remaining: 14998
X-RateLimit-Limit: 80
X-RateLimit-Remaining: 79
Spring sale: 20% off every plan this week Shotsmith sample page [Gallery](#gallery)[Features](#features)[Pricing](#pricing)[FAQ](#faq) Live capture # This page was rendered the moment you captured it. The clock shows the exact second this copy was rendered. Capture it again and the time changes: proof it’s a real, live render and not a cached picture. … ## Sample pricing Not real prices: just a section to capture on its own with `selector`. ### Solo $9 / month * 1 project * Email support …
Rendered HTML
format=html
returns the page’s HTML as it is after JavaScript has run, rather than the HTML the server first sent. Use it to scrape single-page apps or archive a page exactly as it appeared.
// npm install @shotsmith/sdk
import { Shotsmith, TakeOptions } from '@shotsmith/sdk';
import { writeFile } from 'node:fs/promises';
const shotsmith = new Shotsmith({
accessKey: 'YOUR_ACCESS_KEY',
});
const options = TakeOptions.url('https://shotsmith.dev/sample')
.format('html');
await writeFile('capture.html', await shotsmith.take(options));
<?php
// composer require shotsmith/shotsmith-php
require 'vendor/autoload.php';
use Shotsmith\Client;
use Shotsmith\Options\TakeOptions;
$shotsmith = new Client('YOUR_ACCESS_KEY');
$options = TakeOptions::url('https://shotsmith.dev/sample')
->format('html');
file_put_contents('capture.html', $shotsmith->take($options));
// In Laravel: Shotsmith::take($options) with SHOTSMITH_ACCESS_KEY in .env
curl -G "https://shotsmith.dev/v1/take" \ --data-urlencode "access_key=YOUR_ACCESS_KEY" \ --data-urlencode "url=https://shotsmith.dev/sample" \ --data-urlencode "format=html" \ -o capture.html
import { writeFile } from 'node:fs/promises';
const params = new URLSearchParams({
access_key: 'YOUR_ACCESS_KEY',
url: 'https://shotsmith.dev/sample',
format: 'html',
});
const res = await fetch(`https://shotsmith.dev/v1/take?${params}`);
if (!res.ok) throw new Error((await res.json()).error_message);
await writeFile('capture.html', Buffer.from(await res.arrayBuffer()));
import urllib.request
from urllib.parse import urlencode
params = {
"access_key": "YOUR_ACCESS_KEY",
"url": "https://shotsmith.dev/sample",
"format": "html"
}
url = "https://shotsmith.dev/v1/take?" + urlencode(params, doseq=True)
# Raises urllib.error.HTTPError on a 4xx/5xx response
with urllib.request.urlopen(url, timeout=120) as res, open("capture.html", "wb") as f:
f.write(res.read())
<?php
$query = http_build_query([
'access_key' => 'YOUR_ACCESS_KEY',
'url' => 'https://shotsmith.dev/sample',
'format' => 'html',
], '', '&', PHP_QUERY_RFC3986);
$ch = curl_init('https://shotsmith.dev/v1/take?' . $query);
curl_setopt_array($ch, [
CURLOPT_RETURNTRANSFER => true,
CURLOPT_TIMEOUT => 120,
]);
$body = curl_exec($ch);
$status = curl_getinfo($ch, CURLINFO_RESPONSE_CODE);
if ($status !== 200) {
throw new RuntimeException(json_decode($body, true)['error_message'] ?? "HTTP {$status}");
}
file_put_contents('capture.html', $body);
package main
import (
"io"
"net/http"
"os"
)
func main() {
res, err := http.Get("https://shotsmith.dev/v1/take?access_key=YOUR_ACCESS_KEY&url=https%3A%2F%2Fshotsmith.dev%2Fsample&format=html")
if err != nil {
panic(err)
}
defer res.Body.Close()
if res.StatusCode != http.StatusOK {
body, _ := io.ReadAll(res.Body)
panic(string(body))
}
out, err := os.Create("capture.html")
if err != nil {
panic(err)
}
defer out.Close()
io.Copy(out, res.Body)
}
require "net/http"
require "uri"
uri = URI("https://shotsmith.dev/v1/take")
uri.query = URI.encode_www_form([
["access_key", "YOUR_ACCESS_KEY"],
["url", "https://shotsmith.dev/sample"],
["format", "html"]
])
res = Net::HTTP.get_response(uri)
raise res.body unless res.is_a?(Net::HTTPSuccess)
File.binwrite("capture.html", res.body)
import java.net.URI;
import java.net.http.HttpClient;
import java.net.http.HttpRequest;
import java.net.http.HttpResponse;
import java.nio.file.Path;
public class Capture {
public static void main(String[] args) throws Exception {
var client = HttpClient.newHttpClient();
var request = HttpRequest.newBuilder(URI.create(
"https://shotsmith.dev/v1/take?access_key=YOUR_ACCESS_KEY&url=https%3A%2F%2Fshotsmith.dev%2Fsample&format=html"
)).build();
var res = client.send(request, HttpResponse.BodyHandlers.ofFile(Path.of("capture.html")));
if (res.statusCode() != 200) {
throw new RuntimeException("HTTP " + res.statusCode());
}
}
}
using System;
using System.IO;
using System.Net.Http;
using var http = new HttpClient { Timeout = TimeSpan.FromSeconds(120) };
// Throws HttpRequestException on a 4xx/5xx response
var bytes = await http.GetByteArrayAsync(
"https://shotsmith.dev/v1/take?access_key=YOUR_ACCESS_KEY&url=https%3A%2F%2Fshotsmith.dev%2Fsample&format=html"
);
await File.WriteAllBytesAsync("capture.html", bytes);
Content-Type: text/html; charset=utf-8
X-Capture-Id: 01m8kvpk6jsmeykdfs0wy6awbn
X-Cache: MISS
X-Render-Time: 308
X-Quota-Limit: 15000
X-Quota-Remaining: 14998
X-RateLimit-Limit: 80
X-RateLimit-Remaining: 79
<!DOCTYPE html><html lang="en"><head> <title>Sample page — Shotsmith</title><style>…</style> </head><body> … <h1>This page was rendered the moment you captured it.</h1> … <div class="time" id="render-time">14:35:16</div> … <!-- Filled in by the page’s JavaScript, so it only appears in rendered HTML: --> <dd id="fact-viewport">1280 × 1024</dd> … </body></html>
Web components often keep their content in a shadow root, which ordinary HTML doesn’t include. Add include_shadow_dom=true
to inline it.
Content and metadata with a screenshot
To get a screenshot and the page’s details from one request, ask for JSON and the metadata you want. metadata_content
adds the page content, in Markdown with metadata_content_format=markdown
, or HTML by default.
import { Shotsmith } from '@shotsmith/sdk';
const shotsmith = new Shotsmith({ accessKey: 'YOUR_ACCESS_KEY' });
const result = await shotsmith.takeJson({
url: 'https://shotsmith.dev/sample',
metadata_page_title: true,
metadata_open_graph: true,
metadata_http_response_status_code: true,
metadata_content: true,
metadata_content_format: 'markdown',
});
console.log(result.metadata);
<?php
require 'vendor/autoload.php';
use Shotsmith\Client;
$shotsmith = new Client('YOUR_ACCESS_KEY');
$result = $shotsmith->takeJson([
'url' => 'https://shotsmith.dev/sample',
'metadata_page_title' => true,
'metadata_open_graph' => true,
'metadata_http_response_status_code' => true,
'metadata_content' => true,
'metadata_content_format' => 'markdown',
]);
echo $result['metadata'];
curl -X POST "https://shotsmith.dev/v1/take" \
-H "X-Access-Key: YOUR_ACCESS_KEY" \
-H "Content-Type: application/json" \
-d '{
"url": "https://shotsmith.dev/sample",
"metadata_page_title": true,
"metadata_open_graph": true,
"metadata_http_response_status_code": true,
"metadata_content": true,
"metadata_content_format": "markdown",
"response_type": "json"
}'
const res = await fetch('https://shotsmith.dev/v1/take', {
method: 'POST',
headers: {
'X-Access-Key': 'YOUR_ACCESS_KEY',
'Content-Type': 'application/json',
},
body: JSON.stringify({
url: 'https://shotsmith.dev/sample',
metadata_page_title: true,
metadata_open_graph: true,
metadata_http_response_status_code: true,
metadata_content: true,
metadata_content_format: 'markdown',
response_type: 'json',
}),
});
if (!res.ok) throw new Error((await res.json()).error_message);
console.log(await res.json());
import json
import urllib.request
body = {
"url": "https://shotsmith.dev/sample",
"metadata_page_title": True,
"metadata_open_graph": True,
"metadata_http_response_status_code": True,
"metadata_content": True,
"metadata_content_format": "markdown",
"response_type": "json"
}
req = urllib.request.Request(
"https://shotsmith.dev/v1/take",
data=json.dumps(body).encode(),
headers={"X-Access-Key": "YOUR_ACCESS_KEY", "Content-Type": "application/json"},
method="POST",
)
# Raises urllib.error.HTTPError on a 4xx/5xx response
with urllib.request.urlopen(req, timeout=60) as res:
print(json.load(res))
<?php
$ch = curl_init('https://shotsmith.dev/v1/take');
curl_setopt_array($ch, [
CURLOPT_POST => true,
CURLOPT_HTTPHEADER => ['X-Access-Key: YOUR_ACCESS_KEY', 'Content-Type: application/json'],
CURLOPT_POSTFIELDS => json_encode([
'url' => 'https://shotsmith.dev/sample',
'metadata_page_title' => true,
'metadata_open_graph' => true,
'metadata_http_response_status_code' => true,
'metadata_content' => true,
'metadata_content_format' => 'markdown',
'response_type' => 'json',
]),
CURLOPT_RETURNTRANSFER => true,
CURLOPT_TIMEOUT => 60,
]);
$response = json_decode(curl_exec($ch), true);
if (curl_getinfo($ch, CURLINFO_RESPONSE_CODE) >= 400) {
throw new RuntimeException($response['error_message']);
}
print_r($response);
package main
import (
"fmt"
"io"
"net/http"
"strings"
)
func main() {
body := strings.NewReader(`{
"url": "https://shotsmith.dev/sample",
"metadata_page_title": true,
"metadata_open_graph": true,
"metadata_http_response_status_code": true,
"metadata_content": true,
"metadata_content_format": "markdown",
"response_type": "json"
}`)
req, _ := http.NewRequest("POST", "https://shotsmith.dev/v1/take", body)
req.Header.Set("X-Access-Key", "YOUR_ACCESS_KEY")
req.Header.Set("Content-Type", "application/json")
res, err := http.DefaultClient.Do(req)
if err != nil {
panic(err)
}
defer res.Body.Close()
out, _ := io.ReadAll(res.Body)
fmt.Println(string(out))
}
require "net/http"
require "json"
body = {
"url" => "https://shotsmith.dev/sample",
"metadata_page_title" => true,
"metadata_open_graph" => true,
"metadata_http_response_status_code" => true,
"metadata_content" => true,
"metadata_content_format" => "markdown",
"response_type" => "json"
}
res = Net::HTTP.post(
URI("https://shotsmith.dev/v1/take"),
body.to_json,
"X-Access-Key" => "YOUR_ACCESS_KEY",
"Content-Type" => "application/json"
)
raise res.body unless res.is_a?(Net::HTTPSuccess)
puts JSON.parse(res.body)
import java.net.URI;
import java.net.http.HttpClient;
import java.net.http.HttpRequest;
import java.net.http.HttpResponse;
public class Request {
public static void main(String[] args) throws Exception {
var body = """
{
"url": "https://shotsmith.dev/sample",
"metadata_page_title": true,
"metadata_open_graph": true,
"metadata_http_response_status_code": true,
"metadata_content": true,
"metadata_content_format": "markdown",
"response_type": "json"
}
""";
var request = HttpRequest.newBuilder(URI.create("https://shotsmith.dev/v1/take"))
.header("X-Access-Key", "YOUR_ACCESS_KEY")
.header("Content-Type", "application/json")
.POST(HttpRequest.BodyPublishers.ofString(body))
.build();
var res = HttpClient.newHttpClient().send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(res.body());
}
}
using System;
using System.Net.Http;
using System.Text;
using var http = new HttpClient();
http.DefaultRequestHeaders.Add("X-Access-Key", "YOUR_ACCESS_KEY");
var body = """
{
"url": "https://shotsmith.dev/sample",
"metadata_page_title": true,
"metadata_open_graph": true,
"metadata_http_response_status_code": true,
"metadata_content": true,
"metadata_content_format": "markdown",
"response_type": "json"
}
""";
var res = await http.PostAsync(
"https://shotsmith.dev/v1/take",
new StringContent(body, Encoding.UTF8, "application/json")
);
res.EnsureSuccessStatusCode();
Console.WriteLine(await res.Content.ReadAsStringAsync());
Content-Type: application/json
X-Capture-Id: 01m8kvpk6jsmeykdfs0wy6awbn
X-Cache: MISS
X-Render-Time: 181
X-Quota-Limit: 15000
X-Quota-Remaining: 14998
X-RateLimit-Limit: 80
X-RateLimit-Remaining: 79
{
"is_successful": true,
"id": "01m8kvpk6jsmeykdfs0wy6awbn",
"kind": "screenshot",
"status": "succeeded",
"source": "api",
"url": "https://shotsmith.dev/sample",
"format": "jpg",
"cache_hit": false,
"file_url": "https://shotsmith.dev/files/01m8kvpk6jsmeykdfs0wy6awbn.jpg?expires=1796049316&signature=e98b5de4…",
"slices": null,
"content_type": "image/jpeg",
"bytes": 110201,
"width": 1280,
"height": 1024,
"duration_ms": 181,
"metadata": {
"page_title": "Sample page — Shotsmith",
"open_graph": {
"og:title": "Shotsmith sample page",
"og:description": "Rendered live at 14:35:16 UTC. Capture it with any Shotsmith option.",
"og:image": "https://shotsmith.dev/og/default.png",
"og:type": "website"
},
"http_response_status_code": 200,
"content": "Spring sale: 20% off every plan this week\n\nShotsmith sample page\n\n…\n\n# This page was rendered the moment you captured it.\n\n…",
"blocked": {
"ads": 0,
"trackers": 0,
"cookies": 0,
"chats": 0,
"custom": 0,
"resources": 0
},
"image_size": { "width": 1280, "height": 1024 }
},
"vision": null,
"store": null,
"external_identifier": null,
"error": null,
"created_at": "2026-11-29T14:35:16+00:00",
"completed_at": "2026-11-29T14:35:16+00:00",
"cache_url": "https://shotsmith.dev/files/01m8kvpk6jsmeykdfs0wy6awbn.jpg?expires=1796049316&signature=e98b5de4…"
}
Other metadata: metadata_icon
(favicon), metadata_fonts
(font families used), metadata_http_response_headers
and metadata_image_size
. blocked counts what was removed and is always included.