API Documentation
TryUnfurl provides a simple API to programmatically unfurl URLs and retrieve their metadata.
Overview
The API allows you to fetch metadata for any URL, including Open Graph tags, Twitter Cards, and basic HTML meta information.
Endpoint
POST /api/unfurl
Request
Send a JSON body with the URL you want to unfurl:
{
"url": "https://example.com/page"
}
Response
The API returns a comprehensive metadata object:
{
"success": true,
"data": {
"url": "https://example.com/page",
"basic": {
"title": "Page Title",
"description": "Page description from meta tag"
},
"openGraph": {
"title": "OG Title",
"description": "OG Description",
"image": "https://example.com/og-image.jpg",
"type": "website",
"siteName": "Example Site"
},
"twitterCard": {
"card": "summary_large_image",
"title": "Twitter Title",
"description": "Twitter description",
"image": "https://example.com/twitter-image.jpg"
},
"favicon": "https://example.com/favicon.ico"
}
}
Rate Limits
- Free tier: 100 requests per day
- Pro tier: 10,000 requests per day
- Enterprise: Unlimited
Error Handling
If an error occurs, the API returns:
{
"success": false,
"error": "Error message describing what went wrong"
}
Common error codes:
| Status | Description |
|---|---|
| 400 | Invalid URL format |
| 404 | URL not found |
| 429 | Rate limit exceeded |
| 500 | Server error |
Use Cases
- CMS Platforms - Auto-generate link previews for content editors
- Social Media Tools - Validate metadata before posting
- SEO Tools - Audit meta tags across websites
- Chat Applications - Generate rich link previews
Need help? Contact us at support@tryunfurl.com