Open Graph, Twitter Card & SEO extraction from any URL
URL Metadata API
The URL Metadata API turns any web page into clean, structured JSON. Give it a URL and it fetches the page with a real browser User-Agent, follows redirects, and parses the HTML to extract the title, meta description and keywords, canonical link, charset, html lang, every Open Graph tag, every Twitter Card tag, and all favicons.
Built on Cloudflare's edge network with a streaming HTMLRewriter parser, it never buffers giant pages into memory and responds in milliseconds. Relative canonical, og:image and favicon URLs are automatically resolved to absolute URLs against the final post-redirect address, and non-HTML responses are detected and returned gracefully instead of producing garbage.
Free tier included, no credit card required. One key works across all 49 APIs.
- Response Time
- <300ms
- Metadata Fields
- 10+
- Uptime SLA
- 99.9%
Key features
- Title, description, keywords, canonical, charset and html lang extraction
- Every Open Graph (og:*) tag returned as structured key/value pairs
- Every Twitter Card (twitter:*) tag captured
- All favicons with rel, href, sizes and type, plus optional /favicon.ico fallback
- Relative og:image, canonical and favicon URLs resolved to absolute
- Follows redirects and reports both the original and final URL
- Streaming HTMLRewriter parser — large pages never fully buffered
- Built-in SSRF guard rejects localhost and private-range hosts
Built for
- Rich link previews in chat and social apps
- Generating share cards and unfurled URLs
- Bulk SEO and metadata audits
- Competitor and brand page monitoring
- Enriching URL-based datasets and bookmarks
- Content pipelines and CMS imports
- Validating Open Graph and Twitter Card markup
- Building reading lists and content aggregators
Try it
Build the request for your data
Edit the parameters below and see the exact curl command and JSON response you will get. No key required to preview.
Parameters
GET /url-metadata/url-metadata/v1/extract?url=https%3A%2F%2Fwww.example.com%2Fblog%2Flaunch&apikey=YOUR_KEY HTTP/1.1
Host: api.apicodex.io
{
"url": "https://www.example.com/blog/launch",
"final_url": "https://www.example.com/blog/launch",
"status": 200,
"content_type": "text/html; charset=utf-8",
"title": "We just launched — Example Blog",
"description": "Read about our brand new product launch and what it means for you.",
"keywords": ["launch", "product", "example", "news"],
"canonical": "https://www.example.com/blog/launch",
"lang": "en",
"charset": "utf-8",
"open_graph": {
"og:title": "We just launched",
"og:type": "article",
"og:image": "https://www.example.com/img/launch-hero.png"
},
"twitter": {
"twitter:card": "summary_large_image",
"twitter:image": "https://www.example.com/img/launch-hero.png"
},
"favicons": [
{ "rel": "icon", "href": "https://www.example.com/favicon-32.png", "sizes": "32x32", "type": "image/png" }
],
"images": ["https://www.example.com/img/launch-hero.png"]
}Documentation
URL Metadata API Documentation
The URL Metadata API fetches a target URL with a browser-like User-Agent (following redirects) and parses the HTML with Cloudflare's streaming HTMLRewriter to extract SEO, Open Graph, Twitter Card, favicon and page metadata. Relative canonical, og:image and favicon URLs are resolved to absolute against the final response URL. A single GET /v1/extract endpoint covers every use case.
Base URL
https://api.apicodex.io/url-metadataAuthentication
Pass your API key as the ?apikey= query parameter, or send it in an X-Api-Key header. Both work on every endpoint.
# Query parameter
GET /url-metadata/v1/extract?url=https://example.com&apikey=YOUR_KEY
# Header
{
"X-Api-Key": "YOUR_API_KEY"
}Request and response
Illustrative values. Confirm current endpoint behavior, quotas, and data freshness in the API documentation before production use.
GET /url-metadata/v1/extract?url=https://www.example.com/blog/launch&apikey=YOUR_KEY HTTP/1.1{
"url": "https://www.example.com/blog/launch",
"final_url": "https://www.example.com/blog/launch",
"status": 200,
"content_type": "text/html; charset=utf-8",
"title": "We just launched — Example Blog",
"description": "Read about our brand new product launch and what it means for you.",
"keywords": ["launch", "product", "example", "news"],
"canonical": "https://www.example.com/blog/launch",
"lang": "en",
"charset": "utf-8",
"open_graph": {
"og:title": "We just launched",
"og:type": "article",
"og:image": "https://www.example.com/img/launch-hero.png"
},
"twitter": {
"twitter:card": "summary_large_image",
"twitter:image": "https://www.example.com/img/launch-hero.png"
},
"favicons": [
{ "rel": "icon", "href": "https://www.example.com/favicon-32.png", "sizes": "32x32", "type": "image/png" }
],
"images": ["https://www.example.com/img/launch-hero.png"]
}Code examples
curl --request GET \
--url 'https://api.apicodex.io/url-metadata/v1/extract?url=https://www.example.com/blog/launch' \
--header 'X-Api-Key: YOUR_API_KEY'Endpoints
GET /v1/extract
Fetch the target URL and extract title, meta description/keywords, canonical link, charset, html lang, all Open Graph tags, all Twitter Card tags, favicons and Open Graph images. Returns base fields with a note for non-HTML responses.
/v1/extract?url=https://www.example.com/blog/launchParameters
Required parameters
urlThe page URL to inspect. Must use http:// or https://.
Optional parameters
timeout_msUpstream fetch timeout in milliseconds. Default 10000, capped at 20000.favicon_fallbackIf no icon link is found in the HTML, include the conventional /favicon.ico guess (flagged with "default": true). Default true.block_privateReject localhost / private-range literal hosts (best-effort SSRF guard). Set to false to allow such hosts. Default true.
Pricing
URL Metadata API Pricing
One key, one subscription, all 49 APIs. Start free and upgrade when you grow. No minimums, no lock-in.
This API costs 5 credits per request. Credits are shared across every API on your plan.
Estimate your monthly cost
Drag the slider to match your expected request volume. We will recommend the cheapest plan that covers it.
Recommended plan
Starter
$29.99 /month
Free
- All 49 APIs included
- No credit card required
- Full documentation and examples
Starter
Popular- All 49 APIs included
- Email support
- Usage dashboard and analytics
Pro
- All 49 APIs included
- Priority support
- Up to 5 API keys
Need a different plan?
Tell us about your API, volume, or support requirements.
Coming soon · MCP
Use the URL Metadata API from your AI agent
The API Codex MCP server will expose this API, and the other 39, to Claude, Cursor and any MCP client as tools. Same key, same credits, one config entry.
FAQ
Frequently asked questions
A single call to /v1/extract returns the page title, meta description and keywords, canonical link, charset, html lang attribute, every Open Graph (og:*) tag, every Twitter Card (twitter:*) tag, all favicons (with rel, href, sizes and type), Open Graph image URLs, and request metadata including the original url, the final_url after redirects, the HTTP status and the content_type.
Yes. The API fetches the target URL with a browser-like User-Agent and follows redirects, reporting both the original url you supplied and the final_url after redirection. Relative URLs for the canonical link, og:image and favicons are automatically resolved to absolute URLs against the final post-redirect response URL, so the data you get back is ready to render without further normalization.
Non-HTML responses such as PDFs, images and JSON are detected via the content_type header. Instead of returning garbage, the API responds with the base request fields (url, final_url, status, content_type), empty metadata collections (open_graph, twitter, favicons, images), and an explanatory note field so your integration can handle these cases gracefully.
Yes. By default (block_private=true) the API includes a best-effort SSRF guard that rejects requests to localhost and private-range literal hosts, preventing the endpoint from being used to probe internal infrastructure. If you control the input and need to inspect internal pages, you can disable this with block_private=false.
Use the optional timeout_ms parameter, which sets the upstream fetch timeout in milliseconds. It defaults to 10000ms and is capped at 20000ms. If the target page fails to load or exceeds the timeout, the API returns a 502 response with an error and detail message so you can retry or skip that URL.
The API runs on Cloudflare's global edge network across 300+ locations and typically responds in under 300ms. It parses HTML with a streaming HTMLRewriter rather than a DOM library, so even very large pages are never fully buffered into memory — metadata is extracted as the bytes stream through, keeping memory usage flat and responses fast.
Absolutely. The API is ideal for generating rich link previews, share cards, bulk SEO and metadata audits, and dataset enrichment. Fan out requests in parallel within your plan's rate limit (5 req/s on Basic, 20 on Pro, 50 on Ultra), cache results since page metadata changes infrequently, and persist the final_url to deduplicate links that resolve to the same destination.
Keep building
Related APIs
Query DNS records with forward and reverse lookups for A, AAAA, MX, TXT, NS and more in structured JSON.
Retrieve domain registration information, ownership details, expiration dates and registrar data for any domain.
Extract structured data from search engine results pages including organic results and rich snippets.