POST
/api/url-metadata$0.001🌐 URL Metadata
Extract comprehensive metadata from any URL including Open Graph tags, Twitter card data, page title, description, favicon URL, canonical URL, and more. Ideal for link preview generation and content aggregation.
Request Body
Response Fields
Code Examples
cURL
bash
curl -X POST https://sparkforge.sh/api/url-metadata \
-H "Content-Type: application/json" \
-H "X-PAYMENT: <x402-payment-token>" \
-d '{"url": "https://github.com/vercel/next.js"}'Python
python
import requests
response = requests.post(
"https://sparkforge.sh/api/url-metadata",
headers={"Content-Type": "application/json", "X-PAYMENT": "<token>"},
json={"url": "https://github.com/vercel/next.js"}
)
data = response.json()
print(data["title"], data["description"])TypeScript / Node.js
typescript
const res = await fetch402("https://sparkforge.sh/api/url-metadata", {
method: "POST",
headers: { "Content-Type": "application/json" },
body: JSON.stringify({ url: "https://github.com/vercel/next.js" }),
});
const { title, description, image, og } = await res.json();Example Response
json
{
"title": "vercel/next.js: The React Framework",
"description": "The React Framework – created and maintained by Vercel.",
"image": "https://repository-images.githubusercontent.com/70107786/...",
"favicon": "https://github.com/favicon.ico",
"canonical": "https://github.com/vercel/next.js",
"og": {
"title": "vercel/next.js",
"type": "object",
"site_name": "GitHub"
},
"twitter": {
"card": "summary_large_image",
"site": "@github"
}
}💳 Payment via x402
This endpoint costs $0.001 per call, paid in USDC on Base, Polygon, or Solana. Use the @x402/fetch library to handle payments automatically, or implement the x402 handshake manually.
bash
# Free demo mode (no payment)
curl https://sparkforge.sh/api/url-metadata?demo=true
# Or try via MCP (Claude Desktop, Cursor, Windsurf)
# Add to mcp config: { "url": "https://sparkforge.sh/api/mcp" }