Open Graph Creator

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 html output (ampersands, quotes and angle brackets), so a quote in a title cannot break the tag. The tags object holds the raw values.
  • url and imageUrl must 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-creator
Generate Open Graph meta tags

Request Body

Content-Type: application/json

ParameterTypeRequiredDescription
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
OptionalSite name for og:site_name, up to 200 characters.
imageUrl
string
OptionalPublic image URL for og:image, http or https, up to 2,000 characters.
imageAlt
string
OptionalAlt 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 https
401
Unauthorized - Invalid or missing API key
403
Forbidden - API key is inactive or expired, or the request IP is not allowed for this key
429
Too Many Requests - Rate limit exceeded
500
Internal Server Error

Code 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"
  }'

Ready to get started?

Create an API key to start using the Open Graph Creator API.

Rather use it in your browser? Open the Open Graph Creator