get_Colombia_info: Get Information About Colombia

View source: R/get_Colombia_info.R

get_Colombia_infoR Documentation

Get Information About Colombia

Description

This function makes an API call https://api-colombia.com/api/v1/Country/Colombia to retrieve information about Colombia, such as its name, surface area, population, time zone, currency, and region. It processes the API response and returns the data in a structured data.frame.

Usage

get_Colombia_info()

Details

The function sends a GET request to the API at https://api-colombia.com/api/v1/Country/Colombia. If the API returns a successful response (status code 200), the data is parsed and returned. If the response is unsuccessful or the structure is not as expected, the function will return NULL.

Value

A 'data.frame' with the following columns:

  • name: Name of the country.

  • surface: The surface area of the country in square kilometers.

  • population: The population of the country.

  • timeZone: The time zone of the country.

  • currency: The currency used in the country.

  • currencySymbol: The currency symbol.

  • region: The region of the country in the world.

Note

Ensure you have an active internet connection to access the API. If the API structure changes or the API becomes unavailable, the function may need modifications.

This function relies on the following packages: httr and jsonlite. These packages are used for making HTTP requests and processing JSON responses, respectively.

Examples

## Not run: 
  # Call the function to get Colombia information
  colombia_info <- get_Colombia_info()

  # Print the result
  print(colombia_info)

## End(Not run)


ColombiAPI documentation built on April 12, 2025, 1:42 a.m.