Get high-quality images with automatic resizing and format conversion.
GET https:/placeholdxr.com/image/{query}?width=800&height=600&format=webp&index=0
Parameters:
-
query (required) - Search term
-
width - Image width (default: 800)
-
height - Image height (default: 600)
-
format - jpg, png, webp (default: jpg)
-
index - Specific image from results (default: random)
-
fallback - placeholder, redirect (default: placeholder)
Examples:
# Basic image search
curl "https://placeholdxr.com/api/image/cats"
# Custom dimensions and format
curl "https://placeholdxr.com/api/image/nature?width=1200&height=800&format=webp"
# Specific image from results
curl "https://placeholdxr.com/api/image/cars?index=5" -o car.jpg
Get video URLs from multiple sources with smart fallbacks.
GET /video/{query}?format=json&index=0&fallback=placeholder
Parameters:
-
query (required) - Search term
-
format - json (default), redirect, url
-
index - Specific video from results (default: random)
-
fallback - placeholder, json (default: placeholder)
Examples:
# Get video metadata as JSON
curl "https://placeholdxr.com/api/video/ocean"
# Direct redirect to video URL
curl -L "https://placeholdxr.com/api/video/nature?format=redirect"
# Get just the video URL as text
curl "https://placeholdxr.com/api/video/abstract?format=url"
JSON Response Structure:
{
"query": "ocean",
"total": 15,
"selected_index": 0,
"video": {
"id": "12345",
"url": "https://example.com/video.mp4",
"thumbnail": "https://example.com/thumb.jpg",
"duration": 30,
"tags": "ocean, waves, nature",
"source": "pexels"
},
"direct_url": "https://example.com/video.mp4",
"thumbnail": "https://example.com/thumb.jpg"
}
Generate custom images with text, colors, and dimensions.
GET /generate?text=Hello&width=800&height=600&background=ffffff&textColor=000000
Parameters:
-
text (required) - Text to display
-
width - Image width (default: 800)
-
height - Image height (default: 600)
-
background - Background color hex (default: ffffff)
-
textColor - Text color hex (auto-calculated if not provided)
-
fontSize - Font size (auto-calculated if not provided)
-
format - png, jpg, webp (default: png)
Examples:
# Basic text image
curl "https://placeholdxr.com/api/generate?text=Hello World" -o hello.png
# Custom banner with colors
curl "https://placeholdxr.com/api/generate?text=My Banner&width=1200&height=300&background=2c3e50&textColor=ecf0f1" -o banner.png
# Auto-contrasting text
curl "https://placeholdxr.com/api/generate?text=Auto Contrast&background=ff6b6b&format=webp" -o contrast.webp