Metadata Options

Extract metadata from pages alongside screenshots, including titles, descriptions, Open Graph tags, Twitter cards, and more.

Configuration

{
  "metadata": {
    "include": ["title", "description", "favicon", "og", "twitter", "fonts", "size"]
  }
}

Available Metadata

Option Description
title Page <title> tag
description Meta description
favicon Favicon URL
og Open Graph tags
twitter Twitter card tags
fonts Fonts used on page
size Output image dimensions
status HTTP response status code
headers HTTP response headers

Basic Usage

Extract all common metadata:

{
  "url": "https://example.com",
  "metadata": {
    "include": ["title", "description", "favicon", "og", "twitter"]
  }
}

Metadata in Response

Response Headers (Binary Response)

When receiving the image binary, metadata is in headers:

X-Screenshot-Title: Example Domain
X-Screenshot-Description: This is an example website
X-Screenshot-Favicon: https://example.com/favicon.ico
X-Screenshot-Width: 1200
X-Screenshot-Height: 630
X-Screenshot-OG-Title: Example - Open Graph Title
X-Screenshot-OG-Image: https://example.com/og.png

JSON Response

With Accept: application/json:

{
  "id": "req_abc123",
  "status": "completed",
  "image": {
    "url": "https://cdn.renderscreenshot.com/xyz789.png",
    "width": 1200,
    "height": 630
  },
  "metadata": {
    "title": "Example Domain",
    "description": "This is an example website",
    "favicon": "https://example.com/favicon.ico",
    "og": {
      "title": "Example - Open Graph Title",
      "description": "Open Graph description",
      "image": "https://example.com/og.png",
      "url": "https://example.com",
      "type": "website",
      "site_name": "Example"
    },
    "twitter": {
      "card": "summary_large_image",
      "title": "Example - Twitter Title",
      "description": "Twitter description",
      "image": "https://example.com/twitter.png",
      "site": "@example"
    }
  }
}

Metadata Types

Title and Description

Basic page metadata:

{
  "metadata": {
    "include": ["title", "description"]
  }
}

Response:

{
  "metadata": {
    "title": "Example Domain",
    "description": "This is an example website"
  }
}

Open Graph Tags

Extract og:* meta tags:

{
  "metadata": {
    "include": ["og"]
  }
}

Response:

{
  "metadata": {
    "og": {
      "title": "Example Title",
      "description": "Example description",
      "image": "https://example.com/og.png",
      "url": "https://example.com",
      "type": "website",
      "site_name": "Example Site"
    }
  }
}

Twitter Card Tags

Extract twitter:* meta tags:

{
  "metadata": {
    "include": ["twitter"]
  }
}

Response:

{
  "metadata": {
    "twitter": {
      "card": "summary_large_image",
      "title": "Twitter Title",
      "description": "Twitter description",
      "image": "https://example.com/twitter.png",
      "site": "@handle",
      "creator": "@author"
    }
  }
}

Favicon

Get the page's favicon URL:

{
  "metadata": {
    "include": ["favicon"]
  }
}

Response:

{
  "metadata": {
    "favicon": "https://example.com/favicon.ico"
  }
}

Fonts

List fonts used on the page:

{
  "metadata": {
    "include": ["fonts"]
  }
}

Response:

{
  "metadata": {
    "fonts": [
      "Inter",
      "Roboto",
      "system-ui"
    ]
  }
}

Image Size

Get the output image dimensions:

{
  "metadata": {
    "include": ["size"]
  }
}

Response:

{
  "metadata": {
    "size": {
      "width": 1200,
      "height": 630,
      "bytes": 123456
    }
  }
}

HTTP Status and Headers

Get the page's HTTP response info:

{
  "metadata": {
    "include": ["status", "headers"]
  }
}

Response:

{
  "metadata": {
    "status": 200,
    "headers": {
      "content-type": "text/html; charset=utf-8",
      "cache-control": "public, max-age=3600"
    }
  }
}

Common Patterns

Generate a link preview with metadata:

{
  "url": "https://example.com/article",
  "preset": "link_preview",
  "metadata": {
    "include": ["title", "description", "favicon"]
  }
}

Social Card Audit

Check OG and Twitter tags alongside screenshot:

{
  "url": "https://myblog.com/post",
  "preset": "og_card",
  "metadata": {
    "include": ["og", "twitter"]
  }
}

Full Page Analysis

{
  "url": "https://example.com",
  "metadata": {
    "include": ["title", "description", "favicon", "og", "twitter", "fonts", "status"]
  }
}

Examples

Get Metadata with Screenshot

curl -X POST https://api.renderscreenshot.com/v1/screenshot \
  -H "Authorization: Bearer rs_live_xxxxx" \
  -H "Content-Type: application/json" \
  -H "Accept: application/json" \
  -d '{
    "url": "https://example.com",
    "preset": "og_card",
    "metadata": {
      "include": ["title", "description", "og", "twitter", "favicon"]
    }
  }'

Metadata-Only Request

To get just metadata without saving the screenshot, use a small viewport and skip storage:

{
  "url": "https://example.com",
  "viewport": { "width": 100, "height": 100 },
  "metadata": {
    "include": ["title", "description", "og", "twitter"]
  },
  "cache": { "enabled": false }
}

See Also

Was this page helpful?