ColombiAPI: Exploring Colombia’s Public Data with API-Colombia

library(ColombiAPI)
library(dplyr)
#> 
#> Adjuntando el paquete: 'dplyr'
#> The following objects are masked from 'package:stats':
#> 
#>     filter, lag
#> The following objects are masked from 'package:base':
#> 
#>     intersect, setdiff, setequal, union

Introduction

The ColombiAPI package provides a seamless interface to access diverse public data about Colombia through the API-Colombia, a RESTful API. The package enables users to explore various aspects of Colombia, including general information, geography, and cultural insights. It includes five API-related functions to retrieve data on topics such as Colombia’s general information, airports, departments, regions, and presidents.

Additionally, ColombiAPI offers a built-in function to view the datasets available within the package. The package also includes curated datasets covering Bogota air stations, business and holiday dates, public schools, Colombian coffee exports, cannabis licenses, Medellin rainfall, and malls in Bogota, making it a comprehensive tool for exploring Colombia’s data.

Functions for API-Colombia

The ColombiAPI package provides five primary functions to retrieve data from the API-Colombia, we’ll show you how two of them work in this section:


get_Colombia_info()
#>       name surface population timeZone       currency currencySymbol   region
#> 1 Colombia 1141748   52235050    UTC-5 Colombian Peso              $ Americas

get_regions_list()
#>   id      name
#> 1  4  Amazonía
#> 2  5    Andina
#> 3  1    Caribe
#> 4  6   Insular
#> 5  3 Orinoquía
#> 6  2  Pacífico

Datasets Included in ColombiAPI

In addition to API functions, ColombiAPI includes several preloaded datasets that provide valuable insights into various aspects of Colombia:

Dataset Suffixes

Each dataset in ColombiAPI is labeled with a suffix to indicate its type and structure:

  • _df: A standard data frame.

  • _tbl_df: A tibble, a modern version of a data frame with better formatting and functionality.

  • _Date: An object of type Date.

Viewing All Available Datasets

The ColombiAPI package includes a built-in function, view_datasets(), which allows users to view a comprehensive list of all datasets available in the package directly from the console:


view_datasets()
#> Datasets available in the 'ColombiAPI' package:
#> [1] "Bogota_airstations_df"       "Bogota_business_Date"       
#> [3] "Bogota_holidays_Date"        "Bogota_malls_tbl_df"        
#> [5] "Cannabis_Licenses_tbl_df"    "Colombia_coffee_tbl_df"     
#> [7] "Medellin_rain_tbl_df"        "Tulua_Public_Schools_tbl_df"

Conclusion

The ColombiAPI package offers a powerful set of tools for accessing and analyzing public data about Colombia. From exploring general information about the country to diving into specific datasets on topics like air quality, public schools, or coffee exports, ColombiAPI enables users to engage with Colombia’s rich data landscape easily. For more detailed examples and use cases, refer to the full package documentation or explore the datasets using the built-in functions.