OGP (Open Graph Protocol) controls how a web page appears when shared on social platforms — the title, description, and thumbnail image shown in a link preview on Twitter (X), Facebook, Slack, and others. These are set via <meta property="og:title" content="..."> tags in the page's HTML.
So why not just fetch the page HTML directly in the browser? This is where CORS (Cross-Origin Resource Sharing) comes in. Browsers restrict cross-origin fetch requests for security reasons — unless the target server explicitly allows it, the browser will block the response. Most websites don't include the headers needed to allow this.
To work around this, the tool sends the URL to /api/ogp?url=..., where a Vercel serverless function fetches the page on the server side. Servers have no CORS restrictions, so they can retrieve any page's HTML. The function then extracts og:title, twitter:card, and other meta tags using regular expressions, and returns the results as JSON.
The tool uses that data to display each tag's value, flag missing entries, and warn about things like titles that are too long.