Placeholder Image API
Get placeholder images of any size for mockups and tests: /v1/placeholder/600x400.png. SVG with custom text and colours, or a solid-colour PNG.
The Placeholder Image API returns dummy images of exactly the size you need for wireframes, UI prototypes, seed data and automated tests. Put the size in the path – /v1/placeholder/600x400, /v1/placeholder/600x400.png or just /v1/placeholder/300 for a square – or use the width and height query parameters (default 600×400).
The default SVG output shows a centred label (the dimensions, or your own text up to 60 characters) on a neutral grey background; background (or bg) and color accept hex colours. SVG files are tiny and scale perfectly. With .png or format=png you get a solid-colour PNG of the requested size, without text, which is handy when a real raster file is required (upload tests, image pipelines).
Width and height go from 1 to 4000 pixels; PNG placeholders are limited to 4 megapixels. Responses are cacheable for 7 days.
Parameters
| Name | In | Type | Required | Default | |
|---|---|---|---|---|---|
size | path | string | no | Optional path segment WIDTHxHEIGHT[.png|.svg], e.g. /v1/placeholder/600x400.png; a single number gives a square. | |
width | query | number | no | 600 | Width in pixels (1–4000), when not given in the path. |
height | query | number | no | 400 | Height in pixels (1–4000). |
format | query | string | no | svg | svg or png (PNG is a solid colour, max 4 megapixels). |
text | query | string | no | WIDTH×HEIGHT | Label shown in the SVG (max 60 characters). |
background | query | string | no | dde1e7 | Background colour, hex (alias bg). |
color | query | string | no | 5a6270 | Text colour, hex. |
Example
curl "https://apibox.io.vn/v1/placeholder/600x400?text=Hello" \
-H "Authorization: Bearer YOUR_API_KEY" \
-o outputconst res = await fetch('https://apibox.io.vn/v1/placeholder/600x400?text=Hello', {
method: 'GET',
headers: {
Authorization: 'Bearer YOUR_API_KEY',
},
});
const blob = await res.blob();import requests
res = requests.get(
"https://apibox.io.vn/v1/placeholder/600x400?text=Hello",
headers={"Authorization": "Bearer YOUR_API_KEY"},
timeout=30,
)
open("output", "wb").write(res.content)<?php
$ch = curl_init('https://apibox.io.vn/v1/placeholder/600x400?text=Hello');
curl_setopt_array($ch, [
CURLOPT_RETURNTRANSFER => true,
CURLOPT_HTTPHEADER => ['Authorization: Bearer YOUR_API_KEY'],
]);
$response = curl_exec($ch);
file_put_contents('output', $response);Response
binary image/svg+xml (600×400 grey placeholder with the text "Hello")
Use cases
- Fill wireframes and UI prototypes with correctly sized images
- Seed demo data and fixtures for e-commerce or CMS projects
- Test image upload, resizing and CDN pipelines with real PNG files
- Show a neutral fallback while real images are still loading
FAQ
How do I get a 1200×630 Open Graph placeholder?
Request /v1/placeholder/1200x630 for an SVG with the size written on it, or /v1/placeholder/1200x630.png for a PNG file.
Can I change the text and colours?
Yes, for SVG output: text=Hello&background=1e293b&color=ffffff. The text is limited to 60 characters and the font size adapts to the image. PNG placeholders are a solid background colour only.
What is the maximum size?
4000 pixels per side. PNG output is additionally limited to 4 megapixels (for example 2000×2000); larger PNG requests return a too_large error.
Related APIs
QR Code Generator
Generate QR codes as PNG or SVG with one GET request: URLs, text, WiFi logins, vCards, e-mail, SMS, phone and geo links. Custom colours, size and ECC.
|||Barcode Generator
Create Code 128 barcodes for labels, SKUs and shipping with a single request. SVG with human-readable text or PNG, custom height, width and colours.
VQRVietQR Generator
Create VietQR / NAPAS 247 bank transfer QR codes with bank, account, amount and transfer note as PNG, SVG or JSON payload. Decode existing VietQR codes.