Changelog
This changelog is generated automatically from GitHub Releases.
v0.1.0
2026-06-08 · GitHub
Initial release — Capture screenshots and PDFs from web pages using headless Chrome via CDP.
Highlights
nokap gives you high-quality screenshots and PDFs from any URL, local HTML file, or raw HTML string. It auto-discovers Chrome, manages the browser lifecycle, and produces pixel-perfect output with a simple two-argument API: nokap.webshot(url, file).
Core Features
- Screenshot capture in PNG, JPEG, and WebP formats with configurable viewport and zoom
- PDF generation — full-page PDFs with standard paper sizes, or element-bounded vector PDFs sized exactly to content
- CSS selector targeting — crop to any element’s bounding box with optional padding
- Auto-detection of wide elements — tables and other intrinsically-wide content render at their natural width without clipping
- High-DPI output via zoom factor (2x, 3x) for Retina-quality images
- Raw HTML rendering with from_html() — ideal for capturing output from Great Tables, Plotly, or custom templates
- Automatic browser management — Chrome starts on first use, stays alive across captures, cleans up at exit
Python API
| Function | Description |
|---|---|
nokap.webshot(url, file) |
Capture a URL or local file as an image or PDF |
nokap.from_html(html, file) |
Render an HTML string to an image or PDF |
| nokap.close() | Explicitly close the browser (automatic at exit) |
| nokap.find_chrome() | Locate the Chrome/Chromium binary |
CLI Commands
| Command | Description |
|---|---|
nokap webshot |
Capture a URL or local file as an image or PDF |
nokap from-html |
Render an HTML file to an image or PDF |
nokap batch |
Process multiple capture jobs from a JSON manifest |
nokap doctor |
Run full diagnostics (browser check + test capture) |
nokap info |
Display system info and browser availability |
MCP Server
nokap ships an MCP (Model Context Protocol) server for AI agent integration. Install with pip install nokap[mcp] and connect from Claude, Copilot, Cursor, or any MCP-compatible client.
| Tool | Description |
|---|---|
screenshot_url |
Capture a screenshot from a URL or local file |
screenshot_html |
Capture a screenshot from a raw HTML string |
generate_pdf |
Generate a full-page or element-bounded PDF |
doctor |
Verify system readiness |
Agent Skills
Four published skills provide structured context for AI coding agents:
nokap: Primary skill with decision table, API overview, and gotchasnokap-web-capture: Capturing from live URLsnokap-html-capture: Rendering HTML strings and local filesnokap-pdf: PDF generation and paper configuration
Install with great-docs skill install nokap or npx skills add https://posit-dev.github.io/nokap/.
Error Handling
A structured exception hierarchy with specific error types: ChromeNotFoundError, ChromeStartError, NavigationError, PageLoadTimeout, SelectorError, and CDPError: all inheriting from NokapError.
Requirements
- Python >= 3.10
- Chrome or Chromium (must be installed separately; set
CHROME_PATHif not in a standard location)