getsnap
Official Python SDK for getSnap.dev — Screenshot & PDF API.
Zero dependencies. Uses only Python's standard library (urllib).
Installation
pip install getsnap
Quick Start
from getsnap import GetSnap
snap = GetSnap("sk_live_YOUR_KEY")
# Take a screenshot
result = snap.screenshot(url="https://github.com", format="png")
print(result["url"]) # CDN URL to your screenshot
Features
- Zero external dependencies (uses
urllib) - Python 3.8+
- Screenshot capture (URL or HTML)
- Binary response (raw image bytes)
- Batch capture (up to 100 URLs)
- Usage tracking
- All API parameters supported:
lazy_load,wait_for_selector,hide_selectors,remove_selectors,extract_text,extract_html,click_selector,scroll_to_selector, and more
API
GetSnap(api_key, base_url=None)
Create a client instance.
api_key— Your getSnap.dev key (starts withsk_live_orsk_test_)base_url— Custom base URL (default:https://api.getsnap.dev)
snap.screenshot(**kwargs)
Take a screenshot. Returns a dict with url, cached, request_id, and optionally extracted_text/extracted_html.
result = snap.screenshot(
url="https://example.com",
format="png",
full_page=True,
remove_popups=True,
lazy_load=True,
extract_text=True,
)
print(result["url"])
print(result["extracted_text"])
snap.screenshot_binary(**kwargs)
Get raw image/PDF bytes.
data = snap.screenshot_binary(url="https://example.com", format="webp", quality=90)
with open("screenshot.webp", "wb") as f:
f.write(data)
snap.batch(urls, **kwargs)
Capture multiple URLs in one request.
result = snap.batch(
urls=["https://github.com", "https://stripe.com", "https://vercel.com"],
format="png",
remove_popups=True,
)
print(f"{result['succeeded']}/{result['count']} captured")
for r in result["results"]:
print(f"{r['source_url']} -> {r['url']}")
snap.usage()
Check current usage and quota.
usage = snap.usage()
print(f"{usage['used']}/{usage['limit']} ({usage['plan']})")
snap.status(request_id)
Check status of an async (webhook) request.
status = snap.status("req_abc123")
Error Handling
from getsnap import GetSnap, GetSnapError
snap = GetSnap("sk_live_YOUR_KEY")
try:
snap.screenshot(url="https://example.com", format="png")
except GetSnapError as e:
print(e.status, e.error, str(e))
# 402, "quota_exceeded", "Monthly limit reached..."
License
MIT
Metadata
Release files for getsnap 1.5.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| getsnap-1.5.0.tar.gz | 6.6 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| getsnap-1.5.0-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 13.4 kB
Release files / getsnap-1.5.0.tar.gz
| Download URL | getsnap-1.5.0.tar.gz |
|---|---|
| Size | 6.6 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
cd7a841edc5368d6cb590c1fa0371e321099c799f1a8868512ba64a832ded157
|
|
BLAKE2b-256 checksum How to use checksums |
1764e4cf8926dfc2b2fcb00fbc9cb26a25a9b4848cf02127802496f8de5e62d5
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/7.0.0 CPython/3.12.14
|
Release files / getsnap-1.5.0-py3-none-any.whl
| Download URL | getsnap-1.5.0-py3-none-any.whl |
|---|---|
| Size | 6.8 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
e2061f330d7128cebd35a190823aa901dc82f1c4db9d4ce16ee00559b06c9dcc
|
|
BLAKE2b-256 checksum How to use checksums |
67d63e7f02b5715f47caa58c43f11fbd2127b5eb44cc3546c35f4abaedf48c68
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/7.0.0 CPython/3.12.14
|