get_country_info_co: Get Key Country Information for Colombia from the REST...

View source: R/get_country_info_co.R

get_country_info_coR Documentation

Get Key Country Information for Colombia from the REST Countries API

Description

Retrieves selected, essential information about Colombia using the REST Countries API. The function returns a tibble with core details such as population, area, capital, region, and official language(s).

See the API documentation at https://restcountries.com/. Example API usage: https://restcountries.com/v3.1/name/colombia?fullText=true.

Usage

get_country_info_co()

Details

The function sends a GET request to the REST Countries API. If the API returns data for Colombia, the function extracts and returns selected fields as a tibble. If the request fails or Colombia is not found, it returns NULL and prints a message.

Value

A tibble with the following 8 columns:

  • name_common: Common name of the country.

  • name_official: Official name of the country.

  • region: Geographical region.

  • subregion: Subregion within the continent.

  • capital: Capital city.

  • area: Area in square kilometers.

  • population: Population of the country.

  • languages: Languages spoken in the country, as a comma-separated string.

Note

Requires internet connection. The data is retrieved in real time from the REST Countries API.

Source

REST Countries API: https://restcountries.com/

Examples

if (interactive()) {
  get_country_info_co()
}


ColombiAPI documentation built on May 6, 2026, 9:07 a.m.