Skip to content
shotsmith
Features Docs Guides Pricing Changelog Sign inStart free

Turn any web page into clean Markdown for LLMs and RAG

Feed web pages to language models as clean Markdown, rendered after JavaScript runs, without menus, ads or cookie banners.

10 min read

Feeding a web page to a language model sounds simple: fetch the HTML and paste it in. In practice, raw HTML is mostly scripts, styles, navigation and tracking markup, which wastes tokens and buries the content. On modern sites, the content often isn’t in the HTML at all until JavaScript runs. And sometimes all you get is a cookie wall.

shotsmith loads the page in real Chrome, waits for it to render, removes banners and overlays, and returns just the readable content as Markdown.

Get a page as Markdown

// 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')
  .blockCookieBanners();

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')
    ->blockCookieBanners();

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" \
  --data-urlencode "block_cookie_banners=true" \
  -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',
  block_cookie_banners: 'true',
});

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",
    "block_cookie_banners": "true"
}

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',
    'block_cookie_banners' => 'true',
], '', '&', 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&block_cookie_banners=true")
	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"],
  ["block_cookie_banners", "true"]
])

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&block_cookie_banners=true"
        )).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&block_cookie_banners=true"
);

await File.WriteAllBytesAsync("capture.md", bytes);
Response 200 OK
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

…

Why Markdown rather than HTML

  • Far fewer tokens. Headings, lists, links and tables survive; scripts, class names and layout markup don’t. A typical article page shrinks dramatically, which means lower costs and more room in the context window.
  • Structure the model understands. LLMs are trained on huge amounts of Markdown, so headings and lists carry meaning the model already knows how to use.
  • Rendered, not raw. Content added by JavaScript, as on single-page apps, is included, because the page is captured after it runs.

Content and a screenshot in one request

For multimodal models, or to keep a visual record, ask for JSON with metadata_content=true. You get a screenshot URL, the page title, Open Graph data, the HTTP status and the content as Markdown, all from a single render:

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_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_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_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_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_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_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_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_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_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_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());

Building a RAG pipeline

  1. Collect URLs from your sitemap, a crawl, or a list of sources.
  2. Fetch each as Markdown. For large batches, use bulk requests (up to 100 URLs per call) with a webhook, and cache=true so re-runs within your cache window are free.
  3. Chunk by heading. Markdown headings are natural chunk boundaries, so each chunk stays on one topic.
  4. Embed and store the chunks with the source URL and the capture date, so answers can cite where they came from.
  5. Refresh on change. Instead of re-crawling everything, set monitors on the pages that matter, and re-index only when they change.

Tips

  • Pages behind a login? Send cookies or an authorization header with the request.
  • Content inside web components? Add include_shadow_dom=true to include shadow roots in HTML output and in metadata_content.
  • A site blocking automated browsers? Stealth mode handles most bot checks.
  • Building an agent rather than a pipeline? The MCP server lets it fetch pages itself.