A full-stack web application for generating social media banners from any website URL using live screenshots. This app is built on top of Screenshotlayer API by APILayer. It captures live website screenshots with Retina (2x) support and optimized WebP output, ensuring crisp visuals and fast loading.
Clone this snapshot-banner repository in your local machine
git clone https://github.com/apilayer/snapshot-banner.gitInstall all dependencies separately for backend and frontend using the commands below.
Backend
cd snapshot-banner
cd backend
npm installFrontend
cd snapshot-banner
cd frontend
npm install- Create
.envfile in thebackendfolder - Copy the contents of
.env.exampleinto your new.envfile. - Sign up for the Screenshotlayer API to get your API key and Secret keyword
- Add your API key and Secret keywork to the
.envfile
Backend
cd backend
npm startFrontend
cd frontend
npm run dev- Enter any website URL
- Fetch screenshot via backend proxy (
/api/screenshot/proxy) - Automatic image loading with error handling
- Drag to reposition - Click and drag the screenshot
- Scroll to zoom - Mouse wheel zoom with cursor tracking
- High-DPI rendering - Crisp display on Retina screens
- Reset view button to return to default state
- Preset sizes for popular social media formats:
- 1280×720 (Thumbnail)
- 1500×500 (Header)
- 1080×1080 (Square/Instagram)
- 1080×1350 (Portrait/Instagram)
- 1200×627 (Link preview)
- 820×360 (Cover)
- Custom dimensions with manual width/height input
- Background color picker with hex input
- Retina 2x toggle for high-resolution exports
- Scale slider (25% - 250%)
- Center button - Reset image position
- Fit button - Auto-scale to fill canvas
- Format selection: PNG or WebP
- Quality slider for WebP (50% - 100%)
- Copy to clipboard functionality
- Download with proper naming convention
- Dark theme with gradient backdrop
- Responsive layout (mobile-friendly)
- Smooth transitions and hover effects
- Professional UI matching the landing.html design
- Node.js with Express
- Screenshotlayer API for capturing screenshots
- CORS enabled for frontend communication
- React 19 with Hooks
- Vite for fast development and building
- Tailwind CSS for styling
- Canvas API for image manipulation
- pnpm for package management
GET http://localhost:3001/api/screenshot/proxy?url={encoded_url}
Parameters:
url(required) - The website URL to capture
Response:
- Returns the screenshot image with CORS headers
- User enters a website URL
- Frontend sends request to backend proxy
- Backend fetches screenshot from Screenshotlayer API
- Image loads into the canvas editor
- User adjusts position, size, background, and format
- User exports as PNG/WebP via copy or download
- Main state management
- Screenshot fetching logic
- Export functionality
- Layout composition
- Canvas rendering with device pixel ratio
- Drag and zoom interactions
- Export buttons (copy/download)
- Canvas size presets and custom dimensions
- Background color picker
- Retina toggle
- Scale slider
- Format and quality controls
- URL input field
- Capture button
- Feature badges
- Branding and navigation
- Backend must be running for screenshot capture to work
- CORS is configured to allow localhost development
- Images are loaded with
crossOrigin: 'anonymous'for canvas export - Retina export doubles the resolution for crisp results
- Loading states and progress indicators
- Toast notifications instead of alerts
- Image filters and effects
- Text overlay capabilities
- Multiple image layers
- Undo/redo functionality
- Save/load projects
- Share generated banners