URL Metadata API
Fetch any URL and get its title, description, Open Graph and Twitter Card tags, favicon, canonical, feeds and JSON-LD as JSON.
Give a public url and the API fetches the page (following redirects) and parses its <head>: title, description, preview image and alt text, site name, type, locale, language, canonical URL, author, keywords, published time, theme color and robots directive. Values fall back from Open Graph to Twitter Card to standard meta tags, and image and icon URLs are made absolute.
The response also includes all open_graph, twitter_card and other meta tags, the list of icons (with the first one as favicon, or /favicon.ico), RSS/Atom feeds, alternates (hreflang links), up to 5 parsed json_ld blocks, plus the final URL, HTTP status, content type, redirect chain and response time. For non-HTML URLs only the basic fields are returned.
Results are cached for 1 hour per URL; add fresh=true to bypass the cache. The page is read up to 1.5 MB, with a 10 second timeout and at most 8 redirects. Only public http/https hosts are allowed.
Parameters
| Name | In | Type | Required | Default | |
|---|---|---|---|---|---|
url | body|query | string | yes | Public http/https URL of the page (max 4096 characters). | |
fresh | body|query | boolean | no | false | Bypass the 1-hour cache and fetch the page again. |
Example
curl "https://apibox.io.vn/v1/url-metadata?url=https://github.com" \
-H "Authorization: Bearer YOUR_API_KEY"const res = await fetch('https://apibox.io.vn/v1/url-metadata?url=https://github.com', {
method: 'GET',
headers: {
Authorization: 'Bearer YOUR_API_KEY',
},
});
const data = await res.json();
console.log(data);import requests
res = requests.get(
"https://apibox.io.vn/v1/url-metadata?url=https://github.com",
headers={"Authorization": "Bearer YOUR_API_KEY"},
timeout=30,
)
print(res.json())<?php
$ch = curl_init('https://apibox.io.vn/v1/url-metadata?url=https://github.com');
curl_setopt_array($ch, [
CURLOPT_RETURNTRANSFER => true,
CURLOPT_HTTPHEADER => ['Authorization: Bearer YOUR_API_KEY'],
]);
$response = curl_exec($ch);
print_r(json_decode($response, true));Response
{
"url": "https://github.com/",
"final_url": "https://github.com/",
"status": 200,
"content_type": "text/html; charset=utf-8",
"redirects": [],
"response_ms": 461,
"title": "GitHub · Change is constant. GitHub keeps you ahead. · GitHub",
"description": "Join the world's most widely adopted, AI-powered developer platform where millions of developers, businesses, and the largest open source community build software that advances humanity.",
"image": "https://images.ctfassets.net/8aevphvgewt8/76epZKB2wF998m4e4bLLXn/c505f20b00ec70b88b1be5aec42c4be4/OG_image.jpg",
"image_alt": "Join the world's most widely adopted, AI-powered developer platform where millions of developers, businesses, and the largest open source community build software that advances humanity.",
"site_name": "GitHub",
"type": "object",
"locale": null,
"lang": "en",
"canonical": "https://github.com/",
"author": null,
"keywords": [],
"published_time": null,
"theme_color": "#1e2327",
"robots": null,
"favicon": "https://github.githubassets.com/favicons/favicon.png",
"icons": [
{
"href": "https://github.githubassets.com/favicons/favicon.png",
"rel": "alternate icon",
"type": "image/png"
},
{
"href": "https://github.githubassets.com/favicons/favicon.svg",
"rel": "icon",
"type": "image/svg+xml"
}
],
"feeds": [],
"alternates": [
"https://github.com/",
"https://github.com/?locale=pt-br",
"https://github.com/?locale=ja"
],
"open_graph": {
"image": "https://images.ctfassets.net/8aevphvgewt8/76epZKB2wF998m4e4bLLXn/c505f20b00ec70b88b1be5aec42c4be4/OG_image.jpg",
"site_name": "GitHub",
"type": "object",
"title": "GitHub · Change is constant. GitHub keeps you ahead. · GitHub",
"url": "https://github.com/",
"description": "Join the world's most widely adopted, AI-powered developer platform..."
},
"twitter_card": {
"site": "@github",
"card": "summary_large_image",
"title": "GitHub · Change is constant. GitHub keeps you ahead. · GitHub"
},
"meta": {
"viewport": "width=device-width",
"description": "Join the world's most widely adopted, AI-powered developer platform..."
},
"json_ld": []
}
Use cases
- Build link previews (cards) in chat apps, CMS or social feeds
- Audit Open Graph and Twitter Card tags before sharing a page
- Collect titles, favicons and descriptions for bookmarks
- Discover RSS feeds and structured data (JSON-LD) of a website
FAQ
How do I get the Open Graph image of a URL?
Call /v1/url-metadata?url=... and read image (og:image, falling back to twitter:image) or the full open_graph object.
Are results cached?
Yes, for 1 hour per URL. Add fresh=true to fetch the page again, for example right after updating your meta tags.
Does it follow redirects?
Yes, up to 8 redirects. The response contains final_url and the redirects chain with each status code.
Related APIs
HTTP Headers
See the HTTP status and every response header of a URL, with a summary of security headers like HSTS, CSP and X-Frame-Options.
301Redirect Checker
Follow every 301, 302, 307 and 308 redirect of a URL and get the full chain with status codes, the final URL and the number of hops.
BOTrobots.txt Parser
Fetch and parse the robots.txt of any site into user-agent groups, allow/disallow rules and sitemaps, and test if a path is crawlable.