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

GET/api/public/og/{template}

Replace {template} with the template name you want to use.

Parameters

Query Parameters

ParameterTypeRequiredDescription
formatstringNoOutput format: png or svg (default: png)
wintegerNoImage width (200-2400, default: 1200)
hintegerNoImage height (200-2400, default: 630)
*variesvariesTemplate-specific parameters (see templates below)

Available Templates

Examples

Basic Example

https://ogimagex.xyz/api/public/og/showcase?title=Hello+World&subtitle=My+First+OG+Image&url=example.com&accent=%237c3aed

Custom Size

https://ogimagex.xyz/api/public/og/showcase?title=Custom+Size&w=800&h=600&format=png

SVG Format

https://ogimagex.xyz/api/public/og/blog?title=Blog+Post&author=John+Doe&format=svg

Quote Template

https://ogimagex.xyz/api/public/og/quote?text=The+only+way+to+do+great+work+is+to+love+what+you+do&author=Steve+Jobs

Output 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=3600
  • Access-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.