コンテンツへスキップ

WordPress.com oEmbed プロバイダー

このテキストは AI を使用して翻訳されました。英語の原文を表示するには、こちらをクリックしてください。

WordPress.com でホストされているすべての投稿、固定ページ、添付ファイル、および VideoPress 動画は、公開 oEmbed API を通じて oEmbed フォーマットをサポートしています。

oEmbed フォーマットとは?

oEmbed フォーマットは、サードパーティのサイトに URL の表現を埋め込むことを可能にします。WordPress.com oEmbed API を使用すると、ユーザーがリソースへのリンクを投稿した際に、リソースを直接解析することなく、WordPress.com の埋め込みコンテンツ(写真や動画など)を任意のウェブサイトに表示できます。

oEmbed エンドポイント

WordPress.com oEmbed API エンドポイントは次の URL で利用できます: https://public-api.wordpress.com/oembed/

クエリ文字列パラメータ

WordPress.com oEmbed API は以下のクエリ文字列パラメータをサポートしています:

  • for(必須): リクエスト元のドメインまたは会社名
  • url(必須): リクエストするリソースの URL。wordpress.comwp.mevideopress.com のドメインおよびサブドメインを含む WordPress.com でホストされている任意の URL、または WordPress.com でホストされているトップレベルドメイン(例: TechCrunchCNN Press Room など)を指定できます。
  • format: json または xml、デフォルトは json です。
  • callback: json と併用する場合、出力をラップする JavaScript コールバック関数を指定します。
  • maxwidth: 画像/サムネイルの最大幅、デフォルトは 440px です。
  • maxheight: 画像/サムネイルの最大高さ、デフォルトは 330px です。
  • img_size: maxwidthmaxheight の代わりに使用でき、[幅]x[高さ] の形式で指定します。デフォルトは 440x330px です。
  • as_article: true または false、投稿/固定ページ向けの非標準 article 拡張を有効にします。

as_article パラメータは、type: article という非標準の oEmbed 出力を生成します。コンテンツが as_article として配信される場合、記事のコンテンツは標準の html プロパティではなく body プロパティに格納されます。related_topics などの非標準プロパティも利用できます。

機能

  • as_article モードでは、コンテンツからタグが除去され、約256文字の抜粋に制限されます。
  • 標準モード(つまり as_article=false)では、コンテンツはマークアップのまま全文が提供されるか、著者が設定した抜粋がある場合は抜粋として提供されます。
  • 投稿とページを link/html または article/body としてサポートします(as_article 引数を参照)。
  • 添付ファイル(画像/メディア/ドキュメント)を type link として、または画像(gif、jpg、jpeg、png)の場合は type photo としてサポートします。
  • 投稿とページのサムネイルが存在する場合は thumbnail_url として使用されます。存在しない場合はコンテンツ内の最初の画像が返されます。
  • ローカルおよびリモートの画像は、一貫性のために希望のサイズにリサイズおよび/または再トリミングされ、速度向上のためにキャッシュ(CDN を含む)されます。
  • 著者によって提供された場合、カスタムプロパティ(geo_latitudegeo_longitude)を通じてジオロケーションデータをサポートします。
  • as_article モード(as_article=true)で related_topics をサポートします。

レスポンスの例

ベーシックなリクエスト、必須パラメータのみを指定:

https://public-api.wordpress.com/oembed/?for=develop.wordpress.com&url=https://wordpress.com/ja/blog/2025/06/29/wordcamp-europe-2025-recap/

レスポンス:

{
  "version": "1.0",
  "provider_name": "WordPress.com News",
  "provider_url": "http://en.blog.wordpress.com",
  "author_name": "Nick Schäferhoff",
  "author_url": "https://en.blog.wordpress.com/author/nschaeferhoff/",
  "title": "WordCamp Europe 2025 Recap: Connecting and Learning in Basel, Switzerland",
  "html": "<blockquote class="wp-embedded-content" data-secret="g3Lu0xsMqa"><a href="https://en.blog.wordpress.com/2025/06/13/wordcamp-europe-2025-recap-connecting-and-learning-in-basel-switzerland/">WordCamp Europe 2025 Recap: Connecting and Learning in Basel, Switzerland</a></blockquote>https://en.blog.wordpress.com/2025/06/13/wordcamp-europe-2025-recap-connecting-and-learning-in-basel-switzerland/embed/#?secret=g3Lu0xsMqa<script type="text/javascript">n/* <![CDATA[ */n/*! This file is auto-generated */n!function(d,l){"use strict";l.querySelector&&d.addEventListener&&"undefined"!=typeof URL&&(d.wp=d.wp||{},d.wp.receiveEmbedMessage||(d.wp.receiveEmbedMessage=function(e){var t=e.data;if((t||t.secret||t.message||t.value)&&!/[^a-zA-Z0-9]/.test(t.secret)){for(var s,r,n,a=l.querySelectorAll('iframe[data-secret="'+t.secret+'"]'),o=l.querySelectorAll('blockquote[data-secret="'+t.secret+'"]'),c=new RegExp("^https?:$","i"),i=0;i<o.length;i++)o[i].style.display="none";for(i=0;i<a.length;i++)s=a[i],e.source===s.contentWindow&&(s.removeAttribute("style"),"height"===t.message?(1e3<(r=parseInt(t.value,10))?r=1e3:~~r<200&&(r=200),s.height=r):"link"===t.message&&(r=new URL(s.getAttribute("src")),n=new URL(t.value),c.test(n.protocol))&&n.host===r.host&&l.activeElement===s&&(d.top.location.href=t.value))}},d.addEventListener("message",d.wp.receiveEmbedMessage,!1),l.addEventListener("DOMContentLoaded",function(){for(var e,t,s=l.querySelectorAll("iframe.wp-embedded-content"),r=0;r<s.length;r++)(t=(e=s[r]).getAttribute("data-secret"))||(t=Math.random().toString(36).substring(2,12),e.src+="#?secret="+t,e.setAttribute("data-secret",t)),e.contentWindow.postMessage({message:"ready",secret:t},"*")},!1)))}(window,document);n/* ]]> */n</script>n",
  "type": "rich",
  "thumbnail_url": "https://en-blog.files.wordpress.com/2025/06/wceu-2025-recap-header.jpg?fit=440%2C330",
  "thumbnail_width": null,
  "thumbnail_height": null
}

