OpenGraph.io

Site (Unfurl) API

Extract OpenGraph metadata, Twitter Cards, and HTML meta tags from any URL to create rich link previews.

Endpoint

HTTP
GET https://opengraph.io/api/1.1/site/{encoded_url}?app_id=YOUR_APP_ID

Parameters

Path Parameters

ParameterTypeDescription
encoded_urlstringRequired. URL-encoded target URL

Query Parameters

ParameterTypeDefaultDescription
app_idstring-Required. Your API key
cache_okbooleantrueAllow cached results
full_renderbooleanfalseEnable JavaScript rendering for SPAs
use_proxybooleanfalseUse standard proxy
use_premiumbooleanfalseUse residential proxy
use_superiorbooleanfalseUse mobile proxy (highest success rate)
use_aibooleanfalseEnable AI enhancement for better metadata extraction
max_cache_agenumber432000Maximum cache age in seconds (default: 5 days)
accept_langstringen-USLanguage header
auto_proxybooleanfalseAutomatically select optimal proxy (eligible plans only)
proxy_countrystring-Specify proxy country code (e.g., US, GB, DE)

Retry Options

The retry feature automatically re-attempts failed requests using progressively stronger proxy levels to maximize success rates on difficult-to-scrape websites. Instead of a single failed request, the API will make multiple attempts, escalating through proxy tiers until it succeeds or exhausts all options.

ParameterTypeDefaultDescription
retrybooleanfalseEnable automatic retry with proxy escalation on failure
max_retriesnumber4Maximum retry attempts (1-4)
retry_escalatebooleantrueEscalate proxy level on each retry

How Retry Works

When retry=true is enabled:

  1. Initial Request — The API attempts the request at your specified proxy level (or no proxy)
  2. On Failure — If the request fails with a retryable error (timeout, 403, 429, 500-504), it automatically retries
  3. Proxy Escalation — Each retry escalates to a stronger proxy tier:
    • Attempt 1: No proxy (or your starting level)
    • Attempt 2: Standard proxy (use_proxy)
    • Attempt 3: Residential proxy (use_premium)
    • Attempt 4: Mobile proxy (use_superior)
  4. Success — Returns the result from whichever attempt succeeded
  5. Billing — You're only charged for the proxy level that succeeded

Response Metadata

When retry is used, the response includes retryInfo:

Retry Response
{
  "hybridGraph": { ... },
  "retryInfo": {
    "attempts": 2,
    "successfulProxyLevel": "use_premium",
    "creditCost": 3,
    "attemptDetails": [
      { "attempt": 1, "proxyLevel": null, "success": false, "error": "403" },
      { "attempt": 2, "proxyLevel": "use_premium", "success": true }
    ]
  }
}

Requirements: Retry requires access to the superior proxy tier (retry can escalate to any level). You're charged based on the successful proxy level, not failed attempts.

Example Request

curl "https://opengraph.io/api/1.1/site/https%3A%2F%2Fgithub.com?app_id=YOUR_APP_ID"

Example Response

Response
{
  "hybridGraph": {
    "title": "GitHub: Let's build from here",
    "description": "GitHub is where over 100 million developers shape the future of software.",
    "image": "https://github.githubassets.com/images/modules/site/social-cards/github-social.png",
    "url": "https://github.com/",
    "site_name": "GitHub",
    "type": "website",
    "favicon": "https://github.githubassets.com/favicons/favicon.svg"
  },
  "openGraph": {
    "title": "GitHub: Let's build from here",
    "description": "GitHub is where over 100 million developers...",
    "type": "website",
    "url": "https://github.com/",
    "site_name": "GitHub",
    "image": {
      "url": "https://github.githubassets.com/images/modules/site/social-cards/github-social.png"
    }
  },
  "htmlInferred": {
    "title": "GitHub: Let's build from here",
    "description": "GitHub is where over 100 million developers...",
    "favicon": "https://github.githubassets.com/favicons/favicon.svg"
  },
  "requestInfo": {
    "redirects": 0,
    "host": "github.com",
    "responseCode": 200
  }
}

Response Fields

FieldDescription
hybridGraphMerged data from OpenGraph, Twitter Cards, and HTML inference. Use this for best results.
openGraphRaw OpenGraph tags found on the page
twitterCardTwitter Card metadata if present
htmlInferredValues inferred from HTML (title tag, meta description, etc.)
requestInfoInformation about the request (redirects, response code)

Tip: Use hybridGraph for the most complete data. It intelligently merges data from all sources with smart fallbacks.

Use Cases

  • Generate link previews for messaging apps and social platforms
  • Content curation and aggregation tools
  • SEO analysis and monitoring
  • Social media management platforms

MCP Tool

This endpoint is available as the Get OG Data tool in the OpenGraph MCP Server. Your AI assistant can fetch metadata directly without writing any code.

Get started with MCP in 2 minutes →

Learn more about MCP integration →

Related