Image Serving

Blog images are served directly from the API. When a blog is published, all image URLs in the HTML are automatically rewritten to use the public API paths.

Image Endpoint

GET/api/v1/blogs/images/{blogId}/{filename}

Serves a blog image by blog ID and filename. Supports WebP, PNG, JPG, and SVG formats.

Parameters

NameTypeDescription
blogIdUUIDThe blog's unique ID
filenamestringImage filename (e.g., banner.webp, section-1.png)

Image Types

Each blog can include several types of images:

TypeTypical FilenameUse Case
Featured/Bannerbanner.webpHero image at top of blog
OG Imageog.webpSocial sharing preview (1200x630)
Section Imagessection-*.webpAI-generated illustrations within content
Screenshotsscreenshot-*.pngAutomated website screenshots

Caching

Image responses include cache headers for optimal performance:

Cache-Control: public, max-age=86400
Content-Type: image/webp

Images are cached for 24 hours. The Content-Type is auto-detected from the file extension.

Usage in HTML

When you fetch a blog via the API, image URLs in the HTML content are already rewritten to use the public API path. You don't need to modify them.

Example img tag in blog HTML
<img
  src="/api/v1/blogs/images/abc-123/banner.webp"
  alt="Blog banner image"
  loading="lazy"
/>

Open Graph Images

Use the ogImageUrl field from the blog response as your og:image meta tag:

HTML
<meta
  property="og:image"
  content="https://wudoseo.com/api/v1/blogs/images/abc-123/og.webp"
/>