{
  "markdown": "# Snapgrab\n\n[![PyPI](https://img.shields.io/pypi/v/snapgrab)](https://pypi.org/project/snapgrab/)\n[![Python](https://img.shields.io/pypi/pyversions/snapgrab)](https://pypi.org/project/snapgrab/)\n[![License](https://img.shields.io/github/license/QuartzUnit/snapgrab)](https://github.com/QuartzUnit/snapgrab/blob/main/LICENSE)\n[![Tests](https://img.shields.io/badge/tests-29%20passed-brightgreen)]()\n\n> [한국어 문서](README.ko.md) · [llms.txt](llms.txt)\n\n> URL to screenshot with metadata. Claude Vision optimized.\n\n```python\nfrom snapgrab import capture\n\nresult = await capture(\"https://example.com\")\nprint(result.path)           # /tmp/snapgrab/example_com_desktop_20260317_120000.png\nprint(result.metadata.title) # \"Example Domain\"\nprint(result.vision_tokens)  # ~2764\n```\n\n## Features\n\n- **Screenshot capture** — PNG, JPEG, PDF with full-page support\n- **Page metadata** — title, description, Open Graph tags, favicon, HTTP status\n- **Claude Vision optimized** — auto-resize to 1568px, token cost estimation\n- **Viewport presets** — desktop (1920x1080), tablet (768x1024), mobile (375x812)\n- **MCP server included** — 3 tools for Claude Code / MCP clients\n- **Element capture** — screenshot specific CSS selectors\n- **Dark mode** — force light/dark color scheme\n\n## Install\n\n```bash\npip install snapgrab\n```\n\nFirst run will prompt to install Playwright browsers:\n```bash\nplaywright install chromium\n```\n\n## Usage\n\n### Python API\n\n```python\nimport asyncio\nfrom snapgrab import capture\n\nasync def main():\n    # Basic screenshot\n    result = await capture(\"https://example.com\")\n\n    # Mobile viewport, full page\n    result = await capture(\"https://example.com\", viewport=\"mobile\", full_page=True)\n\n    # Dark mode, JPEG format\n    result = await capture(\"https://example.com\", dark_mode=True, format=\"jpeg\")\n\n    # Specific element\n    result = await capture(\"https://example.com\", selector=\"#main-content\")\n\n    # Custom viewport\n    result = await capture(\"https://example.com\", viewport=(1440, 900))\n\nasyncio.run(main())\n```\n\n### CLI\n\n```bash\nsnapgrab https://example.com                          # basic PNG\nsnapgrab https://example.com -v mobile -f             # mobile, full page\nsnapgrab https://example.com --format jpeg -q 90      # JPEG quality 90\nsnapgrab https://example.com -s \"#hero\" --dark-mode   # element + dark mode\nsnapgrab https://example.com -j                       # JSON output\nsnapgrab meta https://example.com                     # metadata only\n```\n\n### MCP Server\n\n```bash\npip install \"snapgrab[mcp]\"\nsnapgrab-mcp  # starts stdio MCP server\n```\n\n**Tools:**\n- `capture_screenshot` — capture URL with metadata and vision token estimate\n- `capture_comparison` — compare desktop vs mobile (or any viewports)\n- `extract_page_metadata` — metadata only, no screenshot\n\n## How It Works\n\n```mermaid\nflowchart LR\n    A[\"🔗 URL\"] --> B[\"Playwright\\nlaunch browser\"]\n    B --> C[\"📸 Screenshot\\nfull page / viewport\"]\n    C --> D[\"Resize for\\nClaude Vision\"]\n    D --> E[\"✅ Image +\\nMetadata\"]\n```\n\n## CaptureResult\n\n```python\nresult.path            # saved file path\nresult.format          # \"png\", \"jpeg\", \"pdf\"\nresult.width           # viewport width\nresult.height          # page height (full_page) or viewport height\nresult.file_size       # bytes\nresult.vision_tokens   # estimated Claude Vision token cost\nresult.vision_path     # path to Vision-optimized image (≤1568px)\nresult.processing_time_ms\nresult.metadata.title\nresult.metadata.description\nresult.metadata.og_title\nresult.metadata.og_image\nresult.metadata.favicon_url\nresult.metadata.status_code\nresult.metadata.url    # final URL after redirects\n```\n\n## Used in\n\n- [watchdeck](https://github.com/QuartzUnit/watchdeck) — Web page monitoring with visual diffs and safety guards\n\n## License\n\n[MIT](LICENSE)\n\n<!-- mcp-name: io.github.QuartzUnit/snapgrab -->\n\n\n---\n\n<sub>Part of the [QuartzUnit](https://github.com/QuartzUnit) ecosystem — composable Python libraries for data collection, extraction, search, and AI agent safety.</sub>\n",
  "bytes": 4007,
  "sha": "edf63f1a97fac41080e523af37ca30e1e0749527f471d2f912e81fc776a44c34",
  "repo_slug": "quartzunit/snapgrab",
  "fonte": "repo",
  "truncated": false,
  "api": "https://agentalog.com/api/listings/mcp_io_github_arknill_snapgrab_ca0c1916/readme"
}