URL to screenshot with metadata. Python MCP server included. Claude Vision optimized.
Project description
Snapgrab
URL to screenshot with metadata. Claude Vision optimized.
from snapgrab import capture
result = await capture("https://example.com")
print(result.path) # /tmp/snapgrab/example_com_desktop_20260317_120000.png
print(result.metadata.title) # "Example Domain"
print(result.vision_tokens) # ~2764
Features
- Screenshot capture — PNG, JPEG, PDF with full-page support
- Page metadata — title, description, Open Graph tags, favicon, HTTP status
- Claude Vision optimized — auto-resize to 1568px, token cost estimation
- Viewport presets — desktop (1920x1080), tablet (768x1024), mobile (375x812)
- MCP server included — 3 tools for Claude Code / MCP clients
- Element capture — screenshot specific CSS selectors
- Dark mode — force light/dark color scheme
Install
pip install snapgrab
First run will prompt to install Playwright browsers:
playwright install chromium
Usage
Python API
import asyncio
from snapgrab import capture
async def main():
# Basic screenshot
result = await capture("https://example.com")
# Mobile viewport, full page
result = await capture("https://example.com", viewport="mobile", full_page=True)
# Dark mode, JPEG format
result = await capture("https://example.com", dark_mode=True, format="jpeg")
# Specific element
result = await capture("https://example.com", selector="#main-content")
# Custom viewport
result = await capture("https://example.com", viewport=(1440, 900))
asyncio.run(main())
CLI
snapgrab https://example.com # basic PNG
snapgrab https://example.com -v mobile -f # mobile, full page
snapgrab https://example.com --format jpeg -q 90 # JPEG quality 90
snapgrab https://example.com -s "#hero" --dark-mode # element + dark mode
snapgrab https://example.com -j # JSON output
snapgrab meta https://example.com # metadata only
MCP Server
pip install "snapgrab[mcp]"
snapgrab-mcp # starts stdio MCP server
Tools:
capture_screenshot— capture URL with metadata and vision token estimatecapture_comparison— compare desktop vs mobile (or any viewports)extract_page_metadata— metadata only, no screenshot
CaptureResult
result.path # saved file path
result.format # "png", "jpeg", "pdf"
result.width # viewport width
result.height # page height (full_page) or viewport height
result.file_size # bytes
result.vision_tokens # estimated Claude Vision token cost
result.vision_path # path to Vision-optimized image (≤1568px)
result.processing_time_ms
result.metadata.title
result.metadata.description
result.metadata.og_title
result.metadata.og_image
result.metadata.favicon_url
result.metadata.status_code
result.metadata.url # final URL after redirects
License
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file snapgrab-0.1.1.tar.gz.
File metadata
- Download URL: snapgrab-0.1.1.tar.gz
- Upload date:
- Size: 11.6 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
8a33b1ffabe0787189dc0beb99c5577680b3dc738ddc9221340affa2c0875eb1
|
|
| MD5 |
4c5da87833b3eaa53801e08dad7ba49c
|
|
| BLAKE2b-256 |
3eb37dbbf22cfc8f58734f09a85ee62a9e74bbd95c17699c40009ab31f207f84
|
Provenance
The following attestation bundles were made for snapgrab-0.1.1.tar.gz:
Publisher:
publish.yml on QuartzUnit/snapgrab
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
snapgrab-0.1.1.tar.gz -
Subject digest:
8a33b1ffabe0787189dc0beb99c5577680b3dc738ddc9221340affa2c0875eb1 - Sigstore transparency entry: 1178845939
- Sigstore integration time:
-
Permalink:
QuartzUnit/snapgrab@691fadbcb21659e871715c83457eb3f972c62bb3 -
Branch / Tag:
refs/heads/main - Owner: https://github.com/QuartzUnit
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@691fadbcb21659e871715c83457eb3f972c62bb3 -
Trigger Event:
workflow_dispatch
-
Statement type:
File details
Details for the file snapgrab-0.1.1-py3-none-any.whl.
File metadata
- Download URL: snapgrab-0.1.1-py3-none-any.whl
- Upload date:
- Size: 12.8 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
9441530cf3fa39435b3cd66039a3938d2a2c08466bec654e2660a73ca5c35cae
|
|
| MD5 |
bf2154be6fb7e3d8f78e6c6ba320d096
|
|
| BLAKE2b-256 |
5e01891e12d0c19e3091b23f05707f2839adb8135d6710c30b4835fa6c357912
|
Provenance
The following attestation bundles were made for snapgrab-0.1.1-py3-none-any.whl:
Publisher:
publish.yml on QuartzUnit/snapgrab
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
snapgrab-0.1.1-py3-none-any.whl -
Subject digest:
9441530cf3fa39435b3cd66039a3938d2a2c08466bec654e2660a73ca5c35cae - Sigstore transparency entry: 1178845959
- Sigstore integration time:
-
Permalink:
QuartzUnit/snapgrab@691fadbcb21659e871715c83457eb3f972c62bb3 -
Branch / Tag:
refs/heads/main - Owner: https://github.com/QuartzUnit
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@691fadbcb21659e871715c83457eb3f972c62bb3 -
Trigger Event:
workflow_dispatch
-
Statement type: