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
| Name | Type | Description |
|---|---|---|
blogId | UUID | The blog's unique ID |
filename | string | Image filename (e.g., banner.webp, section-1.png) |
Image Types
Each blog can include several types of images:
| Type | Typical Filename | Use Case |
|---|---|---|
| Featured/Banner | banner.webp | Hero image at top of blog |
| OG Image | og.webp | Social sharing preview (1200x630) |
| Section Images | section-*.webp | AI-generated illustrations within content |
| Screenshots | screenshot-*.png | Automated 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" />