as_article モード (as_article=true):

https://public-api.wordpress.com/oembed/?for=develop.wordpress.com&url=https://wordpress.com/ja/blog/2025/06/29/wordcamp-europe-2025-recap/&as_article=true

レスポンス:

{
  "version": "1.0",
  "provider_name": "WordPress.com News",
  "provider_url": "http://en.blog.wordpress.com",
  "author_name": "Nick Schäferhoff",
  "author_url": "https://en.blog.wordpress.com/author/nschaeferhoff/",
  "title": "WordCamp Europe 2025 Recap: Connecting and Learning in Basel, Switzerland",
  "type": "article",
  "body": "Couldn't make it to WordCamp Europe 2025? Don't worry. While nothing beats the experience of actually being there, this post will give you a detailed summary of some of the most important and meaningful presentations held at the conference.",
  "related_topics": "News",
  "thumbnail_url": "https://en-blog.files.wordpress.com/2025/06/wceu-2025-recap-header.jpg?fit=440%2C330",
  "thumbnail_width": null,
  "thumbnail_height": null
}

特定の画像サイズと xml 形式をリクエストする場合

https://public-api.wordpress.com/oembed/?for=develop.wordpress.com&url=https://wordpress.com/ja/blog/2025/06/29/wordcamp-europe-2025-recap/&as_article=true&img_size=880x660&format=xml

レスポンス:

<oembed>
    <version>
        <![CDATA[ 1.0 ]]>
    </version>
    <provider_name>
        <![CDATA[ WordPress.com News ]]>
    </provider_name>
    <provider_url>
        <![CDATA[ https://en.blog.wordpress.com ]]>
    </provider_url>
    <author_name>
        <![CDATA[ Nick Schäferhoff ]]>
    </author_name>
    <author_url>
        <![CDATA[ https://en.blog.wordpress.com/author/nschaeferhoff/ ]]>
    </author_url>
    <title>
        <![CDATA[ WordCamp Europe 2025 Recap: Connecting and Learning in Basel, Switzerland ]]>
    </title>
    <type>
        <![CDATA[ article ]]>
    </type>
    <body>
        <![CDATA[ Couldn't make it to WordCamp Europe 2025? Don't worry. While nothing beats the experience of actually being there, this post will give you a detailed summary of some of the most important and meaningful presentations held at the conference. ]]>
    </body>
    <related_topics>
        <![CDATA[ News ]]>
    </related_topics>
    <thumbnail_url>
        <![CDATA[ https://en-blog.files.wordpress.com/2025/06/wceu-2025-recap-header.jpg?fit=880%2C660 ]]>
    </thumbnail_url>
    <thumbnail_width>
        <![CDATA[ ]]>
    </thumbnail_width>
    <thumbnail_height>
        <![CDATA[ ]]>
    </thumbnail_height>
</oembed>

ヘッダータグ

WordPress.com は、投稿、固定ページ、添付ファイル(公開サイトのみ)のサイトヘッダーに関連リンクタグも追加します。これにより、サードパーティのサイトがコンテンツに対応する oEmbed 表現を自動的に検出できるようになります。

<link href="http://public-api.wordpress.com/oembed/?format=json&url=http:%2F%2Ftekartist.org%2F2011%2F07%2F13%2Fyourself-truly-by-emma%2F&for=wpcom-auto-discovery" rel="alternate" type="application/json+oembed" />
<link href="http://public-api.wordpress.com/oembed/?format=xml&url=http:%2F%2Ftekartist.org%2F2011%2F07%2F13%2Fyourself-truly-by-emma%2F&for=wpcom-auto-discovery" rel="alternate" type="application/xml+oembed" />

最終更新日: 6月 18, 2026