Embedding profile card

This guide will help you integrate the Gravatar profile card into your website using the Gravatar Enhanced Plugin, the /oembed API endpoint, or directly embedding an <iframe>.

Embedding via /oembed API Endpoint

You can use the /oembed API to embed a profile card on any website. For more information about how oEmbed works, you can visit oEmbed.com.

API Endpoint:

 https://api.gravatar.com/v3/oembed

Parameters:

  • url (required): The Gravatar profile URL you want to embed.
    • Example format:
      • https://gravatar.com/{USERNAME}
      • https://es.gravatar.com/{USERNAME}, https://zh-TW.gravatar.com/{USERNAME}, etc.
    • Example request URL:
      • https://api.gravatar.com/v3/oembed?url=https%3A%2F%2Fgravatar.com%2Fmatt

API Response:

{
    "version": "1.0",
    "type": "rich",
    "title": "Gravatar Profile Card",
    "width": 415,
    "height": 228,
    "maxwidth": 415,
    "maxheight": 228,
    "html": "<iframe src=\"https://gravatar.com/username.card\" width=\"415\" height=\"228\" style=\"border:0; margin:0; padding:0;\"></iframe>",
    "provider_name": "Gravatar",
    "provider_url": "https://gravatar.com",
    "cache_age": 3600
}

Embedding via <iframe>

For a quick solution, you can embed the profile card using an <iframe>.

Example:

<iframe src="https://gravatar.com/{USERNAME}.card" width="415" height="228" style="border:0; margin:0; padding:0;"></iframe>

Note: The size of the Gravatar profile card is 415px by 228px (including the shadow effect). Ensure the iframe size matches or exceeds these dimensions.

Embedding with Gravatar Enhanced Plugin

For WordPress websites, use the Gravatar Enhanced Plugin to automatically embed a profile card when a valid Gravatar profile URL is provided.

  • Step 1: Install the Gravatar Enhanced Plugin via the following link: https://wordpress.org/plugins/gravatar-enhanced
  • Step 2: After installation, simply paste a valid Gravatar profile URL into your content. The profile card will be automatically embedded


Last updated on: