OG Meta Tags API Documentation

Complete reference for the OG Meta Tags API

Authentication

Pass your API key via header or query parameter:

Authorization: Bearer sk_live_your_key_here
Query: ?api_key=sk_live_your_key_here

GET POST /v1/meta/extract

Parameters

Field Type Required Description
urlstringyesURL to extract meta tags from (http/https)

Success Response (200)

{
  "success": true,
  "data": {
    "url": "https://github.com",
    "title": "GitHub",
    "description": "Where the world builds software",
    "image": "https://github.githubassets.com/images/og-image.png",
    "site_name": "GitHub",
    "type": "website",
    "locale": "en",
    "og": { ... },
    "twitter": { ... },
    "meta": { ... },
    "general": { ... },
    "duration_ms": 230
  }
}

Response Fields

Field Description
titleBest title found (og:title > <title>)
descriptionBest description found (og:description > meta description)
imagePrimary social image (og:image > twitter:image)
ogAll Open Graph properties as key-value object
twitterAll Twitter Card properties
metaStandard meta tags (description, keywords, author, robots)
generalPage title, canonical URL, favicon, language

Code Examples

JavaScript

const res = await fetch(
  `https://snapapis.com/api/v1/meta/extract?api_key=${KEY}&url=${encodeURIComponent(url)}`
);
const { data } = await res.json();
console.log(data.title, data.image);

Python

import requests

r = requests.get('https://snapapis.com/api/v1/meta/extract',
    params={'api_key': KEY, 'url': 'https://github.com'})
data = r.json()['data']
print(data['og'])