Access OECD countries and selected non-member economies data through the OECD API.
The Organisation for Economic Co-operation and Development (OECD) is an intergovernmental economic organisation with 36 member countries. It is a forum of countries providing a platform to compare policy experiences, seek answers to common problems, identify good practices and coordinate domestic and international policies of its members.
OECD : https://www.oecd.org/about/
Each of these functions are detailed in this course and some examples are provided.
The function search_dataset() searches for OECD indicators. It takes as an input the indicator that would be useful for your analysis. It searches and returns a table of all the available indicator related to the input inserted.
# Loading OECD library
library(OECD)
# List all available datasets
dataset_list <- get_datasets()
# Search all indicators with the term "unemployment"
search_dataset("unemployment", data = dataset_list)
The function get_data_structure takes as an input the id associate with the dataset and returns the structure of any query made with the OECD package.
# Structure of a query
dstruc <- get_data_structure("DUR_D")
str(dstruc, max.level = 1)
The function get_datasets takes as an input the dataset id and filters. Add a variable to list all of the specific filters allows to simplify the input of the function. get_datasets returns a dataframe containing the selected data.
# Filter use to narrow the research (Canada-Germany-France-USA; male and female; 20-24 years old)
filter_list <- list(c("DEU", "FRA", "CAN", "USA"), "MW", "2024")
# Dataframe containing selected data
unemployementOECD <- get_dataset(dataset = "DUR_D", filter = filter_list)
unemployementOECD[1:6,]
# Loading OECD library
library(OECD)
# List all available datasets
dataset_list <- get_datasets()
# Search all indicators with the term "unemployment"
search_dataset("unemployment", data = dataset_list)
# Structure of a query
dstruc <- get_data_structure("DUR_D")
str(dstruc, max.level = 1)
# Filter use to narrow the research (Canada-Germany-France-USA; male and female; 20-24 years old)
filter_list <- list(c("DEU", "FRA", "CAN", "USA"), "MW", "2024")
# Dataframe containing selected data
unemployementOECD <- get_dataset(dataset = "DUR_D", filter = filter_list)
unemployementOECD[1:6,]
Command | Detail |
---|---|
search_dataset() | Search for OECD indicators |
get_data_structure() | Read the structure of any query made with the OECD package |
get_datasets() | Find data related to the indicators |
This tutorial uses the OECD package documentation
For attribution, please cite this work as
Warin (2020, June 1). Thierry Warin, PhD: [API] OECD. Retrieved from https://warin.ca/posts/api-oecd/
BibTeX citation
@misc{warin2020[api], author = {Warin, Thierry}, title = {Thierry Warin, PhD: [API] OECD}, url = {https://warin.ca/posts/api-oecd/}, year = {2020} }