Social images
Automatically generate OG images for your verified domains
Social images
Generate Open Graph (OG) images automatically for your website. When someone shares a link to your site on social media, a screenshot of that page is used as the preview image.
How it works
- Verify your domain in the dashboard
- Add the meta tag to your pages pointing to our service
- We capture screenshots when social platforms request your OG image
- Results are cached so subsequent requests are instant and free
<meta property="og:image" content="https://og.allscreenshots.com?url=https://yourdomain.com/page" />No API key is needed in the URL. Your domain must be verified for images to be generated. Cache hits don't count toward your quota.
Setting up
1. Add your domain
Go to the Social images page in your dashboard and add your domain (e.g., example.com).
2. Verify ownership
Choose one of three verification methods:
| Method | How it works |
|---|---|
| DNS TXT | Add a TXT record to your domain's DNS settings |
| Meta tag | Add a verification meta tag to your homepage |
| File | Upload a verification file to your web server |
3. Add the OG meta tag
Add the following meta tag to each page where you want social images:
<head>
<meta property="og:image" content="https://og.allscreenshots.com?url=https://yourdomain.com/page" />
<meta property="og:image:width" content="1200" />
<meta property="og:image:height" content="630" />
</head>For dynamic pages, generate the URL programmatically:
// Next.js example
export const metadata = {
openGraph: {
images: [`https://og.allscreenshots.com?url=${encodeURIComponent('https://yourdomain.com' + pathname)}`],
},
}Configuration
Configure default capture settings for your domain in the dashboard. These settings apply to all social images generated for that domain.
Image dimensions
| Setting | Default | Description |
|---|---|---|
| Width | 1200 | Image width in pixels |
| Height | 630 | Image height in pixels |
Standard OG image size is 1200×630. Twitter recommends 1200×600.
Cache duration
Control how long images are cached before regeneration. Longer cache times mean fewer billable captures but slower updates when your pages change.
| Duration | Use case |
|---|---|
| 1-3 days | Frequently updated content |
| 7 days | Standard websites (default) |
| 14-30 days | Static content, rarely changes |
Subdomains
Enable subdomain support to generate images for all subdomains (e.g., blog.example.com, docs.example.com) without verifying each one separately.
Appearance options
| Setting | Description |
|---|---|
| Dark mode | Capture pages in dark mode (if your site supports it) |
| Block ads | Hide advertisements in captured images |
| Block cookie banners | Hide cookie consent popups |
Output options
| Setting | Options | Description |
|---|---|---|
| Format | PNG, JPEG, WebP | Image format (PNG recommended for quality) |
| Quality | 50-100% | Compression quality for JPEG/WebP |
| Scale | 1x, 2x, 3x | Device scale factor for sharper images |
Timing options
| Setting | Default | Description |
|---|---|---|
| Wait until | Network idle | When to consider the page ready |
| Delay | 0ms | Additional wait time after page load |
| Timeout | 30000ms | Maximum time to wait for page load |
Customization
| Setting | Description |
|---|---|
| Hide elements | CSS selectors for elements to hide (e.g., .popup, #banner) |
| Custom CSS | Inject CSS before capturing (e.g., fix sticky headers) |
URL parameter
Pass the page URL to capture:
https://og.allscreenshots.com?url=https://yourdomain.com/page| Parameter | Type | Description |
|---|---|---|
url | string | Required. The page URL to capture |
Capture settings such as dimensions, dark mode, delay, and hidden selectors are configured per verified domain in the dashboard.
Caching
Social images are automatically cached to improve performance and reduce costs.
How caching works
- First request for a URL generates a new screenshot (billable)
- Subsequent requests serve the cached image (free)
- After the cache TTL expires, the next request regenerates the image
Cache management
- Clear cache: Clear all cached images for a domain from the dashboard
Clearing the cache will cause all subsequent requests to generate new screenshots until the cache is rebuilt.
Usage and billing
What counts toward quota
| Action | Billable |
|---|---|
| First capture of a URL | Yes |
| Cache hit (serving cached image) | No |
| Refresh after cache expiry | Yes |
| Manual cache clear + recapture | Yes |
Monitoring usage
View your social image usage in the dashboard:
- Images generated: Billable captures this month
- Cache hits: Free cached responses
- Cache hit rate: Percentage of requests served from cache
Best practices
Optimize for social platforms
Different platforms have different requirements:
| Platform | Recommended size | Notes |
|---|---|---|
| 1200×630 | Standard OG size | |
| 1200×600 | Slightly shorter | |
| 1200×627 | Similar to Facebook | |
| Discord | 1200×630 | Uses OG tags |
Design pages for screenshots
For best results:
- Above the fold: Key content should be visible without scrolling
- Clean layout: Remove distracting elements with hide selectors
- Readable text: Ensure text is large enough to read in thumbnails
- Branding: Include your logo in a consistent position
Handle dynamic content
For pages with user-specific or frequently changing content:
<!-- Use a static preview URL for dynamic pages -->
<meta property="og:image" content="https://og.allscreenshots.com?url=https://yourdomain.com/preview/article-123" />Create dedicated preview routes that show a clean, static version of the content.
Troubleshooting
Image not updating
The image may be cached. Either:
- Wait for the cache TTL to expire
- Clear the domain cache from the dashboard
Wrong content captured
Check your domain timing settings in the dashboard.
Elements blocking content
Configure hide selectors for the verified domain in the dashboard.
Domain not verified
Ensure you've completed one of the verification methods. DNS changes can take up to 48 hours to propagate.