BrazilDataAPI

The BrazilDataAPI package provides a unified interface to access open data from the BrasilAPI and the REST Countries API, with a focus on Brazil. It allows users to easily retrieve up-to-date information on postal codes, banks, economic indicators, holidays, company registrations, and international country-level data relevant to Brazil.

In addition to API-access functions, the package includes a collection of curated datasets related to Brazil, covering diverse domains such as demographics (male and female population by state and year), river levels in Manaus, environmental emission factors in São Paulo, Brazilian film festivals, and historical yellow fever outbreaks.

BrazilDataAPI is designed to support research, teaching, and data analysis focused on Brazil by integrating public RESTful APIs with high-quality, domain-specific datasets into a single, easy-to-use R package.

Installation

You can install the BrazilDataAPI package from CRAN with the following R function:


install.packages("BrazilDataAPI")

Usage

After installation, load the package and start exploring and using its functions and datasets.


library(BrazilDataAPI)

BrazilDataAPI Functions

Some of the BrazilDataAPI Datasets

The naming convention helps you easily understand the structure of each dataset:

Example Code:


# Load the package
library(BrazilDataAPI)

# Selected, essential information about Brazil
get_country_info()

# Get List of Banks in Brazil
get_brazil_banks()

# Load a dataset
data("Brasil_females_df")

# Shows six rows of the dataset
head(Brasil_females_df)

# Display the structure of the dataset
str(Brasil_females_df)

# Shows the whole dataset

View(Brasil_females_df)