placehold.cloud

Image Placeholder API

Usage Guide

Create custom placeholder images with our powerful API. Here's how to get started:

Basic Usage

https://placehold.cloud/p/300x200/FF5733/FFFFFF

This will generate a 300x200 pixel image with an orange background and white text.

Core Parameters

  • size: Dimensions (e.g., '300x200' or '300' for square)
  • background_color: Hex code for background (default: 'C8C8C8')
  • text_color: Hex code for text (default: '323232')

These parameters are essential for defining the basic properties of your placeholder image.

Optional Parameters

Customize your image further with these optional parameters:

text

Custom text (max 100 chars)

https://placehold.cloud/p/300x200/FF5733/FFFFFF?text=Hello%2BWorld
Example with text

format

Image format (png, jpg, gif, webp, svg)

https://placehold.cloud/p/300x200/FF5733/FFFFFF?format=webp
Example with format

quality

Image quality (0-100)

https://placehold.cloud/p/300x200/FF5733/FFFFFF?quality=90
Example with quality

font

Font type (arial, couri, times, tron)

https://placehold.cloud/p/300x200/FF5733/FFFFFF?font=couri
Example with font

text_size

Size of text (1-500)

https://placehold.cloud/p/300x200/FF5733/FFFFFF?text_size=34
Example with text_size

watermark

Watermark text

https://placehold.cloud/p/300x200/FF5733/FFFFFF?watermark=placehold.cloud
Example with watermark

watermark_size

Size of watermark (1-100)

https://placehold.cloud/p/300x200/FF5733/FFFFFF?watermark_size=20
Example with watermark_size

watermark_opacity

Opacity of watermark (0-100)

https://placehold.cloud/p/300x200/FF5733/FFFFFF?watermark_opacity=50
Example with watermark_opacity

blur

Blur effect (0-100)

https://placehold.cloud/p/300x200/FF5733/FFFFFF?blur=10
Example with blur

grayscale

Apply grayscale (true/false)

https://placehold.cloud/p/300x200/FF5733/FFFFFF?grayscale=true
Example with grayscale

invert

Invert colors (true/false)

https://placehold.cloud/p/300x200/FF5733/FFFFFF?invert=true
Example with invert

Advanced Example

Combine multiple parameters for more complex placeholder images:

https://placehold.cloud/p/300x200/FF5733/FFFFFF?text=Hello%2BWorld&format=png&quality=90&font=arial&text_size=30&watermark=Copyright&watermark_size=20&watermark_opacity=50&blur=5&grayscale=false&invert=false&cat=false&dog=false&robot=false
Advanced example

API Limits and Caching

Our API is rate-limited to 60 requests per minute. Images are cached for one week to improve performance.

Error Handling

If an error occurs during image generation, a backup image will be provided with basic information.

Security

Our API implements several security headers to protect against common web vulnerabilities:

  • X-Content-Type-Options: nosniff
  • X-Frame-Options: DENY
  • X-XSS-Protection: 1; mode=block