API 文档
MetaFetch Open Graph 提取 API v1
快速开始
- 在 /login 使用邮箱/密码或 Google 登录。
- 打开控制台并生成免费 API 密钥(mf_live_...)。
- 使用 Authorization: Bearer 您的密钥调用 GET /api/v1/preview。
请始终使用带 www 的规范 URL(如 https://www.metafetch.dev)。不带 www 的域名会重定向并可能丢失 Authorization 头。
端点
GET https://www.metafetch.dev/api/v1/preview?url={encoded_url}身份验证
Authorization: Bearer mf_live_your_api_key
示例(bash)
curl "https://www.metafetch.dev/api/v1/preview?url=https://github.com" \ -H "Authorization: Bearer mf_live_your_api_key"
示例(PowerShell)
curl.exe "https://www.metafetch.dev/api/v1/preview?url=https://github.com" ` -H "Authorization: Bearer mf_live_your_api_key"
响应
{
"success": true,
"data": {
"url": "https://github.com",
"title": "GitHub",
"description": "...",
"image": "https://...",
"favicon": "https://...",
"siteName": "GitHub",
"canonical": "https://github.com",
"locale": "en_US",
"type": "website"
}
}演示(无需密钥)
无需密钥的公开演示仅适用于 example.com 和 github.com。
GET https://www.metafetch.dev/api/v1/preview?url=https://example.com GET https://www.metafetch.dev/api/v1/preview?url=https://github.com
错误
401 Unauthorized — missing/invalid API key 429 Too Many Requests — quota or rate limit exceeded 400 Bad Request — invalid URL 502 Bad Gateway — upstream fetch failed