I am making an application and would like to know if there is any way to get national holidays.
For example: Some Google Calendar API where I can get some XML to consume ..
I am making an application and would like to know if there is any way to get national holidays.
For example: Some Google Calendar API where I can get some XML to consume ..
The Multitable has a Webservice in PHP . It is possible to obtain not only national holidays, but also regional holidays.
You can use the link which is an API that supports the following countries / regions BE
, BR
, GB
, NO
or US
(note that it uses ISO 3166-1 alpha-2 which is version alpha
).
Just make a request for the address http://holidayapi.com/v1/holidays
that can be used with any language, in C # it should look something like:
WebRequest request = WebRequest.Create("http://holidayapi.com/v1/holidays?country=BR&year=2015");
request.Credentials = CredentialCache.DefaultCredentials;
((HttpWebRequest) request).UserAgent = context.Request.UserAgent;
HttpWebResponse response = (HttpWebResponse) request.GetResponse();
if (response.StatusCode != HttpStatusCode.OK) {
response.StatusCode.ToString();
} else {
Stream receiveStream = response.GetResponseStream();
//Converte a resposta para objeto
}
Or you can download from GitHub: link (see the link )
As an example (unfortunately the repository is only for PHP, but you can use the .json
files):
<?php
require '../lib/HolidayAPIv1.php';
$api = new \HolidayAPI\v1($redis);
header('Content-Type: application/json; charset=utf-8');
$flags = JSON_UNESCAPED_UNICODE;
if (isset($_REQUEST['pretty'])) {
$flags |= JSON_PRETTY_PRINT;
}
echo json_encode($api->getHolidays(), $flags);
Elekto (notice: it's my company) provides a free JSONP API, explained in detail here .
It is the API that is used in our working day deadlines tool . The focus, however, is the financial market.
The tool has been in the air since 2012-05, hosted in São Paulo (less latency).
The big problem in Brazil is the municipal holidays and the amount of existing cities.
I only found an API that has holidays from all counties. I'm using and it worked fine:
It's free, just put the email on this page.
In Portugal but without municipalities.