Execute this script at browser console of https://feriadosbancarios.febraban.org.br/ to get holidays in json format.
Please consider using the file above to do not overload the febrabran website.
Use with responsability.
{ | |
"2001": [ | |
"2001-01-01", | |
"2001-02-26", | |
"2001-02-27", | |
"2001-04-13", | |
"2001-04-21", | |
"2001-05-01", | |
"2001-06-14", | |
"2001-09-07", | |
"2001-10-12", | |
"2001-11-02", | |
"2001-11-15", | |
"2001-12-25" | |
], | |
"2002": [ | |
"2002-01-01", | |
"2002-02-11", | |
"2002-02-12", | |
"2002-03-29", | |
"2002-04-21", | |
"2002-05-01", | |
"2002-05-30", | |
"2002-09-07", | |
"2002-10-12", | |
"2002-11-02", | |
"2002-11-15", | |
"2002-12-25" | |
], | |
"2003": [ | |
"2003-01-01", | |
"2003-03-03", | |
"2003-03-04", | |
"2003-04-18", | |
"2003-04-21", | |
"2003-05-01", | |
"2003-06-19", | |
"2003-09-07", | |
"2003-10-12", | |
"2003-11-02", | |
"2003-11-15", | |
"2003-12-25" | |
], | |
"2004": [ | |
"2004-01-01", | |
"2004-02-23", | |
"2004-02-24", | |
"2004-04-09", | |
"2004-04-21", | |
"2004-05-01", | |
"2004-06-10", | |
"2004-09-07", | |
"2004-10-12", | |
"2004-11-02", | |
"2004-11-15", | |
"2004-12-25" | |
], | |
"2005": [ | |
"2005-01-01", | |
"2005-02-07", | |
"2005-02-08", | |
"2005-03-25", | |
"2005-04-21", | |
"2005-05-01", | |
"2005-05-26", | |
"2005-09-07", | |
"2005-10-12", | |
"2005-11-02", | |
"2005-11-15", | |
"2005-12-25" | |
], | |
"2006": [ | |
"2006-01-01", | |
"2006-02-27", | |
"2006-02-28", | |
"2006-04-14", | |
"2006-04-21", | |
"2006-05-01", | |
"2006-06-15", | |
"2006-09-07", | |
"2006-10-12", | |
"2006-11-02", | |
"2006-11-15", | |
"2006-12-25" | |
], | |
"2007": [ | |
"2007-01-01", | |
"2007-02-19", | |
"2007-02-20", | |
"2007-04-06", | |
"2007-04-21", | |
"2007-05-01", | |
"2007-06-07", | |
"2007-09-07", | |
"2007-10-12", | |
"2007-11-02", | |
"2007-11-15", | |
"2007-12-25" | |
], | |
"2008": [ | |
"2008-01-01", | |
"2008-02-04", | |
"2008-02-05", | |
"2008-03-21", | |
"2008-04-21", | |
"2008-05-01", | |
"2008-05-22", | |
"2008-09-07", | |
"2008-10-12", | |
"2008-11-02", | |
"2008-11-15", | |
"2008-12-25" | |
], | |
"2009": [ | |
"2009-01-01", | |
"2009-02-23", | |
"2009-02-24", | |
"2009-04-10", | |
"2009-04-21", | |
"2009-05-01", | |
"2009-06-11", | |
"2009-09-07", | |
"2009-10-12", | |
"2009-11-02", | |
"2009-11-15", | |
"2009-12-25" | |
], | |
"2010": [ | |
"2010-01-01", | |
"2010-02-15", | |
"2010-02-16", | |
"2010-04-02", | |
"2010-04-21", | |
"2010-05-01", | |
"2010-06-03", | |
"2010-09-07", | |
"2010-10-12", | |
"2010-11-02", | |
"2010-11-15", | |
"2010-12-25" | |
], | |
"2011": [ | |
"2011-01-01", | |
"2011-03-07", | |
"2011-03-08", | |
"2011-04-21", | |
"2011-04-22", | |
"2011-05-01", | |
"2011-06-23", | |
"2011-09-07", | |
"2011-10-12", | |
"2011-11-02", | |
"2011-11-15", | |
"2011-12-25" | |
], | |
"2012": [ | |
"2012-01-01", | |
"2012-02-20", | |
"2012-02-21", | |
"2012-04-06", | |
"2012-04-21", | |
"2012-05-01", | |
"2012-06-07", | |
"2012-09-07", | |
"2012-10-12", | |
"2012-11-02", | |
"2012-11-15", | |
"2012-12-25" | |
], | |
"2013": [ | |
"2013-01-01", | |
"2013-02-11", | |
"2013-02-12", | |
"2013-04-21", | |
"2013-05-01", | |
"2013-05-30", | |
"2013-06-29", | |
"2013-09-07", | |
"2013-10-12", | |
"2013-11-02", | |
"2013-11-15", | |
"2013-12-25" | |
], | |
"2014": [ | |
"2014-01-01", | |
"2014-03-03", | |
"2014-03-04", | |
"2014-04-18", | |
"2014-04-21", | |
"2014-05-01", | |
"2014-06-19", | |
"2014-09-07", | |
"2014-10-12", | |
"2014-11-02", | |
"2014-11-15", | |
"2014-12-25" | |
], | |
"2015": [ | |
"2015-01-01", | |
"2015-02-16", | |
"2015-02-17", | |
"2015-04-03", | |
"2015-04-21", | |
"2015-05-01", | |
"2015-06-04", | |
"2015-09-07", | |
"2015-10-12", | |
"2015-11-02", | |
"2015-11-15", | |
"2015-12-25" | |
], | |
"2016": [ | |
"2016-01-01", | |
"2016-02-08", | |
"2016-02-09", | |
"2016-03-25", | |
"2016-04-21", | |
"2016-05-01", | |
"2016-05-26", | |
"2016-09-07", | |
"2016-10-12", | |
"2016-11-02", | |
"2016-11-15", | |
"2016-12-25" | |
], | |
"2017": [ | |
"2017-01-01", | |
"2017-02-27", | |
"2017-02-28", | |
"2017-04-14", | |
"2017-04-21", | |
"2017-05-01", | |
"2017-06-15", | |
"2017-09-07", | |
"2017-10-12", | |
"2017-11-02", | |
"2017-11-15", | |
"2017-12-25" | |
], | |
"2018": [ | |
"2018-01-01", | |
"2018-02-12", | |
"2018-02-13", | |
"2018-03-30", | |
"2018-04-21", | |
"2018-05-01", | |
"2018-05-31", | |
"2018-09-07", | |
"2018-10-12", | |
"2018-11-02", | |
"2018-11-15", | |
"2018-12-25" | |
], | |
"2019": [ | |
"2019-01-01", | |
"2019-03-04", | |
"2019-03-05", | |
"2019-04-19", | |
"2019-04-21", | |
"2019-05-01", | |
"2019-06-20", | |
"2019-09-07", | |
"2019-10-12", | |
"2019-11-02", | |
"2019-11-15", | |
"2019-12-25" | |
], | |
"2020": [ | |
"2020-01-01", | |
"2020-02-24", | |
"2020-02-25", | |
"2020-04-10", | |
"2020-04-21", | |
"2020-05-01", | |
"2020-06-11", | |
"2020-09-07", | |
"2020-10-12", | |
"2020-11-02", | |
"2020-11-15", | |
"2020-12-25" | |
], | |
"2021": [ | |
"2021-01-01", | |
"2021-02-15", | |
"2021-02-16", | |
"2021-04-02", | |
"2021-04-21", | |
"2021-05-01", | |
"2021-06-03", | |
"2021-09-07", | |
"2021-10-12", | |
"2021-11-02", | |
"2021-11-15", | |
"2021-12-25" | |
] | |
} |
const parseFebrabanDate = (year, data) => { | |
const months = { | |
janeiro: '01', | |
fevereiro: '02', | |
março: '03', | |
abril: '04', | |
maio: '05', | |
junho: '06', | |
julho: '07', | |
agosto: '08', | |
setembro: '09', | |
outubro: '10', | |
novembro: '11', | |
dezembro: '12' | |
}; | |
console.log(data); | |
return data.map(d => { | |
const parts = d.diaMes.split(' de '); | |
const date = new Date(`${year}-${months[parts[1]]}-${parts[0]}`); | |
return date.toISOString().split('T')[0]; | |
}); | |
}; | |
const endYear = (new Date()).getFullYear(); | |
const holidays = {}; | |
for(let year=2018; year<endYear;year++){ | |
console.info(`Retrivering holidays from ${year}`); | |
const res = await fetch(`https://feriadosbancarios.febraban.org.br/Home/ObterFeriadosFederais?ano=${year}`); | |
const raw = await res.json(); | |
holidays[year] = parseFebrabanDate(year, raw); | |
} | |
JSON.stringify(holidays); |
Execute this script at browser console of https://feriadosbancarios.febraban.org.br/ to get holidays in json format.
Please consider using the file above to do not overload the febrabran website.
Use with responsability.