Placeholder API
The Placeholder API generates a simple image placeholder at the size, colour, and text you provide. It is useful for layouts, mock-ups, and temporary image slots.
Response Format
This endpoint returns an image, not JSON. The image is generated from the query parameters in the request URL.
Request Parameters:
size(string), required, width and height in pixels in the formatWIDTHxHEIGHT.bg(string), optional, background colour in HEX.fg(string), optional, foreground or text colour in HEX.text(string), optional, text shown on the placeholder image.
Authentication Methods
This endpoint is publicly accessible and does not require authentication.
Characteristics:
- No authentication required
- Direct image output
- Suitable for placeholders and development layouts
- Can be embedded in HTML
Usage:
Endpoint
GET /v1/placeholder
Example Request
Direct URL Example
https://api.tylermwise.uk/v1/placeholder?size=500x500&bg=ffffff&fg=000000&text=Placeholder
HTML Embed Example
<img src="https://api.tylermwise.uk/v1/placeholder?size=500x500&bg=ffffff&fg=000000&text=Placeholder" alt="Placeholder image">
Query Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
size | string | Yes | Width and height in pixels, for example 500x500. |
bg | string | No | Background colour in HEX, for example ffffff. |
fg | string | No | Text colour in HEX, for example 000000. |
text | string | No | Text to display in the placeholder. |
Notes
- The image is created from the URL parameters.
- The size parameter controls both width and height.
- You can embed the URL directly in an
<img>tag. - This is useful for temporary images during site development.
HTTP Status Codes
Standard responses may include:
200- Success.400- Bad Request.429- Too Many Requests.500- Internal Server Error.
Versioning
This page documents version 1 of the Placeholder API, available under the /v1/ path.