ScreenshotNeo

BlogGuides

What Is a Thumbnail URL and How to Use One

A thumbnail URL points to a preview image. Learn how to use it in Open Graph, video metadata, sitemaps, APIs, and screenshot workflows.

By the ScreenshotNeo team1 October 20268 min read

Direct answer: A thumbnail URL is the web address that fetches a thumbnail image. It identifies the image resource, not the page, video watch URL, player, or original media file. You place it in metadata such as og:image, a video sitemap, structured data, or a platform API response so crawlers and applications can retrieve a preview image.

The exact field name, image sizes, and accepted formats depend on the platform. A reliable thumbnail URL should be absolute, stable, publicly fetchable, and consistent wherever you declare it.

1. How a thumbnail URL works

A page or API usually exposes several different URLs:

URL type What it identifies Typical use
Page or watch URL The HTML page people visit Sharing and navigation
Player URL An embedded video player iframe embeds
Video file URL The media stream or file Playback
Thumbnail URL A still image representing the page or video Cards, search previews, social embeds

For example, https://cdn.example.com/video-123-thumb.webp is a thumbnail URL if requesting it returns the image bytes. It is not the same resource as https://example.com/watch/video-123.

2. Add a thumbnail URL to Open Graph metadata

For a normal web page, put an absolute image URL in the document head:

<head>
  <meta property="og:title" content="How to deploy a web app">
  <meta property="og:type" content="article">
  <meta property="og:url" content="https://example.com/guides/deploy">
  <meta property="og:image" content="https://cdn.example.com/images/deploy-preview.jpg">
  <meta property="og:image:alt" content="Terminal and browser showing a deployment">
  <meta property="og:image:type" content="image/jpeg">
  <meta property="og:image:width" content="1200">
  <meta property="og:image:height" content="630">
</head>

Open Graph defines og:image as the image URL representing the page object and lists og:title, og:type, and og:url as the four basic properties. The secure URL, MIME type, dimensions, and og:image:alt provide additional information. See the Open Graph protocol.

Open Graph checklist

  • Use an absolute HTTPS URL.
  • Return the image without requiring a login, cookie, or JavaScript execution.
  • Send a correct Content-Type, such as image/jpeg or image/webp.
  • Keep the image URL stable; change the path or query string only when the image changes.
  • Write useful og:image:alt text for accessibility and context.
  • Make the image match the page it represents.

3. Specify a thumbnail for a video

HTML video poster

The poster attribute displays an image before playback:

<video controls poster="https://cdn.example.com/video-123-poster.jpg" width="1280" height="720">
  <source src="https://cdn.example.com/video-123.mp4" type="video/mp4">
</video>

Structured data

For a video page, JSON-LD can declare the thumbnail with thumbnailUrl:

<script type="application/ld+json">
{
  "@context": "https://schema.org",
  "@type": "VideoObject",
  "name": "How to deploy a web app",
  "description": "A deployment walkthrough.",
  "thumbnailUrl": ["https://cdn.example.com/video-123-thumb.jpg"],
  "uploadDate": "2026-01-15T10:00:00Z",
  "contentUrl": "https://cdn.example.com/video-123.mp4"
}
</script>

Video sitemap

A video sitemap uses <video:thumbnail_loc>:

<urlset xmlns="http://www.sitemaps.org/schemas/sitemap/0.9"
        xmlns:video="http://www.google.com/schemas/sitemap-video/1.1">
  <url>
    <loc>https://example.com/watch/video-123</loc>
    <video:video>
      <video:thumbnail_loc>https://cdn.example.com/video-123-thumb.jpg</video:thumbnail_loc>
      <video:title>How to deploy a web app</video:title>
      <video:description>A deployment walkthrough.</video:description>
      <video:content_loc>https://cdn.example.com/video-123.mp4</video:content_loc>
    </video:video>
  </url>
</urlset>

Open Graph video image

Some integrations also accept og:video:image. If you publish the same thumbnail through Open Graph, JSON-LD, and a sitemap, use the same URL for the same video. Google documents these video-thumbnail methods and says structured data does not guarantee a particular Search display; see Google’s video structured-data guidance.

