Skip to content

API oembed

Manuel Strehl edited this page Dec 15, 2015 · 1 revision

oEmbed Endpoint

Template for this request:

http://codepoints.net/api/v1/oembed{?url}{?format*}{?maxwidth*}{?maxheight*}

This is Codepoint.net’s oEmbed endpoint. oEmbed is a specification to allow turning URLs in rich representations, e. g., Youtube URLs to embedded videos. It is mainly used by WordPress.

The url parameter must match ^https://codepoints.net/.*. The format can be either json or xml. The dimensions of the response can be controlled with maxwidth and maxheight (unitless, in CSS pixel).

Response

The response is JSON or XML according to the oEmbed specification. It contains the type rich and as html an iframe embed for the requested codepoint page. Example:

    {
        "type": "rich",
        "version": "1.0",
        "title": "U+00E4 LATIN SMALL LETTER A WITH DIAERESIS",
        "author_url": "http://codepoints.net/",
        "provider_name": "Codepoints.net",
        "provider_url": "http://codepoints.net/",
        "cache_age": 604800,
        "thumbnail_url": "http://codepoints.net/api/v1/glyph/00E4",
        "html": "<iframe src=\"http://codepoints.net/U+00E4?embed\" style=\"width: 640px; height: 640px; border: 1px solid #444;\"></iframe>",
        "width": 640,
        "height": 640
    }

Possible Errors

  1. 400 Bad Request: When the url parameter is missing.
  2. 404 Not Found: When the url parameter cannot be resolved to a matching URL.
  3. 501 Not Implemented: When format is neither json nor xml (but is set).
Clone this wiki locally