get_colombia_departments: Get Colombia's Departments from API Colombia

View source: R/get_colombia_departments.R

get_colombia_departmentsR Documentation

Get Colombia's Departments from API Colombia

Description

Retrieves comprehensive information about all Colombian departments from the API Colombia service. This function fetches data including department names, capitals, geographical information, area, population, and administrative details for all 32 departments plus Bogotá D.C.

Usage

get_colombia_departments()

Details

This function sends a GET request to the API Colombia service. If the API request fails or returns an error status code, the function returns NULL with an informative message.

Value

A tibble with the following columns:

  • id: Department identifier (integer)

  • name: Department name (character)

  • capital: Capital city name (character)

  • surface: Department area in km² (integer)

  • population: Department population (integer)

  • municipalities: Number of municipalities (integer)

  • phone_prefix: Phone area code (character)

  • region_id: Geographic region identifier (integer)

Note

Requires internet connection.

Source

API Colombia: https://api-colombia.com/api/v1/Department

See Also

GET, fromJSON, as_tibble

Examples

if (interactive()) {
  get_colombia_departments()
}


ColombiAPI documentation built on Nov. 5, 2025, 6:59 p.m.