4. Get a thumbnail URL from the YouTube Data API

YouTube returns thumbnail objects under a resource’s snippet.thumbnails. Common keys are default, medium, high, standard, and maxres. A key may be missing, and width or height may not be present.

cURL

curl --get 'https://www.googleapis.com/youtube/v3/videos' \
  --data-urlencode 'part=snippet' \
  --data-urlencode 'id=VIDEO_ID' \
  --data-urlencode 'key=YOUR_YOUTUBE_API_KEY'

Read the returned JSON at items[0].snippet.thumbnails, then select the largest available variant rather than assuming maxres exists.

Python

import requests

params = {
    "part": "snippet",
    "id": "VIDEO_ID",
    "key": "YOUR_YOUTUBE_API_KEY",
}
response = requests.get(
    "https://www.googleapis.com/youtube/v3/videos",
    params=params,
    timeout=30,
)
response.raise_for_status()
video = response.json()["items"][0]
thumbnails = video["snippet"]["thumbnails"]

for size in ("maxres", "standard", "high", "medium", "default"):
    if size in thumbnails:
        thumbnail_url = thumbnails[size]["url"]
        break
else:
    raise RuntimeError("The API returned no thumbnail variant")

print(thumbnail_url)

Node.js

const params = new URLSearchParams({
  part: 'snippet',
  id: 'VIDEO_ID',
  key: 'YOUR_YOUTUBE_API_KEY'
});

const res = await fetch(`https://www.googleapis.com/youtube/v3/videos?${params}`);
if (!res.ok) throw new Error(`YouTube API failed: ${res.status}`);
const data = await res.json();
const thumbnails = data.items?.[0]?.snippet?.thumbnails ?? {};
const thumbnail = ['maxres', 'standard', 'high', 'medium', 'default']
  .map((name) => thumbnails[name])
  .find(Boolean);
if (!thumbnail) throw new Error('No thumbnail variant was returned');
console.log(thumbnail.url);

YouTube’s documented typical video dimensions are 120×90 (default), 320×180 (medium), 480×360 (high), 640×480 (standard), and 1280×720 (maxres). These are typical values, not a guarantee for every resource. Channel thumbnails use different dimensions. See the YouTube thumbnail resource documentation.

5. Choose and serve the right image variant

Use case Recommended approach
Social sharing One stable, sufficiently large og:image URL with descriptive alt text.
Video search features Declare the same stable URL in structured data and, where used, a video sitemap.
Application cards Use the API’s largest available variant that fits the card, then cache it.
Video playback Use the poster attribute for the pre-play image.

Do not assume that labels such as high or maxres have universal dimensions. They describe one service’s response shape.

6. Stability, crawling, and accessibility requirements

  1. Keep the URL stable. Google recommends one unique, stable thumbnail URL per video because rapidly expiring URLs can prevent successful indexing.
  2. Allow crawlers to fetch it. The image must be available to Googlebot and Googlebot Images and must not require a login or be blocked by robots.txt.
  3. Use consistent declarations. The thumbnail, name, and description in structured data should match the visible video and other metadata.
  4. Return an actual image. Redirects are acceptable when reliable, but a login page, HTML error page, or expired signed URL is not a thumbnail.
  5. Describe the image. Use og:image:alt and meaningful nearby text; do not put essential information only inside the image.

Google’s video-thumbnail specifications list BMP, GIF, JPEG, PNG, WebP, SVG, and AVIF, with a minimum size of 60×30 pixels and a preference for larger images. They also specify that at least 80% of pixels should have an alpha transparency value greater than 250 for that video-feature context. These are Google specifications, not a universal rule for every platform.

7. Generate a thumbnail URL by capturing a page

If the thumbnail should show a live webpage, you can render that page in a browser and store the resulting image at a stable public URL. A do-it-yourself flow is:

  1. Load the target page in a headless browser.
  2. Wait for the page or a specific selector to be ready.
  3. Hide cookie banners and overlays before capture.
  4. Capture the viewport, full page, or a selected element.
  5. Upload the image to object storage with a long-lived URL.
  6. Use that URL in og:image, structured data, or your application.

