
Open Graph Creator API
Marketing
Create optimized Open Graph tags for social media sharing. Preview your link card and generate meta tags to improve link appearance on Facebook, Twitter, LinkedIn, and other platforms.
Authentication
All API requests require a valid API key passed in the Authorization header as a Bearer token.
Rate Limit
120 requests per minute
Endpoints
1 endpoint available
Overview
Builds Open Graph and Twitter card meta tags for a page. It only builds the tags: the image URL is written into the tag and is never fetched or checked.
Generated tags
- og:title, og:description, og:url - always present
- og:type - always
website - og:site_name - when siteName is given
- og:image - when imageUrl is given
- og:image:alt - when imageAlt is given
- twitter:card - always
summary_large_image
Notes
- Values are HTML-escaped in the
htmloutput (ampersands, quotes and angle brackets), so a quote in a title cannot break the tag. Thetagsobject holds the raw values. urlandimageUrlmust start with http:// or https://.- Use an image of 1200 x 630 pixels (1.91:1) at a public https address.
Endpoints
POST
https://opentools.ca/api/v1/tools/open-graph-creatorGenerate Open Graph meta tags
Request Body
Content-Type: application/json
| Parameter | Type | Required | Description |
|---|---|---|---|
| title | string | Required | Page title for og:title, 1 to 300 characters. |
| description | string | Required | Page description for og:description, 1 to 1,000 characters. |
| url | string | Required | Canonical page URL, http or https, up to 2,000 characters. |
| siteName | string | Optional | Site name for og:site_name, up to 200 characters. |
| imageUrl | string | Optional | Public image URL for og:image, http or https, up to 2,000 characters. |
| imageAlt | string | Optional | Alt text for og:image:alt, up to 500 characters. |
Response Example
{
"success": true,
"tags": {
"og:title": "My Awesome Article",
"og:description": "Learn about the latest trends in web development.",
"og:url": "https://example.com/article",
"og:type": "website",
"og:site_name": "Example Site",
"og:image": "https://example.com/og-image.png",
"og:image:alt": "Article preview image",
"twitter:card": "summary_large_image"
},
"html": "<meta property=\"og:title\" content=\"My Awesome Article\" />\n<meta property=\"og:description\" content=\"Learn about the latest trends in web development.\" />\n<meta property=\"og:url\" content=\"https://example.com/article\" />\n<meta property=\"og:type\" content=\"website\" />\n<meta property=\"og:site_name\" content=\"Example Site\" />\n<meta property=\"og:image\" content=\"https://example.com/og-image.png\" />\n<meta property=\"og:image:alt\" content=\"Article preview image\" />\n<meta name=\"twitter:card\" content=\"summary_large_image\" />"
}Error Codes
400
Bad Request - Missing title, description or url, a value too long, or a URL that is not http or https401
Unauthorized - Invalid or missing API key403
Forbidden - API key is inactive or expired, or the request IP is not allowed for this key429
Too Many Requests - Rate limit exceeded500
Internal Server ErrorCode Examples
curl -X POST https://opentools.ca/api/v1/tools/open-graph-creator \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"title": "10 Tips for Better Web Performance",
"description": "Proven techniques to make your website faster.",
"url": "https://myblog.com/web-performance-tips",
"siteName": "My Tech Blog",
"imageUrl": "https://myblog.com/images/og-performance.png",
"imageAlt": "Web performance illustration"
}'Rather use it in your browser? Open the Open Graph Creator