No PuppeteerSharp download, no wkhtmltopdf wrapper and no PDF library license. One HttpClient call returns PNG or PDF bytes, from ASP.NET Core, a worker service or an Azure Function.
Click Get free key. You get 25 free renders a month instantly, no account needed. Store the key in an environment variable called SHOTMINT_KEY.
var key = Environment.GetEnvironmentVariable("SHOTMINT_KEY");
using var http = new HttpClient { Timeout = TimeSpan.FromSeconds(90) };
http.DefaultRequestHeaders.Add("X-API-Key", key);
var target = Uri.EscapeDataString("https://example.com");
var res = await http.GetAsync($"https://shotmint.creasework.com/v1/screenshot?url={target}&full_page=true");
if (!res.IsSuccessStatusCode)
throw new Exception($"Render failed ({(int)res.StatusCode}): {await res.Content.ReadAsStringAsync()}");
await File.WriteAllBytesAsync("shot.png", await res.Content.ReadAsByteArrayAsync());
Console.WriteLine($"Saved shot.png, credits left: {res.Headers.GetValues("X-Credits-Remaining").First()}");
Useful parameters: full_page=true for the whole scrollable page, width/height for the viewport, device_scale_factor=2 for retina, selector to capture a single element, dark_mode=true, and hide_selectors to remove cookie banners. See the full list.
using System.Text;
using System.Text.Json.Nodes;
// same HttpClient as above
var body = new JsonObject { ["html"] = "<h1>Invoice #42</h1>", ["format"] = "A4" }.ToJsonString();
var res = await http.PostAsync("https://shotmint.creasework.com/v1/pdf", new StringContent(body, Encoding.UTF8, "application/json"));
res.EnsureSuccessStatusCode();
await File.WriteAllBytesAsync("invoice.pdf", await res.Content.ReadAsByteArrayAsync());
// ASP.NET Core minimal API: stream it straight to the browser
// return Results.File(await res.Content.ReadAsStreamAsync(), "application/pdf", "invoice.pdf");
PDF options include format (A4, Letter…), landscape, margin, and print_background. You can pass a url instead of html.
A failed render never costs a credit. Status 400 means bad input or an unreachable URL, 402 means you're out of credits, and 429/503 mean you should retry with backoff. Every successful response includes an X-Credits-Remaining header, and screenshots and PDFs of a URL also carry X-Page-Status: the HTTP status the site answered with. A 403 there usually means you captured the site's bot-protection page, a 404 its error page.
Register one HttpClient (or use IHttpClientFactory) instead of creating one per request, and keep the timeout at 60 seconds or more for full-page captures. JsonObject escapes your HTML for you, so you can pass a Razor-rendered string as html, and unlike reflection-based serialization it also works in trimmed and Native AOT builds. The first example runs as-is as a .NET 10 file-based app (dotnet run shot.cs) or in any console project.
The quickstart above stops at the first error. In production you want three more things: retry only the failures that can fix themselves (503 when the renderer is busy, network timeouts), never retry a 400 or 402, and warn when the site itself answered with an error page. This script does all three for screenshots and PDFs, and prints the credits left after each call:
using System.Net;
using System.Text;
using System.Text.Json.Nodes;
var api = "https://shotmint.creasework.com";
using var http = new HttpClient { Timeout = TimeSpan.FromSeconds(90) };
http.DefaultRequestHeaders.Add("X-API-Key", Environment.GetEnvironmentVariable("SHOTMINT_KEY"));
// Retries only what is worth retrying: 503 (renderer busy) and network timeouts.
// A 400 (bad input, unreachable site) or 402 (no credits) will not fix itself.
async Task<byte[]> Render(string path, JsonObject body, int attempts = 3)
{
for (var i = 0; i < attempts; i++)
{
if (i > 0) await Task.Delay(TimeSpan.FromSeconds(Math.Pow(2, i - 1)));
HttpResponseMessage res;
try
{
res = await http.PostAsync(api + path, new StringContent(body.ToJsonString(), Encoding.UTF8, "application/json"));
}
catch (Exception e) when (e is HttpRequestException or TaskCanceledException)
{
if (i == attempts - 1) throw;
continue;
}
using (res)
{
if (res.IsSuccessStatusCode)
{
if (res.Headers.TryGetValues("X-Page-Status", out var page) && int.Parse(page.First()) >= 400)
Console.Error.WriteLine($"site answered {page.First()}: you may have captured an error or bot page");
if (res.Headers.TryGetValues("X-Credits-Remaining", out var credits))
Console.Error.WriteLine($"credits left: {credits.First()}");
return await res.Content.ReadAsByteArrayAsync();
}
if (res.StatusCode != HttpStatusCode.ServiceUnavailable)
{
var text = await res.Content.ReadAsStringAsync();
string msg;
try { msg = JsonNode.Parse(text)?["error"]?.ToString() ?? text; } catch { msg = text; }
throw new HttpRequestException($"{(int)res.StatusCode}: {msg}", null, res.StatusCode);
}
}
}
throw new HttpRequestException($"renderer still busy after {attempts} attempts");
}
await File.WriteAllBytesAsync("shot.png", await Render("/v1/screenshot",
new JsonObject { ["url"] = "https://en.wikipedia.org/wiki/C_Sharp_(programming_language)", ["full_page"] = true, ["format"] = "png" }));
await File.WriteAllBytesAsync("page.pdf", await Render("/v1/pdf",
new JsonObject { ["url"] = "https://example.com", ["format"] = "A4" }));HttpClient's default timeout is 100 s and covers the whole request, so 90 s here is a deliberate choice; a timeout surfaces as TaskCanceledException, not HttpRequestException, which is why both are caught. Build the body with JsonObject and send it as StringContent: PostAsJsonAsync needs reflection-based JSON, which .NET 10 file-based apps (dotnet run render.cs) and trimmed or AOT builds switch off, and it threw on our first run. In ASP.NET Core, register one client with AddHttpClient instead of creating it per request.
Timing, measured on 2026-10-25: a full-page capture of a long Wikipedia article plus an A4 PDF took 8.5 to 25 s end to end, so keep the read timeout well above 30 s. Full-page captures are capped at 16,000 px tall (the Go and PHP articles hit that cap). With a format the API doesn't support, the script stops at once with the API's own message: 400: format must be png, jpeg or webp (got "gif").
No signup, no card. Get a key in one click, then buy credits only if you need more (from €5 for 2,000, never expire). From a script, an AI agent, Make or Zapier, POST /v1/keys/free (no body) returns a key as JSON (openapi.json, no-code recipes).
All guides: guides · integrations · comparisons