#' SGSTBCB - Sistema Gerenciador de Séries Temporais do Banco Central do Brasil
#'
#' This function get data from \url{https://www3.bcb.gov.br/sgspub/}
#' through api.
#'
#' @param cod is provide from the \url{https://www3.bcb.gov.br/sgspub/}.
#'
#' @examples
#' sgstbcb(cod = 253)
#'
#' @export
sgstbcb <- function(cod = NULL) {
url <- "http://api.bcb.gov.br/dados/serie/bcdata.sgs.%s/dados?formato=json&dataInicial=01/01/2001"
link <- sprintf(url, cod)
x <- try(jsonlite::fromJSON(link), silent = TRUE)
if (class(x) == "try-error") return(NULL) else return(x)
}
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.