Skip to contents

Retrieve various available information from Laws.Africa

Usage

al_get_areas(base_url = "https://api.laws.africa/v3/", flatten = TRUE)

al_get_works(area, base_url = "https://api.laws.africa/v3/", flatten = TRUE)

Arguments

base_url

Base URL for the Laws.Africa API. Current default set to https://api.laws.africa/v3/.

flatten

Logical. Should the output JSON be flattened into a tibble. Defeault is TRUE.

area

A character identifier for an area of interest for which information is to be retrieved from the Laws.API. For countries, this will be an alpha-2 ISO 3166-1 country code. For other areas, this can take many formats.

Value

If flatten = TRUE, a named list of two tibbles the first of which is for countries information and the second for localities information. Otherwise, a list output created from the JSON output of the request.

On Works

#' A Work is a piece of legislation, such as an act, regulation or by-law. A work may be amended over time and may even have its title changed. A work is uniquely identified by a work FRBR URI which never changes.

Examples

if (Sys.getenv("LAWS_AFRICA_TOKEN") != "") al_get_areas()