Tutorial

How to Extract Metadata from Any URL

Use the /v1/metadata endpoint to extract title, description, Open Graph tags, favicon, headings, and links from any webpage without taking a screenshot.

Steps

  1. Why use /v1/metadataThe dedicated metadata endpoint is faster and cheaper than a screenshot. It fetches and parses the page without rendering it visually. Great for link previews, AI agents, and SEO tools.
  2. Make the requestSend a GET request to /v1/metadata with the target URL as a query parameter and your API key in the x-api-key header.
  3. Parse the responseThe response JSON contains: title, description, og_title, og_image, og_type, favicon, viewport, canonical, language, headings (array), and links (array).
  4. Use the dataBuild link preview cards, feed AI agents, power SEO audits, or extract structured data at scale.

Code Examples

curl "https://snapapi.tech/v1/metadata?url=https://github.com" \
  -H "x-api-key: YOUR_KEY"
import requests

resp = requests.get(
    "https://snapapi.tech/v1/metadata",
    params={"url": "https://github.com"},
    headers={"x-api-key": "YOUR_KEY"}
)

data = resp.json()
print(data["title"])        # "GitHub ยท Build and ship software..."
print(data["description"])  # Meta description
print(data["og_image"])     # OG image URL
print(data["favicon"])      # Favicon URL
print(data["headings"])     # [{"level": 1, "text": "..."}, ...]
print(data["links"])        # [{"text": "...", "href": "..."}, ...]
const res = await fetch(
  "https://snapapi.tech/v1/metadata?url=https://github.com",
  { headers: { "x-api-key": "YOUR_KEY" } }
);

const data = await res.json();
console.log(data.title);        // Page title
console.log(data.og_title);     // OG title
console.log(data.og_image);     // OG image URL
console.log(data.favicon);      // Favicon URL
console.log(data.headings);     // Array of headings
console.log(data.links.length); // Number of links on page
Get Free API KeyFull API Docs