
This API provides information about the Advance Release Calendar. The dissemination dates offered by this API allow to minimize the number of requests and to make a more effective use of the rest of APIs.
The use of this service requires acceptance of the Terms of use of Idescat's APIs.
| URI base | http://api.idescat.cat/cal/v1/{operation}.{format}[?parameters] |
|---|---|
| HTTP Method | GET |
| Response Formats | xml, json, php, txt, ical |
| Version | 1.00 (06.01.2012) |
| Shortcuts | Request, Response |
| Operations | dades, nodes |
| Widgets that use this service | — |
Every request must by obligation specify the service, version, operation and format. Version and operation are specific characteristics of each service. This service supports the formats for general responses of Idescat APIs. For more information, see the Anatomy of requests sections of the general documentation on Idescat APIs.
In addition, the dades operation returns the calendar in iCalendar format. This is a standard that in this API may be requested specifying txt or ics as a format. The only difference is that, in the first case and for an homogeneity purpose, the headline of the response will state the content type as text/plain and in the second, in accordance with the standard, as text/calendar (and the disposition of the contents will be attachment and a filename will be facilitated).
The identifier of this service is cal.
http://api.idescat.cat/cal/v1/{…}
This service admits two types of operation:
http://api.idescat.cat/cal/v1/dades.{…}
http://api.idescat.cat/cal/v1/nodes.{…}
This service supports the general parameters (language and encoding) of Idescat APIs.
The specific parameters can be used to choose the information that will be returned by a certain service operation. These can be specified as individual parameters or as a unique p parameter (compact form).
The dades operation returns the events of the Idescat's statistics results dissemination with confirmed date.
This parameter is used to specify the period from which you want to recover events. It is recommended to specify this parameter always. Otherwise, all the events of the most recent year available a Advance Release Calendar will be returned.
It is important to note that this parameter selects events according to the date the result will be published, and not to the period to which they refer.
2012 is the first year the calendar is available.
http://api.idescat.cat/cal/v1/dades.xml?t=2012&lang=en
http://api.idescat.cat/cal/v1/dades.json?t=201210&lang=en
http://api.idescat.cat/cal/v1/dades.ics?t=20121023&lang=en
This parameter also permits specifying intervals using the hyphen.
http://api.idescat.cat/cal/v1/dades.php?t=201210-201211&lang=en
http://api.idescat.cat/cal/v1/dades.txt?t=20121022-20121028&lang=en
The id parameter may be used to request a particular statistic calendar.
http://api.idescat.cat/cal/v1/dades.json?t=2012&id=epa&lang=en
To obtain the list of available statistics in a particular period, use the nodes operation.
The nodes operation returns the territorial levels included in the service and provides information on the valid values of the parameter id of the dades operation.
This parameter is used to specify the time period from which to recover the name and the code of the disseminated statistics. It is recommended to specify this parameter always. Otherwise, all the events of the most recent year available Advance Release Calendar will be returned.
http://api.idescat.cat/cal/v1/nodes.xml?t=2012&lang=en
See the section corresponding to the dades operation for the syntax and all the options of this parameter.
http://api.idescat.cat/cal/v1/nodes.json?t=20121023-20121123&lang=en
This parameter is used to check the availability of updates of a particular statistic in a certain period of time. It is also used to obtain the name of a particular statistic from its code.
http://api.idescat.cat/cal/v1/nodes.xml?t=2012&id=ipri&lang=en
In the case of the nodes operation, the id parameter accepts a list of values separated by comma (this options is not available in the invocation without operation).
http://api.idescat.cat/cal/v1/nodes.xml?t=2012&id=ipri,ipi
For reasons of user-friendliness, this API accepts requests with a syntax that does not require the specification of operations (see the general documentation on Idescat APIs, section 1.4. Invocation without operation).
http://api.idescat.cat/cal/v1/calendari/2012.xml?lang=en
http://api.idescat.cat/cal/v1/calendari/201212.json?lang=en
http://api.idescat.cat/cal/v1/calendari/2012/ipi.ics?lang=en
http://api.idescat.cat/cal/v1/estadistiques/2012.xml?lang=en
http://api.idescat.cat/cal/v1/estadistiques/2012/ipross.json?lang=en
In order to find out the HTTP response codes HTTP returned and the formats supported by any service, see section 2 of Idescat APIs.
The structure of the response to dades operation is based on the iCalendar text standard. In the case of the XML format, the structure is based on the iCalendar standard mapping called xCal.
BEGIN:VCALENDAR VERSION:2.0 PRODID: -//Idescat.cat//NONSGML IdesCal 1.0//EN CALSCALE:GREGORIAN METHOD:PUBLISH BEGIN:VEVENT UID:dif2012-epatnc201203269-1@idescat.cat DTSTAMP:20120525T120258Z DTSTART;VALUE=DATE:20121026 DURATION:P1D SUMMARY:EPA III/2012 Cat. DESCRIPTION:Active Population Survey III/2012 (Idescat) STATUS:CONFIRMED TRANSP:TRANSPARENT CLASS:PUBLIC END:VEVENT END:VCALENDAR
<?xml version="1.0" encoding="utf-8" ?>
<icalendar xmlns="urn:ietf:params:xml:ns:icalendar-2.0">
<vcalendar>
<properties>
<prodid>
<text>-//Idescat.cat//NONSGML IdesCal 1.0//EN</text>
</prodid>
<version>
<text>2.0</text>
</version>
<calscale>
<text>GREGORIAN</text>
</calscale>
<method>
<text>PUBLISH</text>
</method>
</properties>
<components>
<vevent>
<properties>
<uid>
<text>dif2012-epatnc201203269-1@idescat.cat</text>
</uid>
<dtstamp>
<date-time>20120525T121905Z</date-time>
</dtstamp>
<dtstart>
<date>20121026</date>
</dtstart>
<duration>
<duration>P1D</duration>
</duration>
<summary>
<text>EPA III/2012 Cat.</text>
</summary>
<description>
<text>Active Population Survey III/2012 (Idescat)</text>
</description>
<status>
<text>CONFIRMED</text>
</status>
<transp>
<text>TRANSPARENT</text>
</transp>
<class>
<text>PUBLIC</text>
</class>
</properties>
</vevent>
</components>
</vcalendar>
</icalendar>
{
version: "2.0",
calscale: "GREGORIAN",
method: "PUBLISH",
vevent: [
{
uid: "dif2012-epatnc201203269-1@idescat.cat",
dtstamp: "20120525T123209Z",
dtstart: "20121026",
duration: "P1D",
summary: "EPA III/2012 Cat.",
description: "Active Population Survey III/2012 (Idescat)",
status: "CONFIRMED",
transp: "TRANSPARENT",
class: "PUBLIC"
}
]
}
When the request is related to nonexistent periods or statistics, the response will include a calendar without events.
The nodes operation uses similar structures to other Idescat APIs (for instance, indicators of the day).
<?xml version="1.0" encoding="utf-8" ?>
<cal
version="1.00"
lang="en"
o="nodes"
n="17"
p="t=201210"
>
<v id="ADR">Indicators of Hotel Sector Profitability</v>
<v id="COMEST">Foreign Trade from Catalonia</v>
<v id="EAS">Annual Survey of Services</v>
<v id="ECLEM">Business Climate Survey</v>
<v id="ECVHP">Survey on Living Conditions and Habits of the Population</v>
<v id="EDSN">Statistics on Divorces, Separations and Annulments</v>
<v id="EFDE">Survey on Finance and Expenditure in Education</v>
<v id="ENL">Public Finance of non Profit Entities</v>
<v id="EPA">Active Population Survey</v>
<v id="ETIC">Statistics on the ICT Sector</v>
<v id="IASS">Indicators of Service Sector Activity</v>
<v id="IPC">Consumer Price Index</v>
<v id="IPI">Industrial Production Index</v>
<v id="IPRI">Industrial Price Index</v>
<v id="IVGS">Large Stores Sales Index</v>
<v id="MNP">Natural movement of the population</v>
<v id="TURHOT">Indicators of Hotel Activity</v>
</cal>
When the request is related to nonexistent periods or statistics, the response will not include v elements.
Idescat APIs use standardised response codes to show whether the request has been successful or has failed.