# ogpeek

> Inspect how OG cards render and catch OGP spec violations from a single URL.

HTML: https://minjun.kim/ogpeek/

**Peek into any page's Open Graph tags**

Paste a URL to see the card it renders, every meta tag it declares, and the OGP spec violations it ships with.

Try: [ogp.me](https://minjun.kim/ogpeek/inspect?url=ogp.me) · [github.com/minjun0219/ogpeek](https://minjun.kim/ogpeek/inspect?url=github.com%2Fminjun0219%2Fogpeek) · [nextjs.org](https://minjun.kim/ogpeek/inspect?url=nextjs.org)

## How it works

One URL goes through three steps. The same engine runs on this site's Workers, in your own Node server, and inside the browser extension.

```
URL → fetch → parse → validate → preview
```

1. **Fetch** (`ogpeek/fetch`): Follows redirects one hop at a time, within a timeout and a response-size cap. A guard hook runs before every hop, so the caller decides which hosts are reachable.
2. **Parse** (`parse()`): Builds a normalized Open Graph tree from real-world markup — structured properties like og:image:width attach to their parent — and extracts favicons, JSON-LD, and theme-color alongside it.
3. **Validate** (`result.warnings`): Flags missing required tags, relative URLs, duplicate declarations, and other common OGP spec violations as errors, warnings, or info.

## What it checks

Every warning carries a stable code and a severity, so you can filter on them in your own tooling.

- Error `OG_TITLE_MISSING`: og:title is missing
- Error `OG_TYPE_MISSING`: og:type is missing
- Error `OG_IMAGE_MISSING`: og:image is missing
- Error `OG_URL_MISSING`: og:url is missing
- Warning `OG_TITLE_TOO_LONG`: og:title exceeds 60 characters — truncated by KakaoTalk
- Warning `OG_URL_MISMATCH`: og:url host/path disagrees with the actual request URL
- Warning `OG_TYPE_UNKNOWN`: og:type value is not in the OGP spec whitelist
- Warning `URL_NOT_ABSOLUTE`: A URL-typed property is not absolute
- Warning `DUPLICATE_SINGLETON`: A single-valued property is declared more than once
- Warning `ORPHAN_STRUCTURED_PROPERTY`: A structured property appears with no parent
- Warning `INVALID_DIMENSION`: width/height failed integer parsing
- Warning `JSONLD_PARSE_ERROR`: A JSON-LD block did not parse as JSON
- Info `MISSING_PREFIX_ATTR`: `<html prefix>` is not declared

## Packages

The engine and the React components this site is built from, both published on npm.

### ogpeek

ogpeek parses, fetches, and validates OpenGraph tags from any URL. The fetcher traces redirects with timeout and size caps, the parser is tolerant of real-world markup, and the validator catches common OGP spec violations. One external dependency, runs on Node and edge runtimes alike.

```sh
npm install ogpeek
```

#### Quick start

```ts
import { parse } from "ogpeek";
import { fetchHtml } from "ogpeek/fetch";

const { html, finalUrl } = await fetchHtml(url);
const result = parse(html, { url: finalUrl });

result.ogp.title; // normalized Open Graph tree
result.warnings; // [{ code, severity, message }]
```

[View on npm](https://www.npmjs.com/package/ogpeek) · [README](https://github.com/minjun0219/ogpeek/tree/main/packages/ogpeek#readme)

### @ogpeek/react

If you render results in React, you can drop in the same Result, Preview, ValidationPanel, RedirectFlow, and TagTable components this site uses.

```sh
npm install @ogpeek/react
```

[View on npm](https://www.npmjs.com/package/@ogpeek/react) · [README](https://github.com/minjun0219/ogpeek/tree/main/packages/ogpeek-react#readme)

## Browser extension

Chrome · MV3

This site fetches pages from Cloudflare Workers, so it can't reach anything behind a VPN or on an intranet. The extension runs the same engine inside your browser — the request leaves your machine, not a server.

- Inspects the active tab's live DOM — no second request, same login state
- Fetches any other URL through the browser's own network stack
- Opens a full-tab view you can bookmark and share

[Install guide](https://github.com/minjun0219/ogpeek/tree/main/packages/ogpeek-extension#readme)

---

[GitHub](https://github.com/minjun0219/ogpeek) · [MIT License](https://github.com/minjun0219/ogpeek/blob/main/LICENSE) · [llms.txt](https://minjun.kim/ogpeek/llms.txt)
