Learn R Programming

flightsbr: Download Flight and Airport Data from Brazil

flightsbr is an R package designed to facilitate the download of comprehensive flight and airport data from Brazil’s Civil Aviation Agency (ANAC). The package provides access to detailed information on aircraft, airports, and airport operations registered with ANAC. It also includes data on airfares, all international flights to and from Brazil, and domestic flights within the country.

Installation

# From CRAN
  install.packages("flightsbr")

# or use the development version with latest features
  utils::remove.packages('flightsbr')
  remotes::install_github("ipeaGIT/flightsbr")

Basic usage

The package currently includes five main functions:

  1. read_flights()
  2. read_airports()
  3. read_aircraft()
  4. read_airport_movements()
  5. read_airfares()

1) read_flights() to download data on national and international flights.

# flights in a given month/year (yyyymm)
df_201506 <- read_flights(date = 201506)

# flights in a given year (yyyy)
df_2015 <- read_flights(date = 2015)

2) read_airports() to download data on private and public airports.

# all airports
airports_all <- flightsbr::read_airports(type = 'all')

# public airports
airports_pbl <- flightsbr::read_airports(type = 'public')

# private airports
airports_prv <- flightsbr::read_airports(type = 'private')

3) read_aircraft() to download aircraft data.

aircraft <- read_aircraft(date = 2024)

4) read_airport_movements() to download data on aiport movements.

airport_ops <- read_airport_movements(date = 202001)

5) read_airfares() to download data on airfares of domestic or international flights.

airfares <- read_airfares(date = 202001, domestic = TRUE)

Related projects

Similar packages for other countries/continents

Similar projects for Brazil:

As of today, there are two repositories/projects with Brazilian aviation data, which include more info related to weather conditions, air traffic management etc. The advantage of flightsbt is that it's the easiest and fastest way to download flight and airport Data from Brazil in R.

Acknowledgement

Original data is collected by Brazil’s Civil Aviation Agency (ANAC). The flightsbr package is developed by a team at the Institute for Applied Economic Research (Ipea), Brazil. If you want to cite this package, you can cite it as:

Copy Link

Version

Install

install.packages('flightsbr')

Monthly Downloads

385

Version

1.1.1

License

MIT + file LICENSE

Issues

Pull Requests

Stars

Forks

Maintainer

Rafael H. M. Pereira

Last Published

July 24th, 2025

Functions in flightsbr (1.1.1)

get_airfares_dates_available

Retrieve all dates available for airfares data from ANAC website
get_aircraft_dates_available

Retrieve all dates available for aircraft data from ANAC website
get_airport_movement_dates_available

Retrieve all dates available for airport movements data
get_aircraft_url

Put together the url of aircraft data files
latlon_to_numeric

Convert latitude and longitude columns to numeric
latest_flights_date

Check the date of the latest flight data available
read_aircrafts

Download aircrafts data from Brazil
read_airfares

Download data on airfares flights in Brazil
read_airports

Download airports data from Brazil
read_airport_movements

Download airport movement data from Brazil
read_flights

Download flight data from Brazil
get_airfares_url

Put together the url of airfare data files
read_aircraft

Download aircraft data from Brazil
download_flightsbr_file

Download file from url
download_airport_movement_data

Download and read ANAC airport movement data
flightsbr

flightsbr: Download Flight and Airport Data from Brazil
get_airport_movements_url

Put together the url of airport movement data files
download_aircraft_data

Download and read ANAC aircraft data
altitude_to_numeric

Convert altitude column to numeric
check_input_date_format

Check whether the format of the date input is acceptable
download_flights_data

Download and read ANAC flight data
check_date

Check whether date input is acceptable
download_airfares_data

Download and read ANAC air fares data
get_flights_url

Put together the url of flight data files
generate_all_months

Generate all months with yyyymm format for a given year
latest_airfares_date

Check the date of the latest airfare data available
get_flight_dates_available

Retrieve all dates available for flights data from ANAC website