Interface for Accessing Weather Data from Climatempo

Provides functions for downloading meteorological data from the CLIMATEMPO (< https://www.climatempo.com.br/>) web platform through web scraping, designed for ecological and environmental analyses.


climabr

An R package for providing historical (30-year) average monthly climatological data (minimum temperature, maximum temperature, and precipitation) for municipalities in Brazil. Data are retrieved from the Climatempo platform through automated web scraping. The package provides flexible tools for location search and structured climate data extraction, supporting applications in ecology, environmental science, and data science.

This package is intended for research and educational purposes, and users should ensure compliance with the terms of use of the data source.


Installation

You can install the development version of climabr from GitHub:

# Install development version from GitHub
if (!requireNamespace("remotes", quietly = TRUE)) {
  install.packages("remotes")
}

remotes::install_github("jrz-s/climabr")

Overview

climabr enables users to:

  • Search for locations using flexible input (region, state, or city)
  • Retrieve monthly climatological data (temperature and precipitation)
  • Handle partial, case-insensitive, and accent-insensitive queries
  • Aggregate data across multiple locations

Example

library(climabr)

# Retrieve climate list for Aracaju (Sergipe, Brazil)
df <- search_locations(state = "se", city = "aracaju")
climate_list(df)

# Retrieve climate data for Aracaju (Sergipe, Brazil)
climate_data(state = "se", city = "aracaju")

Input flexibility

The package supports robust matching of user inputs:

  • Partial names (e.g., “arac” → “aracaju”)
  • Case-insensitive matching (e.g., “Sergipe” = “sergipe”)
  • Accent-insensitive matching (e.g., “São” = “Sao”)
  • Informative error messages for ambiguous inputs

Workflow

A typical workflow consists of:

  1. Searching locations using search_locations()
  2. Retrieving climate data using climate_data()
  3. Performing downstream analysis or visualization

Output

The main function returns a tidy tibble with the following variables:

region: Geographic region state: State abbreviation city_name: City name site: Site identifier (optional) month: Month (1–12) tmin: Minimum temperature (°C) tmax: Maximum temperature (°C) precip: Precipitation (mm)

Disclaimer

This package performs automated web scraping from the Climatempo website to facilitate access to publicly available climatological data. It is designed to support research, educational, and non-commercial applications by providing a structured and reproducible approach to retrieving climate information.

Users are responsible for ensuring that their use of this package complies with the terms of service and policies of the data provider.

When using this package, users should:

  • Avoid excessive or high-frequency requests that may overload the source servers
  • Implement appropriate delays between requests
  • Use the data responsibly and ethically

The authors are not affiliated with, endorsed by, or sponsored by Climatempo.

This package is provided “as is” without warranty of any kind. Its functionality may change over time as the source website evolves, and users should be aware that web scraping workflows are inherently subject to structural changes in the data source.

Author

Zárate-Salazar, Jhonatan Rafael, PhD
Postdoctoral Researcher
Graduate Program in Ecology and Conservation
Federal University of Sergipe (UFS), São Cristóvão, Sergipe, Brazil

📧 Email: [email protected]
🔗 ORCID: https://orcid.org/0000-0001-9251-5340
💻 GitHub: https://github.com/jrz-s
🎓 CV lattes: http://lattes.cnpq.br/5635448203792516

Contributors

Benites-Alfaro, Omar E., MSc
Data Analytst
Universidad Catolica Sedes Sapientiae, Lima, Peru

Oliveira, Eduardo V. da Silva, PhD
Professor, Department of Ecology
Federal University of Sergipe, São Cristóvão, Sergipe, Brazil

Gouveia, Sidney Feitosa, PhD
Professor, Department of Ecology
Federal University of Sergipe, São Cristóvão, Sergipe, Brazil

Reference manual

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

install.packages("climabr")

0.1.0 by Jhonatan Rafael Zárate-Salazar, 12 hours ago


https://github.com/jrz-s/climabr


Report a bug at https://github.com/jrz-s/climabr/issues


Browse source code at https://github.com/cran/climabr


Authors: Jhonatan Rafael Zárate-Salazar [aut, cre] (ORCID: , Omar E. Benites-Alfaro [ctb] (ORCID: , Eduardo V. da Silva Oliveira [ctb] (ORCID: , Sidney F. Gouveia [ctb] (ORCID:


Documentation:   PDF Manual  


MIT + file LICENSE license


Imports dplyr, stringr, stringi, purrr, rvest, magrittr, rlang


See at CRAN