Captura is a free, open-source application designed for capturing screenshots from any public URL. With features such as bulk capture, custom CSS and JS injection, and support for multiple output formats, it empowers users to efficiently capture and utilize screenshots without relying on costly SaaS solutions.
Captura is an innovative free and open-source screenshot application designed to provide self-hosted screenshot API capabilities without incurring recurring SaaS fees. Inspired by screenshotapi.net, Captura enables users to acquire screenshots of any public URL effortlessly through a straightforward HTTP API.
Key Features
- Flexible Capture Options: Capture screenshots synchronously, asynchronously, or in bulk.
- Multiple Output Formats: Generate images in PNG, JPG, WebP, and PDF formats.
- Diverse Capture Modes: Select from full-page, viewport, or specific element captures.
- Customizability: Inject custom CSS and JavaScript, hide cookie banners, and block ads for cleaner captures.
- Advanced Capabilities: Utilize built-in caching, webhook notifications, stealth mode, and proxy support for enhanced performance and privacy.
- Identity Presets: Choose from various region-aware identity settings for more accurate browsing simulations.
Example API Endpoints
- Health Check:
GET /health - Screenshot Capture (Sync):
GET|POST /api/screenshot - Asynchronous Screenshot Capture:
POST /api/screenshot/async - Bulk Screenshot Capture:
POST /api/screenshot/bulk - Retrieve Screenshot:
GET /api/screenshot/{id}
Example Usage
Here are some practical examples for utilizing the API:
# Sync screenshot (image response)
curl "http://localhost/api/screenshot?url=https://example.com" --output example.png
# JSON response
curl "http://localhost/api/screenshot?url=https://example.com&response=json"
# Async screenshot
curl -X POST http://localhost/api/screenshot/async \
-H "Content-Type: application/json" \
-d '{"url":"https://example.com","full_page":true}'
# Bulk screenshot
curl -X POST http://localhost/api/screenshot/bulk \
-H "Content-Type: application/json" \
-d '{"items":[{"url":"https://example.com"},{"url":"https://example.com","full_page":true}]}'
# Stealth mode with region and identity settings
curl "http://localhost/api/screenshot?url=https://example.com&stealth=1&ua_preset=rotate&locale=en-US&timezone=America/New_York"
# Proxy pool usage with round-robin strategy
curl "http://localhost/api/screenshot?url=https://example.com&proxy_pool=1&proxy_strategy=round_robin"
Configuration Options
Configuration is managed through the app/.env file, allowing customization of default dimensions, formats, and security settings to suit specific needs. Options include setting parameters for optimal performance, caching, and security.
Deployment
Deploying Captura leverages Docker to manage its services seamlessly. Utilize Docker and Docker Compose to set up the environment, which includes:
- Nginx as a reverse proxy
- Laravel for the API
- Redis for queue management and caching
- PostgreSQL for database storage
- Node.js for the screenshot worker utilizing Puppeteer
Captura stands as a powerful solution for developers requiring a customizable and cost-effective screenshot API while retaining full control over their data and operations.
No comments yet.
Sign in to be the first to comment.