flightsbr icon indicating copy to clipboard operation
flightsbr copied to clipboard

Function read_airfares() not working

Open rafapereirabr opened this issue 2 years ago • 1 comments

The function read_airfares() currently not working because ANAC has changed the url address where the data files are stored.

In the recent past, fares data on domestic and international flights were stored in:

  • https://sistemas.anac.gov.br/sas/tarifadomestica/
  • https://sistemas.anac.gov.br/sas/tarifainternacional/

The data is now only available other webinterfaces which work with point and click:

  • domestic: https://sas.anac.gov.br/sas/downloads/view/frmDownload.aspx?tema=14
  • international: https://sas.anac.gov.br/sas/downloads/view/frmDownload.aspx?tema=17

However, haven't been able to extract from the new site the url to the data files:

base_url = 'https://sas.anac.gov.br/sas/downloads/view/frmDownload.aspx?tema=14'

h <- try(rvest::read_html(base_url), silent = TRUE)

# filter elements of basic data
elements <- rvest::html_elements(h, "a")

any help here would be much appreciated.

rafapereirabr avatar Jun 28 '23 15:06 rafapereirabr

It seems ANAC has a data API we could use

  • https://sistemas.anac.gov.br/dadosabertos/
  • https://sistemas.anac.gov.br/dadosabertos/Operador%20Aeroportu%C3%A1rio/Tarifas%20Aeroportu%C3%A1rias%20Tetos%20Tarif%C3%A1rios%20e%20Reajustes%20Tarif%C3%A1rios/

rafapereirabr avatar Jul 20 '23 16:07 rafapereirabr

This should be fixed in the next release.

rafapereirabr avatar Sep 22 '24 01:09 rafapereirabr