A CLI access to the ScreenshotOne API wrapped as a Docker image.
582
A command line interface to integrate ScreenshotOne (the screenshot API for developers) into your workflows.
ScreenshotOne is one of the best screenshot APIs, it supports:
Check the ScreenshotOne documentation for more details.
bun install
docker build -t screenshotone/cli .
Sign up to get your access key and secret key.
export SCREENSHOTONE_ACCESS_KEY="your-access-key"
export SCREENSHOTONE_SECRET_KEY="your-secret-key"
Create ~/.screenshotone/config.json:
{
"access_key": "your-access-key",
"secret_key": "your-secret-key"
}
screenshotone take https://example.com --access-key=xxx --secret-key=yyy
If you are using Docker:
docker run -e SCREENSHOTONE_ACCESS_KEY=xxx -e SCREENSHOTONE_SECRET_KEY=yyy \
screenshotone/cli take https://example.com
take - Take a screenshotscreenshotone take <url|html|markdown> [options]
# Examples
screenshotone take https://example.com -o screenshot.png
screenshotone take https://example.com --format=jpg --image-quality=90 -o photo.jpg
screenshotone take "<h1>Hello</h1>" --html -o hello.png
screenshotone take "# Hello World" --markdown -o hello.png
animate - Create animated video/gifscreenshotone animate <url> [options]
# Examples
screenshotone animate https://example.com --duration=5 -o video.mp4
screenshotone animate https://example.com --format=gif --duration=3 -o animation.gif
usage - Check API usagescreenshotone usage
screenshotone usage --json
screenshot - Take a PNG screenshot (default)screenshotone screenshot https://example.com -o shot.png
pdf - Generate PDFscreenshotone pdf https://example.com -o document.pdf
screenshotone pdf https://example.com --pdf-print-background -o styled.pdf
full-page - Full page screenshotscreenshotone full-page https://example.com -o full.png
screenshotone full-page https://example.com --full-page-scroll -o scrolled.png
scrolling - Scrolling videoscreenshotone scrolling https://example.com --duration=5 -o scroll.mp4
screenshotone scrolling https://example.com --scroll-duration=3000 --format=gif -o scroll.gif
video - Record videoscreenshotone video https://example.com --duration=10 -o recording.mp4
html - Render HTMLscreenshotone html "<h1>Hello World</h1><p>This is a test</p>" -o hello.png
markdown - Render Markdownscreenshotone markdown "# Hello World" -o hello.png
| Option | Description |
|---|---|
-o, --output <file> | Save to file |
--stdout | Output binary to stdout (for piping) |
--json | Output signed URL as JSON |
# Save to file
screenshotone take https://example.com -o screenshot.png
# Pipe to another command
screenshotone take https://example.com --stdout | imgcat
# Get signed URL as JSON
screenshotone take https://example.com --json
# Output: {"url": "https://api.screenshotone.com/take?..."}
| Option | Description |
|---|---|
--viewport-width | Width in pixels |
--viewport-height | Height in pixels |
--viewport-device | Device to emulate |
--viewport-mobile | Mobile viewport |
--viewport-has-touch | Touch support |
--viewport-landscape | Landscape orientation |
--device-scale-factor | Scale factor (1, 2, or 3) |
| Option | Description |
|---|---|
--format | png, jpg, webp, gif, pdf, html |
--image-quality | Quality 1-100 (jpg, webp) |
--image-width | Resize width |
--image-height | Resize height |
--omit-background | Transparent background |
| Option | Description |
|---|---|
--full-page | Capture full page |
--full-page-scroll | Scroll before capture |
--full-page-scroll-delay | Delay between scrolls |
--full-page-max-height | Maximum height |
--full-page-algorithm | Algorithm to use |
--capture-beyond-viewport | Capture beyond viewport |
| Option | Description |
|---|---|
--pdf-print-background | Include background |
--pdf-fit-one-page | Fit to one page |
| Option | Description |
|---|---|
--block-ads | Block advertisements |
--block-cookie-banners | Block cookie banners |
--block-chats | Block chat widgets |
--block-trackers | Block trackers |
--block-banners-by-heuristics | Block banners |
--block-requests | Block URLs (array) |
--block-resources | Block resource types |
| Option | Description |
|---|---|
--selector | Element to capture |
--hide-selectors | Elements to hide |
--wait-for-selector | Wait for element |
--scroll-into-view | Scroll element into view |
--error-on-selector-not-found | Error if not found |
| Option | Description |
|---|---|
--delay | Delay before capture (ms) |
--timeout | Request timeout (ms) |
--navigation-timeout | Navigation timeout (ms) |
--wait-until | Wait for events |
| Option | Description |
|---|---|
--cache | Enable caching |
--cache-ttl | Cache TTL in seconds |
--cache-key | Custom cache key |
| Option | Description |
|---|---|
--store | Store to S3 |
--storage-path | Storage path |
--storage-bucket | Bucket name |
--storage-access-key-id | AWS access key |
--storage-secret-access-key | AWS secret key |
--storage-endpoint | Custom endpoint |
--storage-class | Storage class |
--storage-acl | ACL |
--storage-return-location | Return location |
| Option | Description |
|---|---|
--user-agent | Custom user agent |
--authorization | Authorization header |
--proxy | Proxy URL |
--cookies | Cookies (array) |
--headers | Headers (array) |
--time-zone | Time zone |
--ip-country-code | IP country code |
--bypass-csp | Bypass CSP |
| Option | Description |
|---|---|
--geolocation-latitude | Latitude |
--geolocation-longitude | Longitude |
--geolocation-accuracy | Accuracy in meters |
| Option | Description |
|---|---|
--dark-mode | Dark mode |
--reduced-motion | Reduced motion |
--media-type | screen or print |
--styles | Custom CSS |
--scripts | Custom JavaScript |
--request-gpu-rendering | GPU rendering |
--ignore-host-errors | Ignore host errors |
| Option | Description |
|---|---|
--clip-x | X coordinate |
--clip-y | Y coordinate |
--clip-width | Width |
--clip-height | Height |
| Option | Description |
|---|---|
--metadata-image-size | Include image size |
--metadata-fonts | Include fonts |
--metadata-open-graph | Include Open Graph |
--metadata-page-title | Include page title |
--metadata-content | Include content |
--metadata-http-response-status-code | Include status |
--metadata-http-response-headers | Include headers |
| Option | Description |
|---|---|
--async | Async execution |
--webhook-url | Webhook URL |
--webhook-sign | Sign webhook |
| Option | Description |
|---|---|
--fail-if-content-contains | Fail on content |
--fail-if-gpu-rendering-fails | Fail on GPU error |
| Option | Description |
|---|---|
--openai-api-key | OpenAI API key |
--vision-prompt | Vision prompt |
--vision-max-tokens | Max tokens |
| Option | Description |
|---|---|
--duration | Duration in seconds |
--scenario | Animation scenario |
--width | Video width |
--height | Video height |
--aspect-ratio | Aspect ratio |
| Option | Description |
|---|---|
--scroll-delay | Scroll delay |
--scroll-duration | Scroll duration |
--scroll-start-delay | Start delay |
--scroll-start-immediately | Start immediately |
--scroll-back | Scroll back |
--scroll-back-after-duration | Scroll back after |
--scroll-back-algorithm | Scroll back algorithm |
--scroll-complete | Complete scroll |
--scroll-by | Scroll by pixels |
--scroll-easing | Easing function |
--scroll-stop-after-duration | Stop after duration |
--scroll-try-navigate | Navigate on scroll |
--scroll-navigate-after | Navigate after |
--scroll-navigate-to-url | Navigate URL |
--scroll-navigate-link-hints | Link hints |
# Build the image
docker build -t screenshotone-cli .
# Run with environment variables
docker run -e SCREENSHOTONE_ACCESS_KEY=xxx -e SCREENSHOTONE_SECRET_KEY=yyy \
screenshotone-cli take https://example.com --stdout > screenshot.png
# Run with mounted volume for output
docker run -v $(pwd)/output:/output \
-e SCREENSHOTONE_ACCESS_KEY=xxx -e SCREENSHOTONE_SECRET_KEY=yyy \
screenshotone-cli take https://example.com -o /output/screenshot.png
# Install dependencies
bun install
# Run
bun run index.ts take https://example.com
# Build binary
bun build index.ts --compile --outfile screenshotone
ScreenshotOne CLI is licensed under the MIT License.
Content type
Image
Digest
sha256:ea32e43d4…
Size
93.1 MB
Last updated
27 days ago
docker pull screenshotone/cli