Skip to content

Latest commit

History

4 Commits

Folders and files

NameName
Last commit message
Last commit date

Repository files navigation

GrabShot - Website Screenshot API for Python

Capture website screenshots with a single API call. No headless browser setup, no Puppeteer, no Selenium. Just pip install grabshot and go.

Quick Start

pip install grabshot
fromgrabshotimportGrabShotclient=GrabShot("your-api-key") # Free at https://grabshot.devscreenshot=client.capture("https://example.com")
screenshot.save("example.png")

Get your free API key at grabshot.dev - 25 screenshots/month on the free plan, no credit card required.

Features

  • One line of code to capture any URL
  • Full-page screenshots - capture the entire scrollable page
  • Device frames - wrap screenshots in iPhone, MacBook, etc.
  • Dark mode - capture sites in dark mode
  • Element capture - screenshot a specific CSS selector
  • Multiple formats - PNG, JPEG, WebP
  • Cookie banner removal - auto-dismiss cookie popups
  • Ad blocking - clean screenshots without ads
  • PDF conversion - convert any URL to PDF
  • Meta extraction - pull Open Graph, Twitter Card, and meta tags
  • Zero dependencies - uses only Python standard library

Examples

Full-page screenshot

screenshot=client.capture(
"https://example.com",
full_page=True
)
screenshot.save("full-page.png")

Mobile screenshot with device frame

screenshot=client.capture(
"https://example.com",
width=390,
height=844,
device_frame="iphone"
)
screenshot.save("mobile.png")

Dark mode JPEG

screenshot=client.capture(
"https://example.com",
format="jpeg",
quality=85,
dark_mode=True
)
screenshot.save("dark.jpg")

Capture specific element

screenshot=client.capture(
"https://example.com",
selector="#hero-section"
)
screenshot.save("hero.png")

Clean screenshot (no ads, no cookie banners)

screenshot=client.capture(
"https://example.com",
hide_cookie_banners=True,
block_ads=True
)
screenshot.save("clean.png")

Convert URL to PDF

pdf_bytes=client.pdf("https://example.com", format="A4")
withopen("page.pdf", "wb") asf:
f.write(pdf_bytes)

Extract meta tags

meta=client.meta("https://example.com")
print(meta["title"])
print(meta["og:image"])

API Reference

GrabShot(api_key, base_url="https://grabshot.dev", timeout=30)

Create a client instance.

client.capture(url, **options) -> Screenshot

ParameterTypeDefaultDescription
urlstrrequiredURL to capture
widthint1280Viewport width (px)
heightint800Viewport height (px)
full_pageboolFalseCapture full scrollable page
formatstr"png""png", "jpeg", or "webp"
qualityintautoJPEG/WebP quality (1-100)
delayintNoneWait before capture (ms)
device_framestrNone"iphone", "macbook", etc.
dark_modeboolFalseEnable dark mode
hide_cookie_bannersboolFalseRemove cookie popups
block_adsboolFalseBlock ads and trackers
selectorstrNoneCSS selector to capture
wait_forstrNoneCSS selector to wait for

Screenshot

  • .save(path) - Save to file, returns Path
  • .data - Raw bytes
  • .size - Size in bytes

Pricing

PlanPriceScreenshots/mo
Free$025
Starter$9/mo1,000
Pro$29/mo10,000
Business$79/mo50,000

Why GrabShot?

  • No infrastructure - No Docker, no Chrome, no Puppeteer to maintain
  • Fast - Screenshots in ~2 seconds, globally distributed
  • Reliable - 99.9% uptime, automatic retries
  • Affordable - Free tier to get started, pay as you grow

License

MIT

Releases

Packages

Contributors

Languages