OpenGraphr API

Development / API Key Intermediate HTTPS
Varies by plan (check documentation)

Overview

OpenGraphr is a lightweight API that extracts Open Graph metadata from any publicly accessible URL, returning properties such as title, description, image, and site name in a clean JSON format. This saves you from writing your own HTML parser and handling edge cases like relative URLs or missing tags. It is a practical building block for link-preview features in messaging apps, social platforms, or content aggregators.

💡

Beginner Tip

You need a free API key from the provider. Pass the target URL as the "url" query parameter and your key as "api_key". The API makes a server-side request to fetch the page, so it bypasses CORS restrictions and works for any public URL. Always URL-encode the target URL before including it in the query string to avoid parsing errors.

Available Data

OpenGraphr data via REST API
JSON-formatted response data
Requires API key authentication

Example Response

JSON Response
{
  "status": "success",
  "data": {
    "result": "Data from OpenGraphr",
    "description": "Really simple API to retrieve Open Graph data from an URL",
    "timestamp": "2025-01-15T10:00:00Z"
  }
}

Field Reference

title The og:title value from the page, typically the article or page headline.
description The og:description meta content, usually a short summary of the page.
image Absolute URL of the og:image thumbnail used for link previews.
url Canonical URL of the page as declared in og:url.
site_name Name of the website as declared in og:site_name, e.g. "GitHub".

Implementation Example

const url = "https://opengraphr.com/docs/1.0/overview";
// Replace headers or query params with the values required by this API.
const response = await fetch(url, {
  headers: {
  "X-API-Key": "YOUR_API_KEY"
  }
});
if (!response.ok) throw new Error(`Request failed: ${response.status}`);
const data = await response.json();
console.log(data);

What Can You Build?

Note: These code examples are AI-generated and unverified. Always refer to the official API documentation for accurate usage.

Common Errors & Troubleshooting

Missing or null fields in response The target page does not include Open Graph meta tags for that property.
This is normal — many pages lack complete OG tags. Check for null/undefined before using each field and provide fallbacks (e.g. use <title> as a fallback for og:title).
401 or 403 error Invalid or missing api_key parameter.
Ensure you include api_key=YOUR_KEY in the query string and that the key is active.
Timeout or 500 error The target URL is slow to respond, requires JavaScript rendering, or is behind authentication.
Only use this API for publicly accessible, server-rendered pages. JavaScript-heavy SPAs may not return usable OG data.

Matrix Score Breakdown

🌐 Reachability 30/30
⚡ Speed 5/20
🔒 Security 15/15
🛠 Developer XP 12/20
✓ Reliability 10/15

Partially tested on Apr 5, 2026

Technical Specifications

Auth API Key
HTTPS REQUIRED
CORS UNKNOWN
Category Development
Difficulty Intermediate
Verified: 2026-04-07

Similar APIs

View All →