Allscreenshots Docs
Features

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

  1. Verify your domain in the dashboard
  2. Add the meta tag to your pages pointing to our service
  3. We capture screenshots when social platforms request your OG image
  4. 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:

MethodHow it works
DNS TXTAdd a TXT record to your domain's DNS settings
Meta tagAdd a verification meta tag to your homepage
FileUpload 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

SettingDefaultDescription
Width1200Image width in pixels
Height630Image 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.

DurationUse case
1-3 daysFrequently updated content
7 daysStandard websites (default)
14-30 daysStatic 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

SettingDescription
Dark modeCapture pages in dark mode (if your site supports it)
Block adsHide advertisements in captured images
Block cookie bannersHide cookie consent popups

Output options

SettingOptionsDescription
FormatPNG, JPEG, WebPImage format (PNG recommended for quality)
Quality50-100%Compression quality for JPEG/WebP
Scale1x, 2x, 3xDevice scale factor for sharper images

Timing options

SettingDefaultDescription
Wait untilNetwork idleWhen to consider the page ready
Delay0msAdditional wait time after page load
Timeout30000msMaximum time to wait for page load

Customization

SettingDescription
Hide elementsCSS selectors for elements to hide (e.g., .popup, #banner)
Custom CSSInject CSS before capturing (e.g., fix sticky headers)

URL parameters

Override domain defaults for specific pages using URL parameters:

https://og.allscreenshots.com?url=https://yourdomain.com/page&width=1200&height=600&darkMode=true
ParameterTypeDescription
urlstringRequired. The page URL to capture
widthintegerImage width (200-2400)
heightintegerImage height (200-2400)
darkModebooleanEnable dark mode
delayintegerWait time in ms after page load

Caching

Social images are automatically cached to improve performance and reduce costs.

How caching works

  1. First request for a URL generates a new screenshot (billable)
  2. Subsequent requests serve the cached image (free)
  3. 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
  • Force refresh: Add &refresh=true to regenerate a specific image (counts as new capture)

Clearing the cache will cause all subsequent requests to generate new screenshots until the cache is rebuilt.

Usage and billing

What counts toward quota

ActionBillable
First capture of a URLYes
Cache hit (serving cached image)No
Refresh after cache expiryYes
Manual cache clear + recaptureYes

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:

PlatformRecommended sizeNotes
Facebook1200×630Standard OG size
Twitter1200×600Slightly shorter
LinkedIn1200×627Similar to Facebook
Discord1200×630Uses 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:

  1. Wait for the cache TTL to expire
  2. Clear the domain cache from the dashboard
  3. Use &refresh=true to force regeneration

Wrong content captured

Check your timing settings:

?url=https://yourdomain.com/page&delay=2000&waitUntil=networkidle

Elements blocking content

Use hide selectors to remove popups or banners:

?url=https://yourdomain.com/page&hideSelectors=.cookie-banner,.popup

Domain not verified

Ensure you've completed one of the verification methods. DNS changes can take up to 48 hours to propagate.

On this page