Get Data for Brazilian Bonds (Tesouro Direto)

Downloads and aggregates data for Brazilian government issued bonds directly from the website of Tesouro Direto <>.


  • Added the maturities of the instruments as an extra column in the dataframe
  • The package CHECK process no longer depends on the avaibility of Tesouro Direto website. All needed files for compilation are local
  • Fixed bug in html download. Now using a new function and a new algorithm to try the download 10 times before throwing an error
  • The html structure of the Tesouro Website has changed and that resulted in CHECK errors in the package. This update fixed it.
  • Fixed TD names in read function (TD website is a mess!)
  • Now also using input in read function
- Fixed bug in (it was not reading data after 2012 because of change of output type given switch from xlsx:read.xlsx to readxl::read_excel)
- Now using readxl::read_excel, a better excel reader, FASTER and without the java requirements
- Additional error checks
- Added a test for internet connection
- Added a new option for overwriting or not the downloaded excel files (saves a lot of time for large batch downloads!)
- Fixed typos and improved the text in the vignette

Reference manual

It appears you don't have a PDF plugin for this browser. You can click here to download the reference manual.


1.3 by Marcelo Perlin, 4 months ago

Browse source code at

Authors: Marcelo Perlin [aut, cre]

Documentation:   PDF Manual  

Task views: Empirical Finance

GPL-2 license

Imports stringr, stringi, readxl, utils, stats, curl, RCurl, XML, bizdays, tidyr

Suggests knitr, rmarkdown, testthat, ggplot2

See at CRAN