API Documentation
Generate beautiful Open Graph images programmatically with our simple REST API
Overview
The ogimagex API allows you to generate Open Graph images dynamically. Simply make a GET request to our endpoint with your desired parameters, and receive a beautifully rendered image in response.
Base URL: https://ogimagex.xyz/api/public/og/{template}
Replace {template} with the template name you want to use.
API Endpoint
/api/public/og/{template}Replace {template} with the template name you want to use.
Parameters
Query Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
| format | string | No | Output format: png or svg (default: png) |
| w | integer | No | Image width (200-2400, default: 1200) |
| h | integer | No | Image height (200-2400, default: 630) |
| * | varies | varies | Template-specific parameters (see templates below) |
Available Templates
showcase
Hero image with gradient and data visualization
blog
Clean blog post cover with title and author
quote
Elegant quote with attribution
stat
Highlight key statistics with big numbers
logo
Simple logo presentation with tagline
testimonial
Customer testimonial with avatar
simple
Minimalist design with customizable elements
grid
Grid layout for multiple items
changelog
Version update and feature highlights
photo
Photo-focused layout with overlay text
product
Product showcase with price and features
profile
User profile with social links
event
Event announcement with date and location
terminal
Code snippet or terminal output display
editorial
Magazine-style editorial layout
podcast
Podcast episode with episode number
newsletter
Newsletter header with subscribe CTA
course
Course promotion with modules list
Examples
Basic Example
https://ogimagex.xyz/api/public/og/showcase?title=Hello+World&subtitle=My+First+OG+Image&url=example.com&accent=%237c3aedCustom Size
https://ogimagex.xyz/api/public/og/showcase?title=Custom+Size&w=800&h=600&format=pngSVG Format
https://ogimagex.xyz/api/public/og/blog?title=Blog+Post&author=John+Doe&format=svgQuote Template
https://ogimagex.xyz/api/public/og/quote?text=The+only+way+to+do+great+work+is+to+love+what+you+do&author=Steve+JobsOutput Formats
PNG (Default)
Raster image format, perfect for social media platforms. Supports transparency and is widely compatible.
SVG
Vector image format, ideal for scaling without quality loss. Best for print or when you need to edit the image later.
Caching
All API responses are cached for 1 hour to improve performance and reduce server load. The cache key is based on the full URL including all parameters.
Cache Headers
Cache-Control: public, max-age=3600, s-maxage=3600Access-Control-Allow-Origin: *
Rate Limits
The API is currently free to use with no rate limits. However, we reserve the right to implement rate limits in the future to ensure fair usage and service stability.
Note: For high-volume usage or commercial applications, please contact us for enterprise solutions.
Need Help?
If you have questions or need assistance with the API, please check our FAQ page or contact us directly.