Skip to main content

Endpoint

POST https://api.bunny.build/api/v1/social-metadata

Authentication

HeaderRequiredValue
X-API-KeyYesYour API key (bun_...)
Content-TypeYesapplication/json

Overview

Fetch and parse Open Graph tags, Twitter Card metadata, and standard HTML meta tags from any public URL. Returns a structured object with title, description, image, and social-sharing properties, ready to use in link preview components, content ingestion pipelines, or SEO auditing tools.

Use cases

  • Render rich link previews in chat apps or social feeds
  • Audit Open Graph completeness across your own pages
  • Ingest external article metadata for content curation tools
  • Populate sharing previews when users paste links

Details

The API fetches the target URL server-side and parses HTML meta tags. JavaScript-rendered pages may return incomplete metadata. Redirects are followed automatically. Private or auth-gated URLs will return empty or partial data.

Request body

FieldTypeRequiredDescription
urlstringYesPublic URL to extract metadata from

Example

{
  "url": "https://bunny.build"
}

Response

200 OK

FieldTypeDescription
urlstringThe URL that was fetched
titlestring|nullPage title (og:title or <title>)
descriptionstring|nullPage description (og:description or <meta name="description">)
imagestring|nullOG image URL
site_namestring|nullog:site_name value
faviconstring|nullFavicon URL (discovered from <link rel="icon">, or /favicon.ico)
twitterobjectTwitter Card metadata
twitter.cardstring|nulltwitter:card value (e.g. summary_large_image)
twitter.titlestring|nulltwitter:title value
Example
{
  "url": "https://bunny.build",
  "title": "Bunny — APIs for developers",
  "description": "Build faster with Bunny's ready-to-use API toolkit.",
  "image": "https://bunny.build/og.png",
  "site_name": "Bunny",
  "favicon": "https://bunny.build/favicon.ico",
  "twitter": {
    "card": "summary_large_image",
    "title": "Bunny — APIs for developers"
  }
}

401 Unauthorized

{
  "detail": "Missing API key. Include X-API-Key header."
}

402 Payment Required

{
  "detail": "Monthly quota exceeded. Upgrade your plan."
}

422 Unprocessable Entity

{
  "detail": "Invalid or unreachable URL"
}

429 Too Many Requests

{
  "detail": "Rate limit exceeded. Try again in 60 seconds."
}

cURL example

curl -X POST https://api.bunny.build/api/v1/social-metadata \
  -H "X-API-Key: bun_your_api_key" \
  -H "Content-Type: application/json" \
  -d '{"url": "https://bunny.build"}'