Title: | Client for World Banks's 'Indicators' and 'Poverty and Inequality Platform (PIP)' APIs |
Version: | 0.6.0 |
Description: | Download and search data from the 'World Bank Indicators API', which provides access to nearly 16,000 time series indicators. See https://datahelpdesk.worldbank.org/knowledgebase/articles/889392-about-the-indicators-api-documentation for further details about the API. |
License: | MIT + file LICENSE |
URL: | https://m-muecke.github.io/worldbank/, https://github.com/m-muecke/worldbank |
BugReports: | https://github.com/m-muecke/worldbank/issues |
Depends: | R (≥ 4.1.0) |
Imports: | httr2 (≥ 1.0.4) |
Suggests: | ggplot2, scales, testthat (≥ 3.2.0) |
Config/testthat/edition: | 3 |
Encoding: | UTF-8 |
RoxygenNote: | 7.3.2 |
NeedsCompilation: | no |
Packaged: | 2025-05-29 15:45:24 UTC; mmuecke |
Author: | Maximilian Mücke |
Maintainer: | Maximilian Mücke <muecke.maximilian@gmail.com> |
Repository: | CRAN |
Date/Publication: | 2025-05-29 16:00:02 UTC |
worldbank: Client for World Banks's 'Indicators' and 'Poverty and Inequality Platform (PIP)' APIs
Description
Download and search data from the 'World Bank Indicators API', which provides access to nearly 16,000 time series indicators. See https://datahelpdesk.worldbank.org/knowledgebase/articles/889392-about-the-indicators-api-documentation for further details about the API.
Author(s)
Maintainer: Maximilian Mücke muecke.maximilian@gmail.com (ORCID)
See Also
Useful links:
Report bugs at https://github.com/m-muecke/worldbank/issues
Return Finances One API Data
Description
Return Finances One API Data
Usage
fone_dataset(dataset_id, resource_id, ..., limit = NULL)
fone_view(view_id, ..., limit = NULL)
Arguments
dataset_id |
( |
resource_id |
( |
... |
( |
limit |
( |
view_id |
( |
Value
A data.frame()
with the requested dataset.
Source
https://financesone.worldbank.org/data
Examples
## Not run:
fone_dataset(dataset_id = "DS00047", resource_id = "RS00005")
fone_view(view_id = "DS01538")
## End(Not run)
Return auxiliary data tables
Description
Return auxiliary data tables
Usage
pip_aux(
table = NULL,
release_version = NULL,
ppp_version = NULL,
version = NULL
)
Arguments
table |
( |
release_version |
( |
ppp_version |
( |
version |
( |
Value
A character()
with the available tables or a data.frame()
containing the
table data.
Source
See Also
Other poverty and inequality statistics:
pip_citation()
,
pip_data()
,
pip_group()
,
pip_health_check()
,
pip_info()
,
pip_valid_params()
,
pip_versions()
Examples
# get a list of available tables
pip_aux()
# get countries
pip_aux("countries")
# get GDP
pip_aux("gdp")
# get CPI
pip_aux("cpi")
Return citation for a given version
Description
Return citation for a given version
Usage
pip_citation(release_version = NULL, ppp_version = NULL, version = NULL)
Arguments
release_version |
( |
ppp_version |
( |
version |
( |
Value
A data.frame()
with the citation.
Source
See Also
Other poverty and inequality statistics:
pip_aux()
,
pip_data()
,
pip_group()
,
pip_health_check()
,
pip_info()
,
pip_valid_params()
,
pip_versions()
Examples
pip_citation()
Return main poverty and inequality statistics
Description
Return main poverty and inequality statistics
Usage
pip_data(
country = NULL,
year = NULL,
povline = 2.15,
popshare = NULL,
fill_gaps = FALSE,
welfare_type = c("all", "consumption", "income"),
reporting_level = c("all", "national", "rural", "urban"),
additional_ind = FALSE,
release_version = NULL,
ppp_version = NULL,
version = NULL
)
Arguments
country |
( |
year |
( |
povline |
( |
popshare |
( |
fill_gaps |
( |
welfare_type |
( |
reporting_level |
( |
additional_ind |
( |
release_version |
( |
ppp_version |
( |
version |
( |
Value
A data.frame()
with the requested statistics.
Source
See Also
Other poverty and inequality statistics:
pip_aux()
,
pip_citation()
,
pip_group()
,
pip_health_check()
,
pip_info()
,
pip_valid_params()
,
pip_versions()
Examples
pip_data(c("ZAF", "ZMB"))
Return aggregation of PIP statistics
Description
Return aggregation of PIP statistics
Usage
pip_group(
country = NULL,
year = NULL,
povline = 2.15,
popshare = NULL,
group_by = c("wb", "none"),
fill_gaps = FALSE,
welfare_type = c("all", "consumption", "income"),
reporting_level = c("all", "national", "rural", "urban"),
additional_ind = FALSE,
release_version = NULL,
ppp_version = NULL,
version = NULL
)
Arguments
country |
( |
year |
( |
povline |
( |
popshare |
( |
group_by |
( |
fill_gaps |
( |
welfare_type |
( |
reporting_level |
( |
additional_ind |
( |
release_version |
( |
ppp_version |
( |
version |
( |
Value
A data.frame()
with the requested statistics.
Source
See Also
Other poverty and inequality statistics:
pip_aux()
,
pip_citation()
,
pip_data()
,
pip_health_check()
,
pip_info()
,
pip_valid_params()
,
pip_versions()
Examples
pip_group(c("AFE", "LAC"))
Determine if the API is running and listening as expected
Description
Determine if the API is running and listening as expected
Usage
pip_health_check()
Value
A character(1)
with the health check message.
Source
See Also
Other poverty and inequality statistics:
pip_aux()
,
pip_citation()
,
pip_data()
,
pip_group()
,
pip_info()
,
pip_valid_params()
,
pip_versions()
Examples
pip_health_check()
Return information about the API
Description
Return information about the API
Usage
pip_info()
Value
A data.frame()
with the API information.
Source
See Also
Other poverty and inequality statistics:
pip_aux()
,
pip_citation()
,
pip_data()
,
pip_group()
,
pip_health_check()
,
pip_valid_params()
,
pip_versions()
Examples
pip_info()
Return valid query parameters
Description
Return valid query parameters
Usage
pip_valid_params(
endpoint = c("all", "aux", "pip", "pip-grp", "pip-info", "valid-params"),
release_version = NULL,
ppp_version = NULL,
version = NULL
)
Arguments
endpoint |
( |
release_version |
( |
ppp_version |
( |
version |
( |
Value
A data.frame()
with the valid parameters.
Source
See Also
Other poverty and inequality statistics:
pip_aux()
,
pip_citation()
,
pip_data()
,
pip_group()
,
pip_health_check()
,
pip_info()
,
pip_versions()
Examples
pip_valid_params()
Return the available data versions
Description
Return the available data versions
Usage
pip_versions()
Value
A data.frame()
with the available versions.
Source
See Also
Other poverty and inequality statistics:
pip_aux()
,
pip_citation()
,
pip_data()
,
pip_group()
,
pip_health_check()
,
pip_info()
,
pip_valid_params()
Examples
pip_versions()
World Bank country data
Description
List all countries supported by the World Bank API.
Usage
wb_country(country = NULL, lang = "en")
Arguments
country |
( |
lang |
( |
Value
A data.frame()
with the available countries. The columns are:
country_id |
The country ID. |
country_code |
The country code. |
country_name |
The country name. |
region_id |
The region ID. |
region_code |
The region code. |
region_value |
The region value. |
admin_region_id |
The admin region ID. |
admin_region_code |
The admin region code. |
admin_region_value |
The admin region value. |
income_level_id |
The income level ID. |
income_level_code |
The income level code. |
income_level_value |
The income level value. |
lending_type_id |
The lending type ID. |
lending_type_code |
The lending type code. |
lending_type_value |
The lending type value. |
capital_city |
The capital city. |
longitude |
The longitude. |
latitude |
The latitude. |
Source
https://api.worldbank.org/v2/country
See Also
Other indicators data:
wb_income_level()
,
wb_indicator()
,
wb_language()
,
wb_lending_type()
,
wb_region()
,
wb_source()
,
wb_topic()
Examples
wb_country()
World Bank country indicator data
Description
List all country indicators supported by the World Bank API.
Usage
wb_country_indicator(
indicator = "NY.GDP.MKTP.CD",
country = NULL,
lang = "en",
start_date = NULL,
end_date = NULL
)
wb_data(
indicator = "NY.GDP.MKTP.CD",
country = NULL,
lang = "en",
start_date = NULL,
end_date = NULL
)
Arguments
indicator |
( |
country |
( |
lang |
( |
start_date |
(
|
end_date |
( |
Value
A data.frame()
with the available country indicators.
The columns are:
date |
The date |
indicator_id |
The indicator ID. |
indicator_name |
The indicator name. |
country_id |
The country ID. |
country_name |
The country name. |
country_code |
The country code. |
value |
The indicator value. |
unit |
The indicator unit. |
obs_status |
The observation status. |
decimal |
The decimal. |
Source
https://api.worldbank.org/v2/country/{country}/indicator/{indicator}
Examples
ind <- wb_country_indicator("NY.GDP.MKTP.CD", "US")
head(ind)
ind <- wb_country_indicator(
indicator = c("NY.GDP.MKTP.CD", "FP.CPI.TOTL.ZG"),
country = c("US", "DE", "FR", "CH", "JP"),
start_date = 2015, end_date = 2023
)
head(ind)
World Bank income level data
Description
List all income levels supported by the World Bank API.
Usage
wb_income_level(income = NULL, lang = "en")
Arguments
income |
( |
lang |
( |
Value
A data.frame()
with the available income levels. The columns are:
id |
The income level ID. |
iso2code |
The ISO 2 code of the income level. |
value |
The income level value. |
Source
https://api.worldbank.org/v2/incomeLevels
See Also
Other indicators data:
wb_country()
,
wb_indicator()
,
wb_language()
,
wb_lending_type()
,
wb_region()
,
wb_source()
,
wb_topic()
Examples
wb_income_level()
World Bank indicator data
Description
List all indicators supported by the World Bank API.
Usage
wb_indicator(indicator = NULL, lang = "en")
Arguments
indicator |
( |
lang |
( |
Value
A data.frame()
with the available indicators. The columns are:
id |
The indicator ID. |
name |
The indicator name. |
unit |
The indicator unit. |
source_id |
The source ID. |
source_value |
The source value. |
source_note |
The source note. |
source_organization |
The source organization. |
topic_id |
The topic ID. |
topic_value |
The topic value. |
Source
https://api.worldbank.org/v2/indicator
See Also
Other indicators data:
wb_country()
,
wb_income_level()
,
wb_language()
,
wb_lending_type()
,
wb_region()
,
wb_source()
,
wb_topic()
Examples
wb_indicator("NY.GDP.MKTP.CD")
World Bank available languages
Description
List all languages supported by the World Bank API.
Usage
wb_language()
Value
A data.frame()
with the available languages. The columns are:
code |
The language code. |
name |
The language name. |
native_form |
The native form of the language name. |
Source
https://api.worldbank.org/v2/languages
See Also
Other indicators data:
wb_country()
,
wb_income_level()
,
wb_indicator()
,
wb_lending_type()
,
wb_region()
,
wb_source()
,
wb_topic()
Examples
wb_language()
World Bank lending type data
Description
List all lending types supported by the World Bank API.
Usage
wb_lending_type(type = NULL, lang = "en")
Arguments
type |
( |
lang |
( |
Value
A data.frame()
with the available lending types. The columns are:
id |
The lending type ID. |
iso2code |
The ISO 2 code of the lending type. |
value |
The lending type value. |
Source
https://api.worldbank.org/v2/lendingTypes
See Also
Other indicators data:
wb_country()
,
wb_income_level()
,
wb_indicator()
,
wb_language()
,
wb_region()
,
wb_source()
,
wb_topic()
Examples
wb_lending_type()
World Bank region data
Description
List all regions supported by the World Bank API.
Usage
wb_region(region = NULL, lang = "en")
Arguments
region |
( |
lang |
( |
Value
A data.frame()
with the available regions. The columns are:
id |
The region ID. |
code |
The region code. |
iso2code |
The ISO 2 code of the region. |
name |
The region name. |
Source
https://api.worldbank.org/v2/region
See Also
Other indicators data:
wb_country()
,
wb_income_level()
,
wb_indicator()
,
wb_language()
,
wb_lending_type()
,
wb_source()
,
wb_topic()
Examples
wb_region()
World Bank source data
Description
List all sources supported by the World Bank API.
Usage
wb_source(source = NULL, lang = "en")
Arguments
source |
( |
lang |
( |
Value
A data.frame()
with the available sources. The columns are:
id |
The source ID. |
last_updated |
The date the source was last updated. |
name |
The source name. |
code |
The source code. |
description |
The source description. |
url |
The source URL. |
data_availability |
Whether the source has data available. |
metadata_availability |
Whether the source has metadata available. |
concepts |
The concepts associated with the source. |
Source
https://api.worldbank.org/v2/sources
See Also
Other indicators data:
wb_country()
,
wb_income_level()
,
wb_indicator()
,
wb_language()
,
wb_lending_type()
,
wb_region()
,
wb_topic()
Examples
wb_source()
World Bank topic data
Description
List all topics supported by the World Bank API.
Usage
wb_topic(topic = NULL, lang = "en")
Arguments
topic |
( |
lang |
( |
Value
A data.frame()
with the available topics. The columns are:
id |
The topic ID. |
value |
The topic value. |
source_note |
The source note. |
Source
https://api.worldbank.org/v2/topics
See Also
Other indicators data:
wb_country()
,
wb_income_level()
,
wb_indicator()
,
wb_language()
,
wb_lending_type()
,
wb_region()
,
wb_source()
Examples
wb_topic()