Skip to main content

Embed. API RSS

Some web pages at Idescat provide content that may be embedded in third party websites. This API shows whether content of this type exists in a certain page, and also how to obtain its embeddable code. This API follows the oEmbed standard both for requests and responses.

The use of this service involves acceptance of the terms of use of Idescat APIs.

Base URI{format}[?parameters]
HTTP method GET
Response formats xml, json
Version 1.00 (05/06/2013)
Shortcuts Request, Response
Operations oembed

1. Request

1.1. Basic characteristics

Every request must specify by obligation the service, version, operation and format. Version and operation are specific characteristics of each service. This service supports the general response formats for Idescat APIs. For further information, please see the Anatomy of Requests section of the general documentation on Idescat APIs.

1.1.1. Identifier of service and version

The identifier of this service is embed.{…}

1.1.2. Operations

At present, this service only admits the operation oembed.{…}

1.2. Parameters

In accordance with the oEmbed standard, requests must specify the parameter url. Optionally, the standard also defines two additional parameters: maxwidth and maxheight.

The standard also supports the parameter format but accepts to have the format specified as part of the address, which is the approach used by Idescat:{…}

1.2.1. url

This is an mandatory parameter that contains the web address to retrieve embbeding information for.

Ex. 1: Information on embeddable content for the population by sex page for Abella de la Conca in XML format

1.2.2. maxheight

This optional parameter can specify the maximum height in pixels of the embeddable content.

Ex. 2: Information on embeddable content of a maximum height of 300 px associated to a certain page in JSON format{…}

1.2.3. maxwidth

This optional parameter can specify the maximum width in pixels of the embeddable content.

Ex. 3: Information on embeddable content of a maximum width of 200px for a certain page in XML format{…}

2. Response

The response structure follows the oEmbed standard. This standard only supports two response formats: XML and JSON.

Ex. 4: Example response in XML format
<?xml version="1.0" encoding="utf-8" standalone="yes"?>
	<html>&lt;iframe height="565" width="740" frameborder="0" scrolling="no" border="0" allowfullscreen="allowfullscreen" webkitallowfullscreen="webkitallowfullscreen" allowTransparency="true" src=";lang=en"&gt;&lt;/iframe&gt;</html>
Ex. 5:Example response in JSON format
	"width": 740,
	"height": 565,
	"html":"\u003ciframe height=\"565\" width=\"740\" frameborder=\"0\" scrolling=\"no\" border=\"0\" allowfullscreen=\"allowfullscreen\" webkitallowfullscreen=\"webkitallowfullscreen\" allowTransparency=\"true\" src=\"\/g.ifr?\u0026amp;lang=en\"\u003e\u003c/iframe\u003e",
	"version": "1.0",
	"type": "rich",
	"provider_name": "Idescat",
	"provider_url": "https:\/\/"

3. Errors

According to the oEmbed standard, if the page specified in the parameter url has no associated embeddable content, the service will return the response code 404.