API Documentation
Getting Started
SnapOG provides a simple API to generate Open Graph images for your web pages. To get started, you'll need an API key which you can obtain from your dashboard after signing up.
Base URL
All API requests should be made to:
Authentication
All API requests require an API key which should be included in the URL path.
Endpoints
Generate an Open Graph image for a specific URL.
HTTP Request
Parameters
Parameter | Type | Required | Description |
---|---|---|---|
url | Query Parameter | Yes | The URL to generate an OG image for |
Example Request
Example Usage in HTML
Response
The API returns a PNG image if successful. In case of an error, it returns a JSON response with an error message.
Legacy Endpoint
For backward compatibility, the old endpoint /api/get
is still supported but we recommend using the new endpoint for new integrations.
Best Practices
- Always URL encode the url parameter to ensure proper handling
- Consider caching the generated images on your end for better performance
Error Codes
Status Code | Description |
---|---|
400 | Missing URL or API key ||Insufficient credits |
401 | Invalid API key |
404 | Invalid URL ||Domain not found |
500 | Internal server error |