When you control the browser, wait for a meaningful selector instead of relying only on a fixed delay. Set a viewport and device scale factor explicitly so the output is repeatable. Store the image with a versioned path when the page changes, and configure cache headers for the expected refresh interval.

8. Or skip the browser setup

ScreenshotNeo is a website screenshot API and MCP server. One request returns a PNG, JPEG, WebP, or PDF, which you can place behind your own stable thumbnail URL.

See the ScreenshotNeo API documentation for the full option list.

cURL

curl -G "https://api.screenshotneo.com/v1/shot" -d access_key=YOUR_API_KEY --data-urlencode url=https://example.com/video -o shot.webp

Python

import requests
r = requests.get("https://api.screenshotneo.com/v1/shot", params={"access_key": "YOUR_API_KEY", "url": "https://example.com/video"}, timeout=90)
open("shot.webp", "wb").write(r.content)

Node.js

const q = new URLSearchParams({ access_key: 'YOUR_API_KEY', url: 'https://example.com/video' });
const res = await fetch(`https://api.screenshotneo.com/v1/shot?${q}`);

Before capture, ScreenshotNeo can accept cookie and consent banners and remove more than 60 known consent platforms, newsletter popups, and chat widgets; each step can be turned off. Bot checks, blank pages, timeouts, failed loads, and cache hits are not billed, and the response identifies the result with X-Page-Verdict and X-Billed headers. Its MCP server provides take_screenshot, get_page_info, and capture_pdf tools for Claude, Cursor, and other MCP clients.

There is a free allowance of 1,000 screenshots per month with no card. Paid plans start at $5 for 3,000 shots. Create a free ScreenshotNeo account.

9. Troubleshooting thumbnail URLs

Symptom Likely cause Fix
Social card has no image Relative URL, blocked fetch, or invalid response Use an absolute HTTPS URL and request it without authentication.
Image is replaced by an old one Crawler or CDN cache Keep the URL stable for the same image; use a versioned URL when replacing it.
Google cannot index the video Expired URL, robots block, or login requirement Publish a stable public URL and allow Googlebot and Googlebot Images.
maxres is undefined That variant is unavailable for the resource Fall back through standard, high, medium, and default.
Broken image icon Wrong Content-Type, 404, or HTML returned Check the response status and headers with curl -I URL; return image bytes.
Screenshot contains a consent popup Capture occurred before cleanup Wait for the banner, click or hide it, then capture; ScreenshotNeo can handle known consent platforms before the shot.
Thumbnail aspect ratio is distorted CSS stretches the source Set an explicit aspect ratio and use object-fit: cover or preserve the source ratio.

10. Performance, reliability, and cost notes

  • Serve thumbnails from a CDN close to readers and enable long-lived caching for immutable files.
  • Prefer WebP or AVIF when the consuming platform accepts them, while retaining a JPEG or PNG fallback where required.
  • Generate thumbnails asynchronously for large catalogs; persist the final URL instead of rendering on every page request.
  • Use a stable URL per video, but version the URL when the actual image changes so caches can invalidate cleanly.
  • Validate dimensions and file type at upload time, and monitor for 404 responses.
  • For API captures, cache repeated requests and set a deliberate capture timeout. ScreenshotNeo cache hits are not billed; failed loads and bot checks are also not billed according to the returned verdict headers.

11. FAQ

Is a thumbnail URL the same as a video URL?

No. A thumbnail URL fetches an image; a video URL identifies a page, player, or media stream.

Can I use a relative thumbnail URL?

Use an absolute URL in metadata. Relative paths can be ambiguous to crawlers and sharing systems.

Does adding og:image guarantee a search result image?

No. It supplies metadata to consumers that support Open Graph. Search features have their own requirements and are not guaranteed.

Why does an API return several thumbnail URLs?

Different variants fit different layouts and bandwidth limits. Select the largest variant that exists and matches your display size.

Should every metadata source use the same URL?

For one video, yes. Consistency helps crawlers associate the image with the same resource.