Open Graph and meta tag extractor

Pull the title, description, canonical link, Open Graph, Twitter card, favicons and JSON-LD out of HTML.

Input

The HTML of the page (the head section is enough).

Result

Fill in the input and press Run.

Your input is processed in memory and then discarded. It is not stored or logged. Even so, don't paste live passwords or keys into any online tool.

Use it from code or an agent

curl -s https://setget.net/v1/tools/og-tags-extract \
  -H 'Content-Type: application/json' \
  -d '{"input":{"text":"<head><title>Demo</title><meta name=\"description\" content=\"A demo page.\"><link rel=\"canonical\" href=\"https://example.com/\"><meta property=\"og:title\" content=\"Demo page\"><meta property=\"og:image\" content=\"https://example.com/a.png\"><meta name=\"twitter:card\" content=\"summary\"><link rel=\"icon\" href=\"/favicon.ico\"><script type=\"application/ld+json\">{\"@context\":\"https://schema.org\",\"@type\":\"WebSite\",\"name\":\"Demo\"}</script></head>"}}'
import json, urllib.request

body = {'input': {'text': '<head><title>Demo</title><meta name="description" content="A demo page."><link rel="canonical" href="https://example.com/"><meta property="og:title" content="Demo page"><meta property="og:image" content="https://example.com/a.png"><meta name="twitter:card" content="summary"><link rel="icon" href="/favicon.ico"><script type="application/ld+json">{"@context":"https://schema.org","@type":"WebSite","name":"Demo"}</script></head>'}}
request = urllib.request.Request("https://setget.net/v1/tools/og-tags-extract", json.dumps(body).encode(),
                                 {"Content-Type": "application/json"})
print(json.load(urllib.request.urlopen(request))["result"])
const response = await fetch("https://setget.net/v1/tools/og-tags-extract", {
  method: "POST",
  headers: {"Content-Type": "application/json"},
  body: JSON.stringify({"input":{"text":"<head><title>Demo</title><meta name=\"description\" content=\"A demo page.\"><link rel=\"canonical\" href=\"https://example.com/\"><meta property=\"og:title\" content=\"Demo page\"><meta property=\"og:image\" content=\"https://example.com/a.png\"><meta name=\"twitter:card\" content=\"summary\"><link rel=\"icon\" href=\"/favicon.ico\"><script type=\"application/ld+json\">{\"@context\":\"https://schema.org\",\"@type\":\"WebSite\",\"name\":\"Demo\"}</script></head>"}}),
});
console.log((await response.json()).result);
Tool: run_tool
Arguments:
{
  "slug": "og-tags-extract",
  "input": {
    "text": "<head><title>Demo</title><meta name=\"description\" content=\"A demo page.\"><link rel=\"canonical\" href=\"https://example.com/\"><meta property=\"og:title\" content=\"Demo page\"><meta property=\"og:image\" content=\"https://example.com/a.png\"><meta name=\"twitter:card\" content=\"summary\"><link rel=\"icon\" href=\"/favicon.ico\"><script type=\"application/ld+json\">{\"@context\":\"https://schema.org\",\"@type\":\"WebSite\",\"name\":\"Demo\"}</script></head>"
  }
}
{
  "input": {
    "text": "<head><title>Demo</title><meta name=\"description\" content=\"A demo page.\"><link rel=\"canonical\" href=\"https://example.com/\"><meta property=\"og:title\" content=\"Demo page\"><meta property=\"og:image\" content=\"https://example.com/a.png\"><meta name=\"twitter:card\" content=\"summary\"><link rel=\"icon\" href=\"/favicon.ico\"><script type=\"application/ld+json\">{\"@context\":\"https://schema.org\",\"@type\":\"WebSite\",\"name\":\"Demo\"}</script></head>"
  }
}

Endpoint: POST /v1/tools/og-tags-extract. Over MCP: run_tool with slug: "og-tags-extract". Machine-readable: input schema, Markdown. Connect an agent.

Inputs

NameTypeRequiredWhat it does
text string yes The HTML of the page (the head section is enough).

Example

Input
{
  "text": "<head><title>Demo</title><meta name=\"description\" content=\"A demo page.\"><link rel=\"canonical\" href=\"https://example.com/\"><meta property=\"og:title\" content=\"Demo page\"><meta property=\"og:image\" content=\"https://example.com/a.png\"><meta name=\"twitter:card\" content=\"summary\"><link rel=\"icon\" href=\"/favicon.ico\"><script type=\"application/ld+json\">{\"@context\":\"https://schema.org\",\"@type\":\"WebSite\",\"name\":\"Demo\"}</script></head>"
}
Result
{
  "title": "Demo",
  "description": "A demo page.",
  "canonical": "https://example.com/",
  "og": {
    "og:title": "Demo page",
    "og:image": "https://example.com/a.png"
  },
  "twitter": {
    "twitter:card": "summary"
  },
  "favicons": [
    {
      "rel": "icon",
      "href": "/favicon.ico",
      "sizes": null,
      "type": null
    }
  ],
  "json_ld": [
    {
      "@context": "https://schema.org",
      "@type": "WebSite",
      "name": "Demo"
    }
  ],
  "missing": [
    "og:description",
    "og:url",
    "og:type"
  ]
}

Questions

What does "missing" list?
Tags that link previews in chat apps and social networks rely on: title, description, canonical, og:title, og:description, og:image, og:url, og:type and twitter:card.
What if a tag appears twice?
The first value is used, as most preview generators do.
What happens to broken JSON-LD?
The block is listed as {"error": ...} so you can see that it exists but does not